Skip to content

Commit

Permalink
- ESLint7 required changes (move from node's start/end to range); mis…
Browse files Browse the repository at this point in the history
…spelling in test property
  • Loading branch information
brettz9 committed May 13, 2020
1 parent 9550ee8 commit 6031ddb
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
6 changes: 3 additions & 3 deletions lib/rules/no-mocha-arrows.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ module.exports = {
}

if (fn.params.length > 0) {
paramsFullText = `(${ sourceCode.text.slice(fn.params[0].start, last(fn.params).end) })`;
paramsFullText = `(${ sourceCode.text.slice(fn.params[0].range[0], last(fn.params).range[1]) })`;
}

return `${functionKeyword}${paramsFullText} `;
Expand All @@ -41,14 +41,14 @@ module.exports = {
// When it((...) => { ... }),
// simply replace '(...) => ' with 'function () '
return fixer.replaceTextRange(
[ fn.start, fn.body.start ],
[ fn.range[0], fn.body.range[0] ],
formatFunctionHead(fn)
);
}

const bodyText = sourceCode.text.slice(fn.body.range[0], fn.body.range[1]);
return fixer.replaceTextRange(
[ fn.start, fn.end ],
[ fn.range[0], fn.range[1] ],
`${formatFunctionHead(fn)}{ return ${ bodyText }; }`
);
}
Expand Down
2 changes: 1 addition & 1 deletion test/rules/no-setup-in-describe.js
Original file line number Diff line number Diff line change
Expand Up @@ -190,7 +190,7 @@ ruleTester.run('no-setup-in-describe', rule, {
line: 1,
column: 28
}, {
messagee: memberExpressionError,
message: memberExpressionError,
line: 1,
column: 28
}, {
Expand Down

0 comments on commit 6031ddb

Please sign in to comment.