From f1041d235721c1365cb403fd74248675039ea15b Mon Sep 17 00:00:00 2001 From: mehmet Date: Mon, 31 Jul 2017 15:04:35 +0300 Subject: [PATCH] case #1334 - false negative with namespacing/qualifications using jsx-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] --- lib/rules/jsx-pascal-case.js | 2 +- tests/lib/rules/jsx-pascal-case.js | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/rules/jsx-pascal-case.js b/lib/rules/jsx-pascal-case.js index fb8ea45427..43472c4067 100644 --- a/lib/rules/jsx-pascal-case.js +++ b/lib/rules/jsx-pascal-case.js @@ -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]+)?$/; // ------------------------------------------------------------------------------ diff --git a/tests/lib/rules/jsx-pascal-case.js b/tests/lib/rules/jsx-pascal-case.js index f15c9b633d..f219942d31 100644 --- a/tests/lib/rules/jsx-pascal-case.js +++ b/tests/lib/rules/jsx-pascal-case.js @@ -59,6 +59,8 @@ ruleTester.run('jsx-pascal-case', rule, { options: [{allowAllCaps: true}] }, { code: '' + }, { + code: '' }, { code: '' }, {