nursery/noUnsafeTypeAssertion
nursery · since 2.5.9
{
"linter": {
"rules": {
"nursery": {
"noUnsafeTypeAssertion": "error"
}
}
}
}Disallow TypeScript type assertions other than const assertions.
interface SomeType {
value: string;
}
declare const value;
const asserted = value as SomeType;interface SomeType {
value: string;
}
declare const value;
const asserted = <SomeType>value;interface SomeType {
value: string;
}
declare const asserted;
(asserted as SomeType).value = "foo";const tuple = ["value", 1] as const;const annotated: string = "value";const checked = { value: "value" } satisfies { value: string };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/noUnsafeTypeAssertion
nursery · since 2.5.9
{
"linter": {
"rules": {
"nursery": {
"noUnsafeTypeAssertion": "error"
}
}
}
}Reports custom properties used with var() that have no visible declaration.
Reports CSS class names in JSX className or class attributes that are not defined in any imported CSS file.
Reports CSS class selectors that are never referenced in any JSX or HTML file.
Disallow Tailwind utilities that override the appearance of components.
Require a value for Astro's client:only directive.