sonarjs/no-return-type-any
eslint-plugin-sonarjs
No autofix
eslint.config.js
export default [
{
rules: {
"sonarjs/no-return-type-any": "error",
},
},
];Primitive return types should be used
function foo() : any { // Noncompliant
return 1;
}function foo() {
return 1;
}
// or
function foo(): number {
return 1;
}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/no-return-type-any
eslint-plugin-sonarjs
export default [
{
rules: {
"sonarjs/no-return-type-any": "error",
},
},
];Oxlint does not have this rule.
Biome does not have this rule.
Increment (++) and decrement (--) operators should not be used in a method call or mixed with other operators in an expression