-
-
Notifications
You must be signed in to change notification settings - Fork 6.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
chore: duplicate eslint rules locally to allow warning #10579
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yay, thanks!
@@ -9,4 +9,6 @@ exports.rules = { | |||
'ban-types-eventually': require('@typescript-eslint/eslint-plugin').rules[ | |||
'ban-types' | |||
], | |||
'prefer-rest-params-eventually': require('eslint/lib/rules/prefer-rest-params'), |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
So these exist off of require('eslint')
instead of the deep import?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you mean "do"?
If so then, no they don't - because eslint
is the "core", it doesn't export its rules in the same way plugins do, so you can't do require('eslint').rules['<rule>']
.
In fact, it doesn't export its rules at all:
❯ node
Welcome to Node.js v14.4.0.
Type ".help" for more information.
> require('eslint')
{
Linter: [Function: Linter],
CLIEngine: [Function: CLIEngine] {
version: '7.8.1',
getFormatter: [Function: getFormatter]
},
ESLint: [Function: ESLint],
RuleTester: [Function: RuleTester] {
[Symbol(it)]: null,
[Symbol(describe)]: null
},
SourceCode: [Function: SourceCode]
}
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍
This pull request has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. |
Summary
See this comment.
Test plan