-
Notifications
You must be signed in to change notification settings - Fork 22
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
feat: support flat configs #196
Conversation
This adds support for eslint's new flat config file feature. Supporting both systems in one config object is a rather messy situation, so we've opted here for multiple distinct configs instead. Old style config files can continue using config objects: ```json { extends: ['plugin:lit/recommended'] } ``` While new style config files can use the `flat/recommended` variety: ```json [ { "files": ["*.js"], ...configs['flat/recommended'] } ] ```
Hey @43081j ! Thank you for this! Just tested it locally, the flat config works great! Could you please adjust the types of the base configs a bit? The thing is, currently the In ESLint types, Linter.RuleEntry type is used for the values of the rules object in both Linter.BaseConfig and Linter.FlatConfig config. Currently, I'm including ESLint plugins like this. This is also considered a flat config. It's convenient for me to keep all configuration options in one place. But right now, since the types in the lit plugin's rules object consist only of strings, I'm getting errors that the types are not compatible. If we fix the types to use |
that will be because we're letting typescript infer the type rather than being explicit i'll update in this branch since it should be a one line change |
I understood the problem, thanks! Just wanted to give you all the details on why it would be better to change it. Look forward to your changes 🙏 |
that should all be sorted now if you can try it out, that would be super helpful. i'll look to merge/release it in the next couple of days |
Just checked! Everything looks fine, thank you! |
When will this be published? It's not available in |
i'll sort a new release out today 👍 |
you should be able to use will update the README separately when i get chance |
@43081j Wow, thanks! Didn't expect it this quick. Seems to work as expected 🥳 |
This is awesome, thank you so much! Just a quick note, the README.md does not mention the flat config style, so at first I didn't think this plugin had updated until I went searching through the issues. |
We should definitely add that 👍 I'll see if I can sort it out this week |
This adds support for eslint's new flat config file feature.
Supporting both systems in one config object is a rather messy situation, so we've opted here for multiple distinct configs instead.
Old style config files can continue using config objects:
While new style config files can use the
flat/recommended
variety:Fixes #194
cc @what1s1ove