Closed bhollis closed 2 weeks ago
Hi thanks for the feedback, "excepts" accepts a regex, I will improve the documentation.
A better way to turn this rule off for files that match use*.tsx
is to utilize the override mechanism of the ESLint config, e.g. in eslint.config.js
, we can do something like this:
// ...
export default [
// ...
{
files: ["src/**/*.tsx"],
rules: {
"@eslint-react/naming-convention/filename": ["warn", "PascalCase"],
},
},
{
files: ["src/**/use*.tsx"],
rules: {
"@eslint-react/naming-convention/filename": "off"
},
},
];
This approach supports applying different naming conventions to different files, which is much more flexible than "excepts".
From the documentation, it's unclear whether "excepts" accepts a regex or glob. I'd like to turn this rule off for files that match
use*.tsx
.