Skip to content

Commit

Permalink
tools: edit .eslintrc.js for minor maintainability improvements
Browse files Browse the repository at this point in the history
* 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: nodejs#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>
  • Loading branch information
Trott committed May 24, 2019
1 parent df22778 commit 5b8df5e
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -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',
Expand Down Expand Up @@ -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',
Expand Down

0 comments on commit 5b8df5e

Please sign in to comment.