sindresorhus/eslint-plugin-unicorn

`string-content` rule: case insensitive matching

Chiusa

#2277 aperta il 7 feb 2024

 (1 commento) (0 reazioni) (0 assegnatari)JavaScript (468 fork)user submission
enhancementhelp wanted

Metriche repository

Star
 (5022 stelle)
Metriche merge PR
 (Merge medio 1g 16h) (399 PR mergiate in 30 g)

Descrizione

I'd like to be able to match a word case insensitively to be able to catch words that should be abbreviated in my project, eg End of Day -> EOD. I've tried using the (?i) regex mode modifier but it breaks the parsing, and using '/End of Day/i' doesn't work. Whatever the recommended way to do this is, even if it's just '[Ee][Nn][Dd]\\s+[Oo][Ff]\\s+[Dd][Aa][Yy]', could it be added to string-content.md?

Guida contributor