Complete list of Typescript error codes and their fixes

前端 未结 1 805
慢半拍i
慢半拍i 2021-02-13 23:47

In Typescript, where do I find a complete reference of all error codes and their fixes.

My usecase is that I often see errors when compiling. for example:

         


        
1条回答
  •  温柔的废话
    2021-02-14 00:20

    Looking at the 1.6.2 sources of the compiler, tsc.js, tsserver.js, typescript.js and typescriptServices.js, a variable called ts.Diagnostics is initialized with a dictionary of all the error codes.

    List of codes and definitions of 1.6.2 (unfortunately ugly formatted): https://github.com/Microsoft/TypeScript/blob/v1.6.2/src/compiler/diagnosticInformationMap.generated.ts

    A slightly prettier format is available: https://github.com/Microsoft/TypeScript/blob/v1.6.2/src/compiler/diagnosticMessages.json

    EDIT

    Link to 1.8.5 errors: https://github.com/Microsoft/TypeScript/blob/v1.8.5/src/compiler/diagnosticMessages.json

    0 讨论(0)
提交回复
热议问题