Skip to content

Commit

Permalink
Fix crash for no-typos rule
Browse files Browse the repository at this point in the history
  • Loading branch information
jseminck committed Aug 15, 2017
1 parent 7b305bd commit fc1f873
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
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
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 fc1f873

Please sign in to comment.