Skip to content

Commit

Permalink
Merge pull request #1319 from marcelmokos/#969-jsx-no-duplicate-props…
Browse files Browse the repository at this point in the history
…-type-error

issue #969 typeError: name.toLowerCase is not a function…
  • Loading branch information
ljharb committed Jul 25, 2017
2 parents 2d2cf65 + 10e4f0c commit 8139569
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 @@ -45,6 +45,10 @@ module.exports = {

let 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 8139569

Please sign in to comment.