Skip to content

Commit

Permalink
Merge pull request #1372 from jseminck/no-typos-fix
Browse files Browse the repository at this point in the history
Fix crash for no-typos rule
  • Loading branch information
ljharb authored Aug 15, 2017
2 parents 7b305bd + fc1f873 commit 60aed2e
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
4 changes: 4 additions & 0 deletions lib/rules/no-typos.js
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,10 @@ module.exports = {
},

MemberExpression: function(node) {
if (node.parent.type !== 'AssignmentExpression') {
return;
}

const relatedComponent = utils.getRelatedComponent(node);

if (
Expand Down
9 changes: 9 additions & 0 deletions tests/lib/rules/no-typos.js
Original file line number Diff line number Diff line change
Expand Up @@ -240,6 +240,15 @@ ruleTester.run('no-typos', rule, {
'}'
].join('\n'),
parserOptions: parserOptions
}, {
// https://github.com/yannickcr/eslint-plugin-react/issues/1353
code: `
function test(b) {
return a.bind(b);
}
function a() {}
`,
parserOptions: parserOptions
}],

invalid: [{
Expand Down

0 comments on commit 60aed2e

Please sign in to comment.