unicorn/no-useless-concat
eslint-plugin-unicorn
Safe autofix
eslint.config.js
import unicorn from "eslint-plugin-unicorn";
export default [
{
plugins: { unicorn },
rules: {
"unicorn/no-useless-concat": "error",
},
},
];const message = 'Hello, ' + 'world!';const path = directory + '/' + 'file.js';const greeting = `Hello, ${name}` + `! Welcome.`;const message = 'Hello, world!';const path = directory + '/file.js';const greeting = `Hello, ${name}! Welcome.`;Examples from the ESLint documentation.
unicorn/no-useless-concat
eslint-plugin-unicorn
import unicorn from "eslint-plugin-unicorn";
export default [
{
plugins: { unicorn },
rules: {
"unicorn/no-useless-concat": "error",
},
},
];Oxlint does not have this rule.
complexity/noUselessStringConcat
complexity · since 1.8.0
{
"linter": {
"rules": {
"complexity": {
"noUselessStringConcat": "error"
}
}
}
}Disallow unnecessary concatenation of literals or template literals
Disallow unnecessary concatenation of literals or template literals in <template>
Disallow interpolation into SQL strings passed to Node’s node:sqlite APIs.
Enforce consistent decorator position on exported classes.
Disallow arithmetic and bitwise operations that always evaluate to 0.
Enforce consistent optional chaining for same-base member access.