no-console-spaces
UnreleasedConfiguration
Rule Details
Disallow redundant spaces between arguments to console.log, console.debug, console.info, console.warn, and console.error.
These methods already separate arguments with a space. This rule removes a single leading space from a string or template literal after the first argument, and a single trailing space before the last argument.
Examples of incorrect code for this rule:
Examples of correct code for this rule:
The rule preserves consecutive spaces, strings containing only one space, and spaces at the outer edges of the first and last arguments. It checks literal source text, so escaped spaces such as \u0020 are preserved. Computed methods and optional calls are ignored.
Options
This rule has no options. It provides an automatic fix.
Differences from upstream
When a reported trailing space is written as \ , rslint removes both the
backslash and the space. For example:
This also applies to template literals. Unlike eslint-plugin-unicorn v76.0.0,
the fix leaves valid JavaScript instead of leaving a backslash that escapes
the closing quote or backtick. Escaped backslashes (\\) are preserved.