Skip to content

Commit

Permalink
tools: enable stricter linting in lib directory
Browse files Browse the repository at this point in the history
Enable ESLint 4.x linting and disable legacy linting in the lib
directory.

While doing this, some indentation in the .eslintrc.yaml file itself was
noticed to be incorrect. Fixed that too.

PR-URL: #14403
Reviewed-By: Anna Henningsen <anna@addaleax.net>
Reviewed-By: Yuta Hiroto <hello@about-hiroppy.com>
Reviewed-By: Colin Ihrig <cjihrig@gmail.com>
Reviewed-By: Evan Lucas <evanlucas@me.com>
Reviewed-By: Timothy Gu <timothygu99@gmail.com>
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Refael Ackermann <refack@gmail.com>
Reviewed-By: Alexey Orlenko <eaglexrlnk@gmail.com>
  • Loading branch information
Trott committed Jul 24, 2017
1 parent 8cccdd9 commit 7f5a745
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 10 deletions.
20 changes: 10 additions & 10 deletions .eslintrc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -102,17 +102,17 @@ rules:
func-name-matching: error
func-style: [error, declaration, {allowArrowFunctions: true}]
# indent: [error, 2, {ArrayExpression: first,
# CallExpression: {arguments: first},
# FunctionDeclaration: {parameters: first},
# FunctionExpression: {parameters: first},
# MemberExpression: off,
# ObjectExpression: first,
# SwitchCase: 1}]
# CallExpression: {arguments: first},
# FunctionDeclaration: {parameters: first},
# FunctionExpression: {parameters: first},
# MemberExpression: off,
# ObjectExpression: first,
# SwitchCase: 1}]
indent-legacy: [error, 2, {ArrayExpression: first,
CallExpression: {arguments: first},
MemberExpression: 1,
ObjectExpression: first,
SwitchCase: 1}]
CallExpression: {arguments: first},
MemberExpression: 1,
ObjectExpression: first,
SwitchCase: 1}]
key-spacing: [error, {mode: minimum}]
keyword-spacing: error
linebreak-style: [error, unix]
Expand Down
9 changes: 9 additions & 0 deletions lib/.eslintrc.yaml
Original file line number Diff line number Diff line change
@@ -1,4 +1,13 @@
rules:
indent: [error, 2, {ArrayExpression: first,
CallExpression: {arguments: first},
FunctionDeclaration: {parameters: first},
FunctionExpression: {parameters: first},
MemberExpression: off,
ObjectExpression: first,
SwitchCase: 1}]
indent-legacy: 0

# Custom rules in tools/eslint-rules
require-buffer: error
buffer-constructor: error
Expand Down

0 comments on commit 7f5a745

Please sign in to comment.