unicorn/no-console-spaces
eslint-plugin-unicorn
Safe autofix
eslint.config.js
import unicorn from "eslint-plugin-unicorn";
export default [
{
plugins: { unicorn },
rules: {
"unicorn/no-console-spaces": "error",
},
},
];Do not use leading/trailing space between console.log parameters.
console.log('abc ', 'def');console.log('abc', ' def');console.log("abc ", " def");console.log('abc', 'def');console.debug('abc', 'def');console.info('abc', 'def');Examples from the ESLint documentation.
unicorn/no-console-spaces
eslint-plugin-unicorn
import unicorn from "eslint-plugin-unicorn";
export default [
{
plugins: { unicorn },
rules: {
"unicorn/no-console-spaces": "error",
},
},
];unicorn/no-console-spaces
unicorn plugin · style
{
"rules": {
"unicorn/no-console-spaces": "error"
}
}nursery/noConsoleSpaces
nursery · since 2.6.4
{
"linter": {
"rules": {
"nursery": {
"noConsoleSpaces": "error"
}
}
}
}Prefer passing Date directly to the constructor when cloning.
Do not use document.cookie directly.
Disallow a magic number as the depth argument in Array#flat(…).
Disallow useless case in switch statements.
Prefer .flatMap(…) over .map(…).flat() and .filter(…).flatMap(…).
Prefer using the node: protocol when importing Node.js builtin modules.