diff options
author | Rich Trott <rtrott@gmail.com> | 2019-05-24 10:16:16 -0700 |
---|---|---|
committer | Rich Trott <rtrott@gmail.com> | 2019-05-24 11:12:51 -0700 |
commit | 5b8df5e956680dc1a38b631e53f5e70a905fd917 (patch) | |
tree | 3d9f545c988193786ee1687adca3e19188856234 /.eslintrc.js | |
parent | df227786883c8efacaa99472922fbd96c54dd045 (diff) | |
download | node-new-5b8df5e956680dc1a38b631e53f5e70a905fd917.tar.gz |
tools: edit .eslintrc.js for minor maintainability improvements
* Add a comment explaining the Module._findPath() hacks so that someone
else doesn't do what I do and try to remove them because they seem
unnecessary for `make lint` and friends.
* Add a trailing comma for consistency with the rest of the file.
PR-URL: https://github.com/nodejs/node/pull/27789
Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de>
Reviewed-By: Trivikram Kamat <trivikr.dev@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
Reviewed-By: Gus Caplan <me@gus.host>
Diffstat (limited to '.eslintrc.js')
-rw-r--r-- | .eslintrc.js | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/.eslintrc.js b/.eslintrc.js index 55b61cea63..32c8574180 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -8,6 +8,10 @@ const path = require('path'); const NodePlugin = require('./tools/node_modules/eslint-plugin-node-core'); NodePlugin.RULES_DIR = path.resolve(__dirname, 'tools', 'eslint-rules'); +// The Module._findPath() monkeypatching is to make it so that ESLint will work +// if invoked by a globally-installed ESLint or ESLint installed elsewhere +// rather than the one we ship. This makes it possible for IDEs to lint files +// with our rules while people edit them. const ModuleFindPath = Module._findPath; const hacks = [ 'eslint-plugin-node-core', @@ -236,7 +240,7 @@ module.exports = { { selector: "CallExpression[callee.property.name='strictEqual'][arguments.0.type='Literal']:not([arguments.1.type='Literal']):not([arguments.1.type='ObjectExpression']):not([arguments.1.type='ArrayExpression']):not([arguments.1.type='UnaryExpression'])", message: 'The first argument should be the `actual`, not the `expected` value.', - } + }, ], /* eslint-enable max-len */ 'no-return-await': 'error', |