Skip to content

Commit

Permalink
jsx-no-duplicate-props: TypeError: name.toLowerCase is not a function #…
Browse files Browse the repository at this point in the history
  • Loading branch information
marcelmokos committed Jul 20, 2017
1 parent 11117a4 commit 10e4f0c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
4 changes: 4 additions & 0 deletions lib/rules/jsx-no-duplicate-props.js
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,10 @@ module.exports = {

var name = decl.name.name;

if (typeof name !== 'string') {
return;
}

if (ignoreCase) {
name = name.toLowerCase();
}
Expand Down
3 changes: 2 additions & 1 deletion tests/lib/rules/jsx-no-duplicate-props.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,8 @@ ruleTester.run('jsx-no-duplicate-props', rule, {
{code: '<App c="a" {...this.props} a="c" b="b" />;'},
{code: '<App A a />;'},
{code: '<App A b a />;'},
{code: '<App A="a" b="b" B="B" />;'}
{code: '<App A="a" b="b" B="B" />;'},
{code: '<App a:b="c" />;', options: ignoreCaseArgs}
],
invalid: [
{code: '<App a a />;', errors: [expectedError]},
Expand Down

0 comments on commit 10e4f0c

Please sign in to comment.