Skip to content
| Marketplace
Sign in
Visual Studio Code>Other>any-xrayNew to Visual Studio Code? Get it now.
any-xray

any-xray

Dan Vanderkam

|
364 installs
| (1) | Free
X-Ray vision for TypeScript 'any' types
Installation
Launch VS Code Quick Open (Ctrl+P), paste the following command, and press enter.
Copied to clipboard
More Info

any-xray

X-Ray vision for pesky any types.

Features

Dangerous any types can come from surprising places in TypeScript. This VS Code extension makes all identifiers with an any type stand out.

Screenshot of any-xray in action, showing symbols with any types in red

Extension Settings

anyXray.anyStyle

Change the way that symbols with any types are rendered. You can pass in anything assignable to DecorationRenderOptions. The default is:

{
  "backgroundColor": "rgba(255,0,0,0.1)",
  "borderRadius": "3px",
  "border": "solid 1px rgba(255,0,0)",
  "color": "red"
}

Related work

  • If you want any types to be compiler warnings, check out type-coverage.
  • You may also be interested in typescript-eslint's no-unsafe-assignment rule, which is part of the recommended-type-checked configuration.

How this works

This extension piggybacks on the "quickinfo" (hovertext) provided by the TypeScript Language Service in VS Code. It parses your TypeScript file and asks VS Code for quickinfo on all the identifiers in the visible range of active editors. If these end with something like ": any", then it colors them red.

There are a few situations in which this will highlight identifiers that are safe, see #1.

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2025 Microsoft