diff --git a/lib/rules/no-mocha-arrows.js b/lib/rules/no-mocha-arrows.js index b45cf4e..89f5dd5 100644 --- a/lib/rules/no-mocha-arrows.js +++ b/lib/rules/no-mocha-arrows.js @@ -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} `; @@ -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 }; }` ); } diff --git a/test/rules/no-setup-in-describe.js b/test/rules/no-setup-in-describe.js index 08e3e59..52915de 100644 --- a/test/rules/no-setup-in-describe.js +++ b/test/rules/no-setup-in-describe.js @@ -190,7 +190,7 @@ ruleTester.run('no-setup-in-describe', rule, { line: 1, column: 28 }, { - messagee: memberExpressionError, + message: memberExpressionError, line: 1, column: 28 }, {