tools icon indicating copy to clipboard operation
tools copied to clipboard

🐛 false positive noShoutyConstants

Open IWANABETHATGUY opened this issue 3 years ago • 0 comments

Environment information

According https://rome.tools/docs/lint/rules/noShoutyConstants/

Disallow the use of constants which its value is the upper-case version of its name.

Such code snippet should not emit a warning:

let lib = "lib"

https://play.rome.tools/?code=let+lib+%3D+%22lib%22&lineWidth=80&indentStyle=tab&quoteStyle=double&indentWidth=2&sourceType=module&typescript=false&jsx=false#bABlAHQAIABsAGkAYgAgAD0AIAAiAGwAaQBiACIA

What happened?

Rome emit a diagnostic

Expected result

This code snippet will not raise an error.

Also for such code snippet:

export const CON = 'CON'

don't raise an error, because it is a common pattern for redux and vuex when writing action type.

Code of Conduct

  • [X] I agree to follow Rome's Code of Conduct

IWANABETHATGUY avatar Aug 17 '22 14:08 IWANABETHATGUY