no-console-spaces
March 27, 2026 ยท View on GitHub
๐ Do not use leading/trailing space between console.log parameters.
๐ผ This rule is enabled in the following configs: โ
recommended, โ๏ธ unopinionated.
๐ง This rule is automatically fixable by the --fix CLI option.
The console.log() method and similar methods joins the parameters with a space, so adding a leading/trailing space to a parameter, results in two spaces being added.
Examples
// โ
console.log('abc ', 'def');
// โ
console.log('abc', ' def');
// โ
console.log("abc ", " def");
// โ
console.log(`abc `, ` def`);
// โ
console.log('abc', 'def');
// โ
console.debug('abc ', 'def');
// โ
console.debug('abc', 'def');
// โ
console.info('abc ', 'def');
// โ
console.info('abc', 'def');
// โ
console.warn('abc ', 'def');
// โ
console.warn('abc', 'def');
// โ
console.error('abc ', 'def');
// โ
console.error('abc', 'def');
// โ
console.log('abc ');
// โ
console.log(' abc');
// โ
console.log('abc ', 'def');
// โ
console.log('abc\t', 'def');
// โ
console.log('abc\n', 'def');