Skip to content

Commit

Permalink
Allow numbers in jsx-pascal-case (fixes #339)
Browse files Browse the repository at this point in the history
  • Loading branch information
yannickcr committed Nov 30, 2015
1 parent 2204feb commit a65f038
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 1 deletion.
2 changes: 1 addition & 1 deletion lib/rules/jsx-pascal-case.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ var variableUtil = require('../util/variable');
// Constants
// ------------------------------------------------------------------------------

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

// ------------------------------------------------------------------------------
// Rule Definition
Expand Down
24 changes: 24 additions & 0 deletions tests/lib/rules/jsx-pascal-case.js
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,30 @@ ruleTester.run('jsx-pascal-case', rule, {
ecmaFeatures: {
jsx: true
}
}, {
code: [
'var Test1Component;',
'<Test1Component />'
].join('\n'),
ecmaFeatures: {
jsx: true
}
}, {
code: [
'var TestComponent1;',
'<TestComponent1 />'
].join('\n'),
ecmaFeatures: {
jsx: true
}
}, {
code: [
'var T3stComp0nent;',
'<T3stComp0nent />'
].join('\n'),
ecmaFeatures: {
jsx: true
}
}],

invalid: [{
Expand Down

0 comments on commit a65f038

Please sign in to comment.