Skip to content

Commit

Permalink
[Fix] jsx-pascal-case: false negative with namespacing
Browse files Browse the repository at this point in the history
Fixes #1336.
  • Loading branch information
mehmet authored and ljharb committed Jul 31, 2017
1 parent d02bb9a commit 5fac02c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/rules/jsx-pascal-case.js
Expand Up @@ -13,7 +13,7 @@ const jsxUtil = require('../util/jsx');
// Constants
// ------------------------------------------------------------------------------

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

// ------------------------------------------------------------------------------
Expand Down
4 changes: 3 additions & 1 deletion tests/lib/rules/jsx-pascal-case.js
Expand Up @@ -45,7 +45,7 @@ ruleTester.run('jsx-pascal-case', rule, {
}, {
code: '<TestComponent1 />'
}, {
code: '<T3stComp0nent />'
code: '<T3StComp0Nent />'
}, {
code: '<T />'
}, {
Expand All @@ -59,6 +59,8 @@ ruleTester.run('jsx-pascal-case', rule, {
options: [{allowAllCaps: true}]
}, {
code: '<Modal.Header />'
}, {
code: '<qualification.T3StComp0Nent />'
}, {
code: '<Modal:Header />'
}, {
Expand Down

0 comments on commit 5fac02c

Please sign in to comment.