eslint-config
eslint-config copied to clipboard
Allow setting `files` for each package (react, solid, astro etc.) in the options
Clear and concise description of the problem
At the moment it's only possible to define true
or overrides
in this config:
export default antfu(
{
react: true,
solid: {
overrides: {
// ...
}
}
}
)
If you have a monorepo (like me) where you use React and Solid, the rules collide.
Suggested solution
It would be great to allow the files
option in the settings for each package like it's already possible when calling the function like react()
or solid()
, so the scope can be changed like this:
export default antfu(
{
react: {
files: ['packages/app1/**/*.tsx']
},
solid: {
files: ['packages/app2/**/*.tsx']
}
}
)
Alternative
As an alternative, manually calling and adding the packages works too. It just feels a little bit hacky and the feature request is more convenient.
import antfu, { react, solid } from '@antfu/eslint-config'
export default antfu(
{
react: false,
solid: false
},
react({
files: ['packages/app1/**/*.tsx'],
}),
solid({
files: ['packages/app2/**/*.tsx'],
})
)
Additional context
This was discussed in #625 already.
Validations
- [X] Follow our Code of Conduct
- [X] Read the Contributing Guide.
- [X] Check that there isn't already an issue that request the same feature to avoid creating a duplicate.