sindresorhus/eslint-plugin-unicorn

`string-content` rule: case insensitive matching

Closed

#2,277 opened on Feb 7, 2024

 (1 comment) (0 reactions) (0 assignees)JavaScript (468 forks)user submission
enhancementhelp wanted

Repository metrics

Stars
 (5,022 stars)
PR merge metrics
 (Avg merge 1d 16h) (399 merged PRs in 30d)

Description

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?

Contributor guide