Skip to content

Commit a65f038

Browse files
committed
Allow numbers in jsx-pascal-case (fixes #339)
1 parent 2204feb commit a65f038

File tree

2 files changed

+25
-1
lines changed

2 files changed

+25
-1
lines changed

lib/rules/jsx-pascal-case.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ var variableUtil = require('../util/variable');
1111
// Constants
1212
// ------------------------------------------------------------------------------
1313

14-
var PASCAL_CASE_REGEX = /^[A-Z]+[a-z]+(?:[A-Z]+[a-z]*)*$/;
14+
var PASCAL_CASE_REGEX = /^[A-Z0-9]+[a-z0-9]+(?:[A-Z0-9]+[a-z0-9]*)*$/;
1515

1616
// ------------------------------------------------------------------------------
1717
// Rule Definition

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

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,30 @@ ruleTester.run('jsx-pascal-case', rule, {
5151
ecmaFeatures: {
5252
jsx: true
5353
}
54+
}, {
55+
code: [
56+
'var Test1Component;',
57+
'<Test1Component />'
58+
].join('\n'),
59+
ecmaFeatures: {
60+
jsx: true
61+
}
62+
}, {
63+
code: [
64+
'var TestComponent1;',
65+
'<TestComponent1 />'
66+
].join('\n'),
67+
ecmaFeatures: {
68+
jsx: true
69+
}
70+
}, {
71+
code: [
72+
'var T3stComp0nent;',
73+
'<T3stComp0nent />'
74+
].join('\n'),
75+
ecmaFeatures: {
76+
jsx: true
77+
}
5478
}],
5579

5680
invalid: [{

0 commit comments

Comments
 (0)