Skip to content

Commit 0f47a76

Browse files
Rel1cxCopilot
andauthored
Update packages/plugins/eslint-plugin-react-naming-convention/src/rules/filename.ts
Co-authored-by: Copilot <[email protected]> Signed-off-by: REL1CX <[email protected]>
1 parent ca73c38 commit 0f47a76

File tree

1 file changed

+1
-1
lines changed
  • packages/plugins/eslint-plugin-react-naming-convention/src/rules

1 file changed

+1
-1
lines changed

packages/plugins/eslint-plugin-react-naming-convention/src/rules/filename.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,7 +101,7 @@ export function create(context: RuleContext<MessageID, Options>): RuleListener {
101101

102102
function validate(name: string, casing: Case = rule, ignores = excepts) {
103103
if (ignores.some((pattern) => pattern.test(name))) return true;
104-
const filteredName = name.match(/[\w-]/gu)?.join("") ?? "";
104+
const filteredName = name.match(/[a-zA-Z0-9_-]/gu)?.join("") ?? "";
105105
if (filteredName.length === 0) return true;
106106
return match(casing)
107107
.with("PascalCase", () => RE.PASCAL_CASE.test(filteredName))

0 commit comments

Comments
 (0)