-
Notifications
You must be signed in to change notification settings - Fork 5
NEW(eslint): @W-18495555@: Allow users to supply their own custom "flat" ESLint configuration file #302
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
Conversation
afc4010
to
904ce44
Compare
…at" ESLint configuration file
904ce44
to
70fcaa2
Compare
@@ -34,6 +34,7 @@ export class ESLintEngine extends Engine { | |||
private readonly delegateV8Engine: Engine; | |||
private userConfigInfoCache: Map<string, UserConfigInfo> = new Map(); | |||
private eslintContextCache: Map<string, ESLintContext> = new Map(); | |||
private workspaceIdsThatHaveWarnedAboutESLint8: Set<string> = new Set(); |
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.
The CLI only calls runRules
after already calling describeRules
. Is there a conceivable flow where that wouldn't be the case? If not, then do we really need this variable, or could we get away with only having the one check take place in describe
?
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.
Yeah I went back and forth with this one... I really wanted to have a test though that confirmed that the run was being called on the v8 engine. I hope this will all go away once we stop supporting v8.
I guess I could just remove the warn check from the runRules test though. Let me me do that so I can remove this state... hold on...
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.
OK pushed commit
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.
As I edited, I tried to roughly use the same terminology as in the ESLint docs (https://eslint.org/docs/latest/use/configure/migration-guide). They're a bit all over the map, but they mostly seem to use "flag configuration file" and "eslintrc configuration file." So I think we should include "eslintrc" in our messages too. And then, to make it even more clear, I landed on "legacy eslintrc ESLint configuration file" for the old stuff, and just "flat ESLint configuration file" for the new. A mouthful, I know, but hopefully it's clear and consistent with the ESLint docs. Let me know....
IgnoringFlatConfigFile: // TODO: Remove this as soon as we support user's providing their own flat config files | ||
`Ignoring '%s' since ESLint "Flat" configuration files are not yet supported by this version of the 'eslint' engine.`, | ||
DetectedLegacyConfig: | ||
`Using ESLint v8 instead of ESLint v9 since the use of a "legacy" ESLint configuration file or ignore file was detected: %s.\n` + |
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.
`Using ESLint v8 instead of ESLint v9 since the use of a "legacy" ESLint configuration file or ignore file was detected: %s.\n` + | |
`Using ESLint v8 instead of ESLint v9 because we detected the use of a legacy eslintrc ESLint configuration file or ignore file: %s.\n` + |
`Ignoring '%s' since ESLint "Flat" configuration files are not yet supported by this version of the 'eslint' engine.`, | ||
DetectedLegacyConfig: | ||
`Using ESLint v8 instead of ESLint v9 since the use of a "legacy" ESLint configuration file or ignore file was detected: %s.\n` + | ||
`Since ESLint v8 is no longer supported, Code Analyzer will be removing support for "legacy" ESLint configuration files in the coming months.\n` + |
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.
`Since ESLint v8 is no longer supported, Code Analyzer will be removing support for "legacy" ESLint configuration files in the coming months.\n` + | |
`Because ESLint v8 is no longer supported, Code Analyzer will be removing support for legacy eslintrc ESLint configuration files in the coming months.\n` + |
DetectedLegacyConfig: | ||
`Using ESLint v8 instead of ESLint v9 since the use of a "legacy" ESLint configuration file or ignore file was detected: %s.\n` + | ||
`Since ESLint v8 is no longer supported, Code Analyzer will be removing support for "legacy" ESLint configuration files in the coming months.\n` + | ||
`Therefore, it is highly recommended that you migrate your "legacy" configuration to the new "flat" configuration format as soon as possible.\n` + |
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.
`Therefore, it is highly recommended that you migrate your "legacy" configuration to the new "flat" configuration format as soon as possible.\n` + | |
`Therefore, we highly recommend that you migrate your legacy eslintrc configuration to the new flat configuration format as soon as possible.\n` + |
InvalidLegacyConfigFileName: | ||
`The '%s' configuration value is invalid. Expected the file name '%s' to be one of the following: %s`, | ||
InvalidESLintConfigFileName: | ||
`The '%s' configuration value is invalid. Expected either a "flat" ESLint configuration file that ends with %s or a known "legacy" ESLint configuration file name from among %s.`, |
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.
`The '%s' configuration value is invalid. Expected either a "flat" ESLint configuration file that ends with %s or a known "legacy" ESLint configuration file name from among %s.`, | |
`The '%s' configuration value is invalid. Expected either a flat ESLint configuration file that ends with %s or a known legacy eslintrc ESLint configuration file name from among %s.`, |
`Learn how at: https://eslint.org/docs/latest/use/configure/migration-guide`, | ||
|
||
ApplyingFlatConfigFile: | ||
`Applying the ESLint "flat" configuration file: %s`, |
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.
`Applying the ESLint "flat" configuration file: %s`, | |
`Applying the flat ESLint configuration file: %s`, |
No description provided.