1 | # tsconfig
|
2 |
|
3 | [![NPM Version](https://badge.fury.io/js/%40chatie%2Ftsconfig.svg)](https://www.npmjs.com/package/@chatie/tsconfig)
|
4 | [![npm (tag)](https://img.shields.io/npm/v/%40chatie/tsconfig/next.svg)](https://www.npmjs.com/package/@chatie/tsconfig?activeTab=versions)
|
5 | [![Build Status](https://travis-ci.com/Chatie/tsconfig.svg?branch=master)](https://travis-ci.com/Chatie/tsconfig)
|
6 |
|
7 |
|
8 | ![tsconfig.json](https://chatie.github.io/tsconfig/images/typescript-tsconfig-json.jpg)
|
9 |
|
10 | > Picture: [What is tsconfig.json](https://www.kunal-chowdhury.com/2018/05/typescript-tutorial-tsconfig-json.html)
|
11 |
|
12 | Reusable TypeScript configuration files to extend from.
|
13 |
|
14 | This module enables other module to inheritance tsconfig.json via Node.js packages
|
15 |
|
16 | ## USAGE
|
17 |
|
18 | Extends from `@chatie/tsconfig` from your tsconfig.json, to have the chatie version of the TypeScript Configuration.
|
19 |
|
20 | It aim the following goals:
|
21 |
|
22 | 1. Support the latest `esnext` ECMAScript
|
23 | 1. Targeting for `ES6`
|
24 | 1. Strict for everything
|
25 | 1. Aiming for Convenience, including the `esModuleInterop` and `resolveJsonModule` etc.
|
26 |
|
27 | ### CAUTION
|
28 |
|
29 | Do not put any directory related configurations into this module.
|
30 | Only put directory related configurations to the consumer of this module.
|
31 |
|
32 | Because all directory in tsconfig.json is related to the curfrent directory.
|
33 |
|
34 | ## SEE ALSO
|
35 |
|
36 | - [TypeScript 3.2 - tsconfig.json inheritance via Node.js packages](https://github.com/Microsoft/TypeScript/wiki/What's-new-in-TypeScript#tsconfigjson-inheritance-via-nodejs-packages)
|
37 |
|
38 | > TypeScript 3.2 now resolves tsconfig.jsons from node_modules. When using a bare path for the "extends" field in tsconfig.json, TypeScript will dive into node_modules packages for us.
|
39 | >
|
40 | > ```json
|
41 | > {
|
42 | > "extends": "@my-team/tsconfig-base",
|
43 | > "include": ["./**/*"]
|
44 | > "compilerOptions": {
|
45 | > // Override certain options on a project-by-project basis.
|
46 | > "strictBindCallApply": false,
|
47 | > }
|
48 | > }
|
49 | > ```
|
50 | >
|
51 | > Here, TypeScript will climb up node_modules folders looking for a @my-team/tsconfig-base package. For each of those packages, TypeScript will first check whether package.json contains a "tsconfig" field, and if it does, TypeScript will try to load a configuration file from that field. If neither exists, TypeScript will try to read from a tsconfig.json at the root. This is similar to the lookup process for .js files in packages that Node uses, and the .d.ts lookup process that TypeScript already uses.
|
52 | >
|
53 | > This feature can be extremely useful for bigger organizations, or projects with lots of distributed dependencies.
|
54 | >
|
55 |
|
56 | ## DEPENDENCES
|
57 |
|
58 | This module will run a unit test before it could be able to publish to NPM.
|
59 |
|
60 | The unit test load tsconfig schema from [JSON Schema Store](http://schemastore.org/) and then use [is-my-json-valid](https://www.npmjs.com/package/is-my-json-valid) to validate it.
|
61 |
|
62 | ## HISTORY
|
63 |
|
64 | ### (master)
|
65 |
|
66 | ### v0.10 Apr 2020
|
67 |
|
68 | 1. Add `dom` to `lib` in tsconfig.json
|
69 |
|
70 | ### v0.6 June 08 2019
|
71 |
|
72 | 1. Auto generate `tsconfig.json` in project root directory after install if it not exists.
|
73 |
|
74 | ### v0.4 May 14 2019
|
75 |
|
76 | 1. Only publish `tsconfig.json` to NPM to prevent strange bugs
|
77 | 1. Create a tsconfig base setting module for sharing across projects
|
78 |
|
79 | ## AUTHOR
|
80 |
|
81 | [Huan LI (李卓桓)](http://linkedin.com/in/zixia) <zixia@zixia.net>
|
82 |
|
83 | [![Profile of Huan LI (李卓桓) on StackOverflow](https://stackexchange.com/users/flair/265499.png)](https://stackexchange.com/users/265499)
|
84 |
|
85 | ## COPYRIGHT & LICENSE
|
86 |
|
87 | - Code & Docs © 2019 - now Huan LI <zixia@zixia.net>
|
88 | - Code released under the Apache-2.0 License
|
89 | - Docs released under Creative Commons
|