-
Notifications
You must be signed in to change notification settings - Fork 6
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
Flat config support ? #31
Comments
Could you elaborate a bit on that? May be show some examples by what you mean "cumbersome". As far as i understand having "flat" config vs legacy should not affect plugins and rules only the way how you declare them. |
@thekip It does require very specific structure, and plugin porting, with some backward compat guarantees.
This won't work import lingui from 'eslint-plugin-lingui';
export default [{
files: ['*.js', '*.cjs', '**/src/**/*.js', '**/src/**/*.jsx'],
plugins: {
lingui,
},
rules: {
...lingui.configs.recommended.rules
}
}]; This won't work either... import lingui from 'eslint-plugin-lingui';
export default [{
files: ['*.js', '*.cjs', '**/src/**/*.js', '**/src/**/*.jsx'],
plugins: {
lingui,
},
rules: {
...Object.fromEntries(Object.entries(lingui.rules).map(([key, value]) => [`lingui/${key}`, 'warn']))
}
}]; Because lingui plugin only exports obsolete rules format, and there are no Configs |
Go this, thanks. Would you be interesting opening a PR? It seems it's not a complicated change. |
@thekip sure, I'll fix this when I'll get some free time. |
Update: i've just checked the plugin, and it seems it's not a subject for the change at least for now. Because it doesn't expose any "recommended" setup, only rules which are not have to be updated. |
Using this plugin with flat config is a bit cumbersome atm.
It would've been nice to update it to the most recent plugin structure and provide couple flat config examples.
The text was updated successfully, but these errors were encountered: