From d11840c180db5f27d9361c9f7ce06de6dea421e6 Mon Sep 17 00:00:00 2001 From: Rich Trott Date: Thu, 20 Jul 2017 14:36:08 -0700 Subject: [PATCH] tools: enable stricter linting in lib directory 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: https://github.com/nodejs/node/pull/14520 Backport-Reviewed-By: Anna Henningsen PR-URL: https://github.com/nodejs/node/pull/14403 Reviewed-By: Anna Henningsen Reviewed-By: Yuta Hiroto Reviewed-By: Colin Ihrig Reviewed-By: Evan Lucas Reviewed-By: Timothy Gu Reviewed-By: Luigi Pinca Reviewed-By: James M Snell Reviewed-By: Refael Ackermann Reviewed-By: Alexey Orlenko --- .eslintrc.yaml | 20 ++++++++++---------- lib/.eslintrc.yaml | 9 +++++++++ 2 files changed, 19 insertions(+), 10 deletions(-) diff --git a/.eslintrc.yaml b/.eslintrc.yaml index 5e025301fe8a62..0ba050d4c60628 100644 --- a/.eslintrc.yaml +++ b/.eslintrc.yaml @@ -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] diff --git a/lib/.eslintrc.yaml b/lib/.eslintrc.yaml index 24f54e682636ee..1015a5fd25f003 100644 --- a/lib/.eslintrc.yaml +++ b/lib/.eslintrc.yaml @@ -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