sonarjs/no-useless-intersection
eslint-plugin-sonarjs
No autofixRecommended
eslint.config.js
export default [
{
rules: {
"sonarjs/no-useless-intersection": "error",
},
},
];Type intersections should use meaningful types
function foo(p: MyType & null) { // Noncompliant
// ...
}
function bar(p: MyType & any) { // Noncompliant
// ...
}function foo(p: MyType | null) {
// ...
}
// or
function foo(p: MyType & AnotherType) {
// ...
}
function bar(p: any) {
// ...
}Examples from the ESLint documentation.
sonarjs/no-useless-intersection
eslint-plugin-sonarjs
export default [
{
rules: {
"sonarjs/no-useless-intersection": "error",
},
},
];Oxlint does not have this rule.
Biome does not have this rule.
React state setter function should not be called with its matching state variable
Vue components should not use the deprecated "vue-class-component" or "vue-property-decorator" libraries
The return value of void functions should not be used