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.

Backport-PR-URL: #14520
Backport-Reviewed-By: Anna Henningsen <[email protected]>

PR-URL: #14403
Reviewed-By: Anna Henningsen <[email protected]>
Reviewed-By: Yuta Hiroto <[email protected]>
Reviewed-By: Colin Ihrig <[email protected]>
Reviewed-By: Evan Lucas <[email protected]>
Reviewed-By: Timothy Gu <[email protected]>
Reviewed-By: Luigi Pinca <[email protected]>
Reviewed-By: James M Snell <[email protected]>
Reviewed-By: Refael Ackermann <[email protected]>
Reviewed-By: Alexey Orlenko <[email protected]>
  • Loading branch information
Trott authored and addaleax committed Jul 27, 2017
1 parent 9e5a088 commit d11840c
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 d11840c

Please sign in to comment.