Closed 43081j closed 3 months ago
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 .d.ts
file looks like the value of the rules object is a string
. Though that's not entirely correct.
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 Linter.RuleEntry
instead of strings, all errors will disappear.
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
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
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 1.11.0
i'll sort a new release out today 👍
1.12.0
has been published now, please let me know if all works as expected
you should be able to use configs['flat/recommended']
for example
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