Code Inspections in TypeScript
Equality operator may cause type coercion
Depending on the option selected, this will either highlight:
Checks TypeScript called function parameters, return values, assigned expressions to be of correct type.
Type mismatch in 'any' type context
Checks TypeScript called function parameters, return values, assigned expressions to be of correct type in 'any' type context.
Checks TypeScript referenced variables and fields to be valid ones.
Validate TypeScript imports
Checks TypeScript called functions to be valid ones.
@private and @protected members accessibility
This inspection checks that TypeScript private and protected members are visible in current context.
Import can be shortened
Reports any instances of ES6 importswhose 'from' part can be shortened by importing the parent directory.
Reference to a UMD global
Report the use of references to a UMD global if the current file is a module.
Field is assigned only in the constructor and can be made readonly
If a private field is assigned only in the constructor, it can be made readonly.
Missing augmentation import
Check that current file imports the augmentation module
Explicit member types
This inspection highlights type declarations that do not match the current code style.
By default, type declarations are highlighted as redundant when the type can be inferred from context, for example:
Enabling any of the options below inverts this and suggests inserting an explicit type declaration even where the type can be inferred.
Validate usages of tsconfig.json properties
Suspicious parameter assignment in constructor
Warns against a common mistake in TypeScript code, when a class field is declared as a constructor parameter, and then this parameter is assigned.
Abstract class constructor can be made protected
Suggests to make the constructor of an abstract class protected (because it is useless to have it public)
Runs TSLint - a linter for TypeScript.