From 8de20e00c5759c2cbf92befc232f8bbb5ef5f3e8 Mon Sep 17 00:00:00 2001 From: Ruben Bridgewater Date: Thu, 22 Feb 2018 12:50:50 +0100 Subject: [PATCH] tools: add falsely removed eslint rules This adds the eslint rules back in that were falsely removed while landing https://github.com/nodejs/node/pull/18566. PR-URL: https://github.com/nodejs/node/pull/18933 Refs: https://github.com/nodejs/node/pull/18566 Reviewed-By: Matteo Collina Reviewed-By: James M Snell Reviewed-By: Gus Caplan Reviewed-By: Colin Ihrig --- .eslintrc.js | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.eslintrc.js b/.eslintrc.js index 7526fe0dd8be98..db4ce2901c355a 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -71,6 +71,7 @@ module.exports = { 'accessor-pairs': 'error', 'array-callback-return': 'error', 'dot-location': ['error', 'property'], + 'dot-notation': 'error', eqeqeq: ['error', 'smart'], 'no-fallthrough': 'error', 'no-global-assign': 'error', @@ -111,6 +112,7 @@ module.exports = { ], 'no-return-await': 'error', 'no-self-assign': 'error', + 'no-self-compare': 'error', 'no-throw-literal': 'error', 'no-unused-labels': 'error', 'no-useless-call': 'error', @@ -180,6 +182,10 @@ module.exports = { /* eslint-disable max-len, quotes */ 'no-restricted-syntax': [ 'error', + { + selector: "CallExpression[callee.object.name='assert'][callee.property.name='doesNotThrow']", + message: "Please replace `assert.doesNotThrow()` and add a comment next to the code instead." + }, { selector: `CallExpression[callee.object.name='assert'][callee.property.name='throws'][arguments.1.type='Literal']:not([arguments.1.regex])`, message: 'use a regular expression for second argument of assert.throws()', @@ -204,6 +210,7 @@ module.exports = { /* eslint-enable max-len, quotes */ 'no-tabs': 'error', 'no-trailing-spaces': 'error', + 'no-unsafe-finally': 'error', 'object-curly-spacing': ['error', 'always'], 'one-var-declaration-per-line': 'error', 'operator-linebreak': ['error', 'after'],