Skip to content

Repository files navigation

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",
  "outline": "1px solid rgba(255,0,0,0.4)",
}

Related work

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.

If this extension highlights an any type incorrectly, please file an issue.

About

X-Ray Glasses for TypeScript any Types

Resources

Stars

34 stars

Watchers

3 watching

Forks

Releases

Packages

Used by

Contributors

Languages