This rule (no-multi-spaces
) has an option exceptions
that you can configure to ignore all variable declarations. Configuration should look something like this:
no-multi-spaces: ["error", { exceptions: { "VariableDeclarator": true } }]
This will skip all of the variable declarations from the check.
In general, you can also use comments to disable any of the ESLint rules. ESLint supports block style comments: /* eslint-disable */ /* eslint-enable */
to disable all rules or /* eslint-disable rule-name */ /* eslint-enable rule-name*/
to disable specific rule. Everything between disable and enable comments will be ignored. You can also use inline comments as well: // eslint-disable-line
to disable all rules for current line, or // eslint-disable-line rule-name
to disable specific rule. Same applies to // eslint-disable-next-line
but for the following line.
If all else fails, you can just disable the rule in the configuration. If you find yourself in the situation were you need to use comments constantly, most likely this rule just doesn't fit your coding style. Not every rule fits everyone, and there's no prize for enabling as many rules as possible.