nursery/noMisleadingReturnType
nursery · since 2.4.11
No autofix
biome.json
{
"linter": {
"rules": {
"nursery": {
"noMisleadingReturnType": "error"
}
}
}
}Detect return type annotations that are misleadingly wider than what the implementation actually returns.
function getStatus(b: boolean): string { if (b) return "loading"; return "idle"; }function getCode(ok: boolean): number { if (ok) return 200; return 404; }class Foo { getStatus(b: boolean): string { if (b) return "loading"; return "idle"; } }function getStatus() { return "loading"; }function run(): void { return; }class Foo { greet(): string { return "hello"; } }Examples from the Biome 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.
ESLint does not have this rule.
Oxlint does not have this rule.
nursery/noMisleadingReturnType
nursery · since 2.4.11
{
"linter": {
"rules": {
"nursery": {
"noMisleadingReturnType": "error"
}
}
}
}Flags text nodes with a trailing $ before a JSX expression.
Disallow Sass variables and function calls in custom property values without #{} interpolation.
Disallows defining React components inside other components.