Skip to content

Commit b14d73c

Browse files
author
mehmet
committed
case jsx-eslint#1334 - false negative with namespacing/qualifications using jsx-pascal
case jsx-eslint#1336 - false postive with names starting with a number using jsx-pascal [Can besaid it is fixed, but inside it is not accepted anyway. Seems just fixed the regex]
1 parent a19eec6 commit b14d73c

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

lib/rules/jsx-pascal-case.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ const elementType = require('jsx-ast-utils/elementType');
1111
// Constants
1212
// ------------------------------------------------------------------------------
1313

14-
const PASCAL_CASE_REGEX = /^([A-Z0-9]|[A-Z0-9]+[a-z0-9]+(?:[A-Z0-9]+[a-z0-9]*)*)$/;
14+
const PASCAL_CASE_REGEX = /^(.*[.])*([A-Z]|[A-Z]+[a-z0-9]+(?:[A-Z0-9]+[a-z0-9]*)*)$/;
1515
const COMPAT_TAG_REGEX = /^[a-z]|\-/;
1616
const ALL_CAPS_TAG_REGEX = /^[A-Z0-9]+$/;
1717

tests/lib/rules/jsx-pascal-case.js

+2
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,8 @@ ruleTester.run('jsx-pascal-case', rule, {
5151
options: [{allowAllCaps: true}]
5252
}, {
5353
code: '<Modal.Header />'
54+
}, {
55+
code: '<qualification.T3stComp0nent />'
5456
}, {
5557
code: '<Modal:Header />'
5658
}, {

0 commit comments

Comments
 (0)