# noUnsafeTypeAssertion

Rule `biome/noUnsafeTypeAssertion`. Disallow TypeScript type assertions other than const assertions.

- Source: biome
- Technologies: TypeScript
- Kind: style
- Needs type information: no
- Autofix: no
- Reach: 0 weekly downloads of presets that enable it
- Trend: 0% last quarter
- Rank: #1948 by reach

## Linters

| Linter | Rule name | Recommended | Autofix | Details | Docs |
| --- | --- | --- | --- | --- | --- |
| Biome | `nursery/noUnsafeTypeAssertion` | no | no | group nursery, since 2.5.9 | [docs](https://biomejs.dev/linter/rules/no-unsafe-type-assertion/) |

## Code examples

### Incorrect: the rule reports this

```ts
interface SomeType {
    value: string;
}
declare const value;
const asserted = value as SomeType;
```

```ts
interface SomeType {
    value: string;
}
declare const value;
const asserted = <SomeType>value;
```

```ts
interface SomeType {
    value: string;
}
declare const asserted;
(asserted as SomeType).value = "foo";
```

### Correct: the rule accepts this

```ts
const tuple = ["value", 1] as const;
```

```ts
const annotated: string = "value";
```

```ts
const checked = { value: "value" } satisfies { value: string };
```

Examples from the Biome documentation.

## Enable it

### Biome: `biome.json`

```json
{
  "linter": {
    "rules": {
      "nursery": {
        "noUnsafeTypeAssertion": "error"
      }
    }
  }
}
```

## Related rules

- [biome/noUndeclaredCustomProperties](https://lintradar.dev/rules/biome/noUndeclaredCustomProperties.md): Reports custom properties used with `var()` that have no visible declaration.
- [biome/noUntrustedLicenses](https://lintradar.dev/rules/biome/noUntrustedLicenses.md): Disallow dependencies with untrusted licenses.
- [biome/noUndeclaredClasses](https://lintradar.dev/rules/biome/noUndeclaredClasses.md): Reports CSS class names in JSX `className` or `class` attributes that are not defined in any imported CSS file.
- [biome/noUnusedClasses](https://lintradar.dev/rules/biome/noUnusedClasses.md): Reports CSS class selectors that are never referenced in any JSX or HTML file.
- [biome/noTailwindRestyledComponents](https://lintradar.dev/rules/biome/noTailwindRestyledComponents.md): Disallow Tailwind utilities that override the appearance of components.
- [biome/useAstroClientOnlyDirectiveValue](https://lintradar.dev/rules/biome/useAstroClientOnlyDirectiveValue.md): Require a value for Astro's `client:only` directive.

---

Web page: https://lintradar.dev/rules/biome/noUnsafeTypeAssertion. Data from npm and the linters' documentation, collected Dec 4, 2026. Site guide for agents: https://lintradar.dev/llms.txt
