sindresorhus/eslint-plugin-unicorn

`string-content` rule: case insensitive matching

已關閉

#2,277 建立於 2024年2月7日

 (1 則留言) (0 個反應) (0 位負責人)JavaScript (468 個分叉)user submission
enhancementhelp wanted

倉庫指標

星標
 (5,022 顆星)
PR 合併指標
 (平均合併 4小時 30分鐘) (30 天內合併 26 個 PR)

描述

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?

貢獻者指南