-
-
Notifications
You must be signed in to change notification settings - Fork 681
Add support for generating ESLint Flat Config #2319
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
Signed-off-by: Conrad Hale <[email protected]>
It might be a while before I have time to work on this, if any maintainers want to take over this PR, feel free to make any edits. |
@conradhale Thanks! I added some more commits, could you please have a look at them? I am not sure what is still missing to have full Flat config support, so I am handing this back to you again 🙂 |
parserOptions: { | ||
ecmaVersion: 2020, | ||
sourceType: 'module' | ||
} |
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.
In most cases, you don't need to specify parserOptions
. just use:
languageOptions: {ecmaVersion: 2020, sourceType: 'module'}
eslint will pass it to the parser. So you don't need to specify global.es2015 either.
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.
plugins: { vue: module }, | ||
...require('./configs/flat/base') | ||
}, | ||
'flat/essential': { |
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.
I would like to change flat/essential
, flat/recommended
, and flat/strongly-recommended
to the config for Vue3. Use the vue2-
prefix to config for Vue2 instead.
@ota-meshi Is there anything blocking this PR from being merged now? I have been implementing |
@conradhale I can pick this up! (if you don't mind :) |
I would like the configuration to be renamed.
We also need test code to test the flat configuration. |
Will fix #1291
Needs more work, haven't had the time to work on this lately.
I was thinking it would be better to replace the generated config files with JS functions that dynamically return the correct configuration. Should decrease the size of the library and make the code a bit cleaner with the addition of flat configs and probably wouldn't impact runtime performance much. Most other eslint plugins seem to be doing this as well.