10 - space-after-keywords
12 - space-return-throw-case
17 Multiple spaces in a row that are not used for indentation are typically mistakes. For example:
25 It's hard to tell, but there are two spaces between `foo` and `===`. Multiple spaces such as this are generally frowned upon in favor of single spaces:
35 This rule aims to disallow multiple whitespace around logical expressions, conditional expressions, declarations, array elements, object properties, sequences and function parameters.
37 Examples of **incorrect** code for this rule:
42 /*eslint no-multi-spaces: "error"*/
57 Examples of **correct** code for this rule:
62 /*eslint no-multi-spaces: "error"*/
79 This rule's configuration consists of an object with the following properties:
81 * `"ignoreEOLComments": true` (defaults to `false`) ignores multiple spaces before comments that occur at the end of lines
82 * `"exceptions": { "Property": true }` (`"Property"` is the only node specified by default) specifies nodes to ignore
86 Examples of **incorrect** code for this rule with the `{ "ignoreEOLComments": false }` (default) option:
91 /*eslint no-multi-spaces: ["error", { ignoreEOLComments: false }]*/
94 var x = 5; /* multiline
101 Examples of **correct** code for this rule with the `{ "ignoreEOLComments": false }` (default) option:
106 /*eslint no-multi-spaces: ["error", { ignoreEOLComments: false }]*/
108 var x = 5; // comment
109 var x = 5; /* multiline
116 Examples of **correct** code for this rule with the `{ "ignoreEOLComments": true }` option:
121 /*eslint no-multi-spaces: ["error", { ignoreEOLComments: true }]*/
123 var x = 5; // comment
124 var x = 5; // comment
125 var x = 5; /* multiline
128 var x = 5; /* multiline
137 To avoid contradictions with other rules that require multiple spaces, this rule has an `exceptions` option to ignore certain nodes.
139 This option is an object that expects property names to be AST node types as defined by [ESTree](https://github.com/estree/estree). The easiest way to determine the node types for `exceptions` is to use [AST Explorer](https://astexplorer.net/) with the espree parser.
141 Only the `Property` node type is ignored by default, because for the [key-spacing](key-spacing) rule some alignment options require multiple spaces in properties of object literals.
143 Examples of **correct** code for the default `"exceptions": { "Property": true }` option:
148 /*eslint no-multi-spaces: "error"*/
149 /*eslint key-spacing: ["error", { align: "value" }]*/
159 Examples of **incorrect** code for the `"exceptions": { "Property": false }` option:
164 /*eslint no-multi-spaces: ["error", { exceptions: { "Property": false } }]*/
165 /*eslint key-spacing: ["error", { align: "value" }]*/
175 Examples of **correct** code for the `"exceptions": { "BinaryExpression": true }` option:
180 /*eslint no-multi-spaces: ["error", { exceptions: { "BinaryExpression": true } }]*/
187 Examples of **correct** code for the `"exceptions": { "VariableDeclarator": true }` option:
192 /*eslint no-multi-spaces: ["error", { exceptions: { "VariableDeclarator": true } }]*/
195 var someOtherVar = 'barBaz';
200 Examples of **correct** code for the `"exceptions": { "ImportDeclaration": true }` option:
205 /*eslint no-multi-spaces: ["error", { exceptions: { "ImportDeclaration": true } }]*/
207 import mod from 'mod';
208 import someOtherMod from 'some-other-mod';
213 ## When Not To Use It
215 If you don't want to check and disallow multiple spaces, then you should turn this rule off.