From 5b05f07cd186374ee6dc8b971a50d608fe1cf483 Mon Sep 17 00:00:00 2001 From: Rich Trott Date: Thu, 20 Jul 2017 14:35:51 -0700 Subject: [PATCH 1/2] lib: adjust indentation for impending lint change ESLint 4.x provides stricter indentation linting than previous versions. In preparation for enabling the stricter indentation linting, adjust the indentation of four lines in lib/net.js and lib/repl.js. 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 --- lib/net.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/net.js b/lib/net.js index 27df6253f16145..a4dcbec84b49f0 100644 --- a/lib/net.js +++ b/lib/net.js @@ -986,9 +986,9 @@ Socket.prototype.connect = function() { if (pipe) { if (typeof path !== 'string') { throw new errors.TypeError('ERR_INVALID_ARG_TYPE', - 'options.path', - 'string', - path); + 'options.path', + 'string', + path); } internalConnect(this, path); } else { From de375888d93a688ca3afcbf7fd1db7df9242ec69 Mon Sep 17 00:00:00 2001 From: Rich Trott Date: Thu, 20 Jul 2017 14:36:08 -0700 Subject: [PATCH 2/2] 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 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