https://github.com/artberri/vscode-unsafe-typescript
Visual Studio Code extension to visually mark out unsafe Typescript features.
https://github.com/artberri/vscode-unsafe-typescript
linter typescript unsafe vscode vscode-extension
Last synced: 3 months ago
JSON representation
Visual Studio Code extension to visually mark out unsafe Typescript features.
- Host: GitHub
- URL: https://github.com/artberri/vscode-unsafe-typescript
- Owner: artberri
- License: mit
- Created: 2023-12-08T23:54:55.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2023-12-13T08:43:17.000Z (over 1 year ago)
- Last Synced: 2025-01-28T02:21:55.006Z (4 months ago)
- Topics: linter, typescript, unsafe, vscode, vscode-extension
- Language: TypeScript
- Homepage: https://marketplace.visualstudio.com/items?itemName=alberto-varela.unsafe-typescript
- Size: 278 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# Unsafe Typescript Highlighter for VS Code
Visually mark out unsafe Typescript features in your code.
**Supports**: Typescript, JSX (`.tsx`), and Vue or Svelte single component files.
## Features
It highlights: non-null assertions, type assertions (both, angle bracketed and those using the `as` keyword), and type predicates.

### Motivation
The purpose of this extension differs from traditional linting tools such as Eslint or Biome. While linting allows you to prohibit or warn against certain code practices, these messages can sometimes go unnoticed. The primary goal of the Unsafe TypeScript Highlighter is to ensure that you can consistently and effortlessly identify these problems through visual cues, so that they never escape your attention.
I got the idea from [this tweet by Matt Pocock](https://twitter.com/mattpocockuk/status/1732485506556940782), thank you for that and for spreading the word about Typescript.
## Extension Settings
This extension contributes the following settings:
- `unsafeTypescript.enable`: Controls whether the Unsafe Typescript Highlighter extension is enabled or disabled. It is enabled by default.
- `unsafeTypescript.run`: Specifies when the linter should run. Options are `onChange` (run the linter on every document change) or `onSave` (run the linter on document save). The default is `onChange`.
- `unsafeTypescript.decorate`: Determines the type of decoration for unsafe code. Options include `keyword` (decorate only the unsafe keyword inside the expression) or `expression` (decorate the whole unsafe expression). The default is `keyword`.
- `unsafeTypescript.highlight.nonNullAssertion.enable`: Enables or disables the highlighting of non-null assertions (`!`). It is enabled by default.
- `unsafeTypescript.highlight.asTypeAssertion.enable`: Enables or disables the highlighting of `as` type assertions. It is enabled by default.
- `unsafeTypescript.highlight.angleBracketedTypeAssertion.enable`: Enables or disables the highlighting of angle bracketed assertions. It is enabled by default.
- `unsafeTypescript.highlight.typePredicate.enable`: Enables or disables the highlighting of type predicates. It is enabled by default.## Release Notes
### 1.0.0
Initial release of Unsafe Typescript Highlighter.
## License
This extension is licensed under the [MIT License](LICENSE).