| Start |
|---|
| Create TypeScript project with tsconfig.json The presence of a tsconfig.json file indicates that the current directory is the root of a TypeScript enabled project. Initializing a TypeScript project, or better put tsconfig.json file, can be done through the following command: As of TypeScript v2.3.0 and higher this will create the following tsconfig.json by default: Most, if not all, options are generated automatically with only the bare necessities left uncommented. Older versions of TypeScript, like for example v2.0.x and lower, would generate a tsconfig.json like this: |
| Configuration for fewer programming errors There are very good configurations to force typings and get more helpful errors which are not activated by default. Not enough? If you are a hard coder and want more, then you may be interested to check your TypeScript files with tslint before compiling it with tsc. Check how to configure tslint for even stricter code (opens new window). |
| compileOnSave Setting a top-level property This feature is available since TypeScript 1.8.4 and onward, but needs to be directly supported by IDE's. Currently, examples of supported IDE's are: |
| Comments A tsconfig.json file can contain both line and block comments, using the same rules as ECMAScript. |
| preserveConstEnums Typescript supports costant enumerables, declared through This is usually just syntax sugar as the costant enums are inlined in compiled JavaScript. For instance the following code compiles to Although the perfomance benefit from inlining, you may prefer to keep enums even if costant (ie: you may wish readability on development code), to do this you have to set in tsconfig.json the By this way the previous example would be compiled as any other enums, as shown in following snippet. Syntax
RemarksOverviewThe presence of a tsconfig.json file in a directory indicates that the directory is the root of a TypeScript project. The tsconfig.json file specifies the root files and the compiler options required to compile the project. Using tsconfig.json
DetailsThe If no If the The Any files that are referenced by those specified in the A Compiler options specified on the command line override those specified in the tsconfig.json file. SchemaSchema can be found at: http://json.schemastore.org/tsconfig (opens new window) |
Read Article
https://develop.horje.com/learn/1434/reference