Skip to content

Commit 8139569

Browse files
authored
Merge pull request jsx-eslint#1319 from marcelmokos/jsx-eslint#969-jsx-no-duplicate-props-type-error
issue jsx-eslint#969 typeError: name.toLowerCase is not a function…
2 parents 2d2cf65 + 10e4f0c commit 8139569

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

lib/rules/jsx-no-duplicate-props.js

+4
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,10 @@ module.exports = {
4545

4646
let name = decl.name.name;
4747

48+
if (typeof name !== 'string') {
49+
return;
50+
}
51+
4852
if (ignoreCase) {
4953
name = name.toLowerCase();
5054
}

tests/lib/rules/jsx-no-duplicate-props.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,8 @@ ruleTester.run('jsx-no-duplicate-props', rule, {
4949
{code: '<App c="a" {...this.props} a="c" b="b" />;'},
5050
{code: '<App A a />;'},
5151
{code: '<App A b a />;'},
52-
{code: '<App A="a" b="b" B="B" />;'}
52+
{code: '<App A="a" b="b" B="B" />;'},
53+
{code: '<App a:b="c" />;', options: ignoreCaseArgs}
5354
],
5455
invalid: [
5556
{code: '<App a a />;', errors: [expectedError]},

0 commit comments

Comments
 (0)