TypeScript error code
The number TypeScript attaches to each kind of compiler error, such as TS2345 for an argument whose type does not fit.
In more detail
The code is the same in the terminal and the editor, which makes errors easy to search for. TS2345 reads: argument of type X is not assignable to parameter of type Y.
Related terms
- assignable — The rule that decides whether a value of one type may be used where another type is expected.
- tsc — The command-line TypeScript compiler, which type-checks a project and writes JavaScript and declaration files.
Taught in
- Literal Types: String, Number, Boolean Literals And const — Production TypeScript
- never: The Bottom Type And Exhaustive Switch Checking — Production TypeScript
- Type Aliases Versus Interfaces: Declaration Merging — Production TypeScript
- Discriminated Unions: Tagged Variants And Pattern Matching — Production TypeScript
- Tuples: Fixed Length, Labeled Elements And Variadic Tuples — Production TypeScript
- Assertion Signatures: asserts condition And Invariants — Production TypeScript
- ECMAScript Modules, CJS Interop And verbatimModuleSyntax — Production TypeScript