From 85644b41f3e6513fb6f79a45f38a7db93abe6d10 Mon Sep 17 00:00:00 2001 From: trueberryless Date: Fri, 10 Jan 2025 18:17:20 +0100 Subject: [PATCH] Fix hyphen issue --- index.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/index.ts b/index.ts index 6434316..f11dbce 100644 --- a/index.ts +++ b/index.ts @@ -39,7 +39,8 @@ const retextCasePolice: Plugin<[Settings] | [], Root> = search(tree, casePoliceKeys, (nodes) => { const actual = toString(nodes); const actualLowerCased = actual.toLowerCase(); - const expected = casePoliceDicts[actualLowerCased]; + const actualLowerCasedNoHyphens = actual.toLowerCase().replace(/-/g, ''); + const expected = casePoliceDicts[actualLowerCased] ?? casePoliceDicts[actualLowerCasedNoHyphens]; if (!ignore.includes(expected) && actual !== expected) { const msg = file.message(