Skip to content

Commit b54f3e0

Browse files
Trotttargos
authored andcommitted
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: #27789 Reviewed-By: Ruben Bridgewater <[email protected]> Reviewed-By: Trivikram Kamat <[email protected]> Reviewed-By: James M Snell <[email protected]> Reviewed-By: Gus Caplan <[email protected]>
1 parent 144db48 commit b54f3e0

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

.eslintrc.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,10 @@ const path = require('path');
88
const NodePlugin = require('./tools/node_modules/eslint-plugin-node-core');
99
NodePlugin.RULES_DIR = path.resolve(__dirname, 'tools', 'eslint-rules');
1010

11+
// The Module._findPath() monkeypatching is to make it so that ESLint will work
12+
// if invoked by a globally-installed ESLint or ESLint installed elsewhere
13+
// rather than the one we ship. This makes it possible for IDEs to lint files
14+
// with our rules while people edit them.
1115
const ModuleFindPath = Module._findPath;
1216
const hacks = [
1317
'eslint-plugin-node-core',
@@ -236,7 +240,7 @@ module.exports = {
236240
{
237241
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'])",
238242
message: 'The first argument should be the `actual`, not the `expected` value.',
239-
}
243+
},
240244
],
241245
/* eslint-enable max-len */
242246
'no-return-await': 'error',

0 commit comments

Comments
 (0)