Extract rule: template-modifier-name-case#2452
Conversation
5b47d3a to
7ff4e6c
Compare
Review from claude: comparing against
|
| Input | Original | PR |
|---|---|---|
FooBar |
foo-bar |
-foo-bar |
XFoo |
x-foo |
-x-foo |
HTMLParser |
htmlparser |
-h-t-m-l-parser |
The current test cases all use lowercase-initial camelCase (didInsert, fooBar) so the bug doesn't surface. It would break any PascalCase or acronym-prefixed modifier name. The original also handles :: →
/ for namespaced paths (e.g. Foo::BarBaz → foo/bar-baz).
Fix: port the original's dasherize-component-name helper, or at minimum add the index-0 and consecutive-capital guards.
Unused broken messageId. meta.messages.dasherized uses {{dasherizeModifierName}} for both the before and after placeholders — it would render the same value twice. It's never actually used (the rule
builds messages via generateErrorMessage inline). Either fix the template to use distinct placeholders and switch to messageId, or remove it.
7ff4e6c to
b3991f2
Compare
Split from #2371.