X-Ray vision for pesky any types.
Dangerous any types can come from surprising places in TypeScript. This VS Code extension makes all identifiers with an any type stand out.
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)",
}- If you want
anytypes 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.
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.