eslint 8.57.0
eslint-plugin-unicorn 51.0.1
rule unicorn/filename-case
When using a flat config, multipleFileExtensions
option is not true
by default and can't be set to true
.
This config
{
files: [
"**/*.stories.js",
"**/*.stories.ts",
"**/*.view.test.js",
"**/*.view.test.ts",
],
rules: {
"unicorn/filename-case": [
"error",
{ case: "pascalCase" },
],
},
}
outputs this error (though it should't)
/MobileMenu.stories.js
1:1 error Filename is not in pascal case. Rename it to `MobileMenu.Stories.js` unicorn/filename-case
When trying to set multipleFileExtensions
to true
explicitly:
{
files: [
"**/*.stories.js",
"**/*.stories.ts",
"**/*.view.test.js",
"**/*.view.test.ts",
],
rules: {
"unicorn/filename-case": [
"error",
{ case: "pascalCase", multipleFileExtensions: true },
],
},
}
eslint doesn't run throwing a config validation error:
Oops! Something went wrong! :(
Error: Key "rules": Key "unicorn/filename-case": Value {"case":"pascalCase","multipleFileExtensions":true} should NOT have additional properties.
Value {"case":"pascalCase","multipleFileExtensions":true} should NOT have additional properties.
Value {"case":"pascalCase","multipleFileExtensions":true} should match exactly one schema in oneOf.
Pay now to fund the work behind this issue.
Get updates on progress being made.
Maintainer is rewarded once the issue is completed.
You're funding impactful open source efforts
You want to contribute to this effort
You want to get funding like this too