JoshuaKGoldberg / eslint-plugin-package-json

Rules for consistent, readable, and valid package.json files. 🗂️
MIT License
110 stars 20 forks source link

Rule request: kebab-case scripts #61

Open Zamiell opened 10 months ago

Zamiell commented 10 months ago

It is conventional for scripts in the "package.json" file to be in kebab-case, as evidenced here:

Thus, this plugin should warn when incorrectly named scripts exist such as "fooBar" (i.e. camelCase) or "FooBar" (i.e. PascalCase) or "foo_bar" (i.e. snake_case) or "FOO_BAR" (i.e. SCREAMING_SNAKE_CASE).

JoshuaKGoldberg commented 10 months ago

Makes sense! I can see value in having a naming conventions rule that enforces kebab-case. Other efforts have popped up to standardize them too:

I think for the first few iterations of this rule we probably wouldn't want it to be enabled by default - as it's rather pedantic and doesn't directly catch runtime issues (only indirectly). But strong +1 to it existing.

Questions that I think would need to be resolved: