Skip to content

Commit f1041d2

Browse files
mehmetljharb
mehmet
authored andcommitted
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 0d7019b commit f1041d2

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
@@ -13,7 +13,7 @@ const jsxUtil = require('../util/jsx');
1313
// Constants
1414
// ------------------------------------------------------------------------------
1515

16-
const PASCAL_CASE_REGEX = /^([A-Z0-9]|[A-Z0-9]+[a-z0-9]+(?:[A-Z0-9]+[a-z0-9]*)*)$/;
16+
const PASCAL_CASE_REGEX = /^(.*[.])*([A-Z]|[A-Z]+[a-z0-9]+(?:[A-Z0-9]+[a-z0-9]*)*)$/;
1717
const ALL_CAPS_TAG_REGEX = /^[A-Z0-9]+([A-Z0-9_]*[A-Z0-9]+)?$/;
1818

1919
// ------------------------------------------------------------------------------

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

+2
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,8 @@ ruleTester.run('jsx-pascal-case', rule, {
5959
options: [{allowAllCaps: true}]
6060
}, {
6161
code: '<Modal.Header />'
62+
}, {
63+
code: '<qualification.T3stComp0nent />'
6264
}, {
6365
code: '<Modal:Header />'
6466
}, {

0 commit comments

Comments
 (0)