sonarjs/useless-string-operation
eslint-plugin-sonarjs
export default [
{
rules: {
"sonarjs/useless-string-operation": "error",
},
},
];This rule is deprecated. Check its documentation for a replacement before enabling it.
Results of operations on strings should not be ignored
var str = "..."
str.toUpperCase(); // Noncompliantvar str = "..."
str = str.toUpperCase();Examples from the ESLint documentation.
No tracked preset enables this rule, so it has no reach yet.
None of the tracked presets enable this rule. Turn it on with the config below.
sonarjs/useless-string-operation
eslint-plugin-sonarjs
export default [
{
rules: {
"sonarjs/useless-string-operation": "error",
},
},
];Oxlint does not have this rule.
Biome does not have this rule.
Regular expressions using Unicode character classes or property escapes should enable the unicode flag
Values not convertible to numbers should not be used in numeric comparisons
Loops should not contain more than a single "break" or "continue" statement
Variable, property and parameter names should comply with a naming convention
Shorthand object properties should be grouped at the beginning or end of an object declaration