- A type-system based only on inference with JavaScript code
- Incremental typing in JavaScript
- TypeScript code
- TypeScript with
strict
enabled
Each step represents a move towards a safer type-system, but not every project needs that level of verification.
This is when you use an editor which uses TypeScript to provide tooling like auto-complete, jump to symbol and refactoring tools like rename. The has a list of editors which have TypeScript plugins.
JSDoc annotations come before a declaration will be used to set the type of that declaration. For example:
You can find the full list of supported JSDoc patterns in JSDoc Supported Types.
If you have a lot of JavaScript files you want to add errors to then you can switch to using a . You can skip checking some files by adding a // @ts-nocheck
comment to files.
TypeScript may offer you errors which you disagree with, in those cases you can ignore errors on specific lines by adding or // @ts-expect-error
on the preceding line.