Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit b54f3e0

Browse filesBrowse 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 <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>
1 parent 144db48 commit b54f3e0
Copy full SHA for b54f3e0

File tree

Expand file treeCollapse file tree

1 file changed

+5
-1
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

1 file changed

+5
-1
lines changed
Open diff view settings
Collapse file

‎.eslintrc.js‎

Copy file name to clipboardExpand all lines: .eslintrc.js
+5-1Lines 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 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.