Description:
when I run node scripts/lint/add.cjs aRule react, the auto generated file keeps changing the spelling of the rules prefixed with node jsxA11y. Master has capital Y jsxA11Y which doesn't match the lowercase y in the pathname. I'm for matching the pathname, so if it's capital Y in pathname, then same for the rule name, and if lowercase Y, then match in pathname and rulename.
node scripts/lint/add.cjs aRule react
The updated file shouldn't affect those lines
What's happening is that when lint --save is ran it's automatically renaming those variables to "correct camelcase". There's not really a way for us to correctly infer that when "a11y" is one word.
We should update scripts/lint/add.cjs to properly convert the rule name to the camelcase format we expect. Might be weird since the camelcase logic is a bit complicated. See toVariableCamelCase in packages/@romejs/js-compiler/lint/rules/regular/camelCase.ts that then uses packages/@romejs/string-utils/toCamelCase.ts.
alternatively, we can put all jsx_a11y into it's own directory at the level of react and regular
That way contributors don't have to keep adding that prefix which I had to think about as I was naming (jsxA11y , or jsxA11Y).
Also would make it easier to read the names of the rules because seeing the prefix just makes it harder to find the rule you're looking for sometimes if you're just trying to read the file names.
I'm actually working on a slight reorganization of our lint rules so that they properly align with their upstream plugin groupings. To @VictorHom's point, we have jsx-a11y rules in the react group, etc.
Regardless of the updated grouping, I still think we should be camel casing generated filenames in using the same logic as the linter like @sebmck suggested. Addressed in #470.
Most helpful comment
I'm actually working on a slight reorganization of our lint rules so that they properly align with their upstream plugin groupings. To @VictorHom's point, we have
jsx-a11yrules in thereactgroup, etc.Regardless of the updated grouping, I still think we should be camel casing generated filenames in using the same logic as the linter like @sebmck suggested. Addressed in #470.