From 7f5a745e35bec2bde067c2922f6a9146beed99e6 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. 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 b956f3e5a2..f8ef2cec41 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 24f54e6826..1015a5fd25 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