diff --git a/docs/rules/no-extra-spacing-text.md b/docs/rules/no-extra-spacing-text.md index 8bdec5e..9121e9d 100644 --- a/docs/rules/no-extra-spacing-text.md +++ b/docs/rules/no-extra-spacing-text.md @@ -17,7 +17,7 @@ module.exports = { [Whitespace in HTML is largely ignored](https://developer.mozilla.org/en-US/docs/Web/API/Document_Object_Model/Whitespace), so the purpose of this rule is to prevent unnecessary whitespace in text, such as: - Tab characters -- Sequences of more than 1 whitepsace character +- Sequences of more than 1 whitespace character When used with `--fix`, the rule will replace invalid whitespace with a single space. diff --git a/packages/eslint-plugin/lib/rules/no-extra-spacing-text.js b/packages/eslint-plugin/lib/rules/no-extra-spacing-text.js index 6698b7e..7dc384d 100644 --- a/packages/eslint-plugin/lib/rules/no-extra-spacing-text.js +++ b/packages/eslint-plugin/lib/rules/no-extra-spacing-text.js @@ -41,7 +41,8 @@ module.exports = { }, ], messages: { - [MESSAGE_IDS.UNEXPECTED]: "Tabs and/or multiple consecutive spaces not allowed here", + [MESSAGE_IDS.UNEXPECTED]: + "Tabs and/or multiple consecutive spaces not allowed here", }, }, diff --git a/packages/eslint-plugin/tests/rules/no-extra-spacing-text.test.js b/packages/eslint-plugin/tests/rules/no-extra-spacing-text.test.js index 10b4155..5e9daec 100644 --- a/packages/eslint-plugin/tests/rules/no-extra-spacing-text.test.js +++ b/packages/eslint-plugin/tests/rules/no-extra-spacing-text.test.js @@ -1,9 +1,8 @@ const createRuleTester = require("../rule-tester"); const rule = require("../../lib/rules/no-extra-spacing-text"); - function errorsAt(...positions) { - return positions.map(input => { + return positions.map((input) => { const [line, column, length] = input; if (input.length === 3) { return { @@ -108,11 +107,7 @@ ruleTester.run("no-extra-spacing-text", rule, { { code: `
\n\tfoo \n
\n
\n\tbar\t\n
`, output: `
\n\tfoo\n
\n
\n\tbar\n
`, - errors: errorsAt( - [2, 5, 3, 1], - [3, 7, 4, 1], - [5, 5, 6, 1], - ), + errors: errorsAt([2, 5, 3, 1], [3, 7, 4, 1], [5, 5, 6, 1]), }, { @@ -136,10 +131,7 @@ ruleTester.run("no-extra-spacing-text", rule, { foo bar `, - errors: errorsAt( - [3, 6, 5], - [3, 14, 4, 1], - ), + errors: errorsAt([3, 6, 5], [3, 14, 4, 1]), }, {