sindresorhus / eslint-plugin-unicorn

More than 100 powerful ESLint rules
MIT License
4.18k stars 362 forks source link

unicorn/filename-case: add option to disallow uppercase in kebab case #2044

Open golopot opened 1 year ago

golopot commented 1 year ago

When kebab case is configured

"unicorn/filename-case": [
    "error",
    {
        "cases": {
            "kebabCase": true
        }
    }
]

, the rule still accepts Article.ts as a valid name. I want to disallow this, and the file should be named article.ts

say8425 commented 1 year ago

Add the "pascalCase": true to cases. Or if you need to use more complicated rule, I recommend to use eslint-plugin-filename-rules.

thorn0 commented 1 year ago

Probably this should be changed even without adding an option. The notion of "kebab case" has been popularized mostly by Lodash, so Lodash's case converting functions can be considered kind of canonical. _.kebabCase('Article')article