Skip to content

Commit

Permalink
Fix smoke test failure (#1134)
Browse files Browse the repository at this point in the history
  • Loading branch information
fisker committed Feb 28, 2021
1 parent 2397d94 commit 4846167
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion rules/prefer-default-parameters.js
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,16 @@ const create = context => {
return;
}

const {references} = findVariable(context.getScope(), secondId);
const variable = findVariable(context.getScope(), secondId);

// This was reported https://github.com/sindresorhus/eslint-plugin-unicorn/issues/1122
// But can't reproduce, just ignore this case
/* istanbul ignore next */
if (!variable) {
return;
}

const {references} = variable;
const {params} = currentFunction;
const parameter = params.find(parameter =>
parameter.type === 'Identifier' &&
Expand Down

0 comments on commit 4846167

Please sign in to comment.