This repository has been archived by the owner on Aug 31, 2023. It is now read-only.
This repository has been archived by the owner on Aug 31, 2023. It is now read-only.
🐛 style/noShoutyConstants
does not recognize multiple uses of a constant.
#3658
Labels
A-Linter
Area: linter
enhancement
New feature request or improvement to existing functionality
L-JavaScript
Langauge: JavaScript
Environment information
What happened?
Rome issues two
style/noShoutyConstants
errors for the following code, based on a real-world use case:Playground link
Specifically, it says:
This reasoning is faulty, because the constants are used several times each. If I apply the suggested fix, then the minified output increases by 50%1. Further, there are additional downsides:
Expected result
I would expect
style/noShoutyConstants
not to error (using its current reasoning) at most if a constant is used multiple times. Even for a single use: it is common to regularly change the number of uses of such a constant down to a single use and then later back up, so I would still find it undesirable to have any warning at all.So I'd personally like to advocate for
style/noShoutyConstants
not to be included in the default/recommended rules.Code of Conduct
Footnotes
127 bytes vs. 85 bytes using
npx esbuild --minify src.ts
. That's not taking compression into account, though. ↩The text was updated successfully, but these errors were encountered: