Skip to content

Commit

Permalink
case #1334 - false negative with namespacing/qualifications using jsx…
Browse files Browse the repository at this point in the history
…-pascal

case #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]
  • Loading branch information
mehmet committed Jul 31, 2017
1 parent a19eec6 commit b14d73c
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/rules/jsx-pascal-case.js
Expand Up @@ -11,7 +11,7 @@ const elementType = require('jsx-ast-utils/elementType');
// 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 COMPAT_TAG_REGEX = /^[a-z]|\-/;
const ALL_CAPS_TAG_REGEX = /^[A-Z0-9]+$/;

Expand Down
2 changes: 2 additions & 0 deletions tests/lib/rules/jsx-pascal-case.js
Expand Up @@ -51,6 +51,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 b14d73c

Please sign in to comment.