@ionic/angular 7.6.2-dev.11702957417.1622fcc0 → 7.6.2-dev.11704390532.1202188d
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/common/directives/navigation/router-outlet.d.ts +4 -3
- package/directives/control-value-accessors/index.d.ts +0 -1
- package/directives/navigation/ion-router-outlet.d.ts +12 -4
- package/directives/proxies-list.d.ts +1 -1
- package/directives/proxies.d.ts +39 -7
- package/esm2020/common/directives/control-value-accessors/value-accessor.mjs +4 -4
- package/esm2020/common/directives/navigation/back-button.mjs +4 -4
- package/esm2020/common/directives/navigation/nav.mjs +4 -4
- package/esm2020/common/directives/navigation/router-link-delegate.mjs +7 -7
- package/esm2020/common/directives/navigation/router-outlet.mjs +19 -11
- package/esm2020/common/directives/navigation/stack-controller.mjs +1 -4
- package/esm2020/common/directives/navigation/tabs.mjs +4 -4
- package/esm2020/common/overlays/modal.mjs +4 -4
- package/esm2020/common/overlays/popover.mjs +4 -4
- package/esm2020/common/providers/angular-delegate.mjs +4 -4
- package/esm2020/common/providers/config.mjs +4 -4
- package/esm2020/common/providers/dom-controller.mjs +4 -4
- package/esm2020/common/providers/nav-controller.mjs +6 -6
- package/esm2020/common/providers/platform.mjs +4 -4
- package/esm2020/directives/control-value-accessors/boolean-value-accessor.mjs +4 -4
- package/esm2020/directives/control-value-accessors/index.mjs +1 -2
- package/esm2020/directives/control-value-accessors/numeric-value-accessor.mjs +4 -4
- package/esm2020/directives/control-value-accessors/select-value-accessor.mjs +4 -4
- package/esm2020/directives/control-value-accessors/text-value-accessor.mjs +4 -4
- package/esm2020/directives/navigation/ion-back-button.mjs +4 -4
- package/esm2020/directives/navigation/ion-nav.mjs +4 -4
- package/esm2020/directives/navigation/ion-router-outlet.mjs +14 -10
- package/esm2020/directives/navigation/ion-tabs.mjs +5 -5
- package/esm2020/directives/navigation/router-link-delegate.mjs +7 -7
- package/esm2020/directives/overlays/modal.mjs +4 -4
- package/esm2020/directives/overlays/popover.mjs +4 -4
- package/esm2020/directives/proxies-list.mjs +4 -1
- package/esm2020/directives/proxies.mjs +314 -237
- package/esm2020/directives/validators/max-validator.mjs +4 -4
- package/esm2020/directives/validators/min-validator.mjs +4 -4
- package/esm2020/index.mjs +1 -2
- package/esm2020/ionic-module.mjs +7 -10
- package/esm2020/providers/action-sheet-controller.mjs +4 -4
- package/esm2020/providers/alert-controller.mjs +4 -4
- package/esm2020/providers/animation-controller.mjs +4 -4
- package/esm2020/providers/gesture-controller.mjs +4 -4
- package/esm2020/providers/loading-controller.mjs +4 -4
- package/esm2020/providers/menu-controller.mjs +4 -4
- package/esm2020/providers/modal-controller.mjs +4 -4
- package/esm2020/providers/picker-controller.mjs +7 -4
- package/esm2020/providers/toast-controller.mjs +4 -4
- package/esm2020/standalone/directives/checkbox.mjs +4 -4
- package/esm2020/standalone/directives/datetime.mjs +4 -4
- package/esm2020/standalone/directives/icon.mjs +4 -4
- package/esm2020/standalone/directives/index.mjs +1 -2
- package/esm2020/standalone/directives/input.mjs +4 -4
- package/esm2020/standalone/directives/proxies.mjs +316 -201
- package/esm2020/standalone/directives/radio-group.mjs +4 -4
- package/esm2020/standalone/directives/range.mjs +4 -4
- package/esm2020/standalone/directives/searchbar.mjs +4 -4
- package/esm2020/standalone/directives/segment.mjs +4 -4
- package/esm2020/standalone/directives/select.mjs +4 -4
- package/esm2020/standalone/directives/textarea.mjs +4 -4
- package/esm2020/standalone/directives/toggle.mjs +4 -4
- package/esm2020/standalone/index.mjs +2 -2
- package/esm2020/standalone/navigation/back-button.mjs +4 -4
- package/esm2020/standalone/navigation/nav.mjs +4 -4
- package/esm2020/standalone/navigation/router-link-delegate.mjs +7 -7
- package/esm2020/standalone/navigation/router-outlet.mjs +14 -10
- package/esm2020/standalone/navigation/tabs.mjs +5 -5
- package/esm2020/standalone/overlays/modal.mjs +4 -4
- package/esm2020/standalone/overlays/popover.mjs +4 -4
- package/esm2020/standalone/providers/action-sheet-controller.mjs +4 -4
- package/esm2020/standalone/providers/alert-controller.mjs +4 -4
- package/esm2020/standalone/providers/animation-controller.mjs +4 -4
- package/esm2020/standalone/providers/gesture-controller.mjs +4 -4
- package/esm2020/standalone/providers/loading-controller.mjs +4 -4
- package/esm2020/standalone/providers/menu-controller.mjs +4 -4
- package/esm2020/standalone/providers/modal-controller.mjs +4 -4
- package/esm2020/standalone/providers/picker-controller.mjs +8 -5
- package/esm2020/standalone/providers/toast-controller.mjs +4 -4
- package/fesm2015/ionic-angular-common.mjs +59 -54
- package/fesm2015/ionic-angular-common.mjs.map +1 -1
- package/fesm2015/ionic-angular-standalone.mjs +482 -419
- package/fesm2015/ionic-angular-standalone.mjs.map +1 -1
- package/fesm2015/ionic-angular.mjs +402 -359
- package/fesm2015/ionic-angular.mjs.map +1 -1
- package/fesm2020/ionic-angular-common.mjs +59 -54
- package/fesm2020/ionic-angular-common.mjs.map +1 -1
- package/fesm2020/ionic-angular-standalone.mjs +482 -419
- package/fesm2020/ionic-angular-standalone.mjs.map +1 -1
- package/fesm2020/ionic-angular.mjs +402 -359
- package/fesm2020/ionic-angular.mjs.map +1 -1
- package/index.d.ts +0 -1
- package/ionic-module.d.ts +11 -12
- package/package.json +2 -2
- package/providers/picker-controller.d.ts +4 -1
- package/standalone/directives/index.d.ts +0 -1
- package/standalone/directives/proxies.d.ts +56 -7
- package/standalone/index.d.ts +1 -1
- package/standalone/navigation/router-outlet.d.ts +12 -4
- package/standalone/providers/picker-controller.d.ts +4 -1
- package/LICENSE +0 -21
- package/directives/control-value-accessors/radio-value-accessor.d.ts +0 -9
- package/esm2020/directives/control-value-accessors/radio-value-accessor.mjs +0 -42
- package/esm2020/standalone/directives/radio.mjs +0 -62
- package/standalone/directives/radio.d.ts +0 -22
- package/test/apps/ng14/node_modules/@angular/animations/README.md +0 -8
- package/test/apps/ng14/node_modules/@angular/cli/README.md +0 -5
- package/test/apps/ng14/node_modules/@angular/common/README.md +0 -8
- package/test/apps/ng14/node_modules/@angular/compiler/README.md +0 -8
- package/test/apps/ng14/node_modules/@angular/core/README.md +0 -8
- package/test/apps/ng14/node_modules/@angular/forms/README.md +0 -8
- package/test/apps/ng14/node_modules/@angular/platform-browser/README.md +0 -8
- package/test/apps/ng14/node_modules/@angular/platform-browser-dynamic/README.md +0 -8
- package/test/apps/ng14/node_modules/@angular/platform-server/README.md +0 -8
- package/test/apps/ng14/node_modules/@angular/router/README.md +0 -8
- package/test/apps/ng14/node_modules/@angular-devkit/build-angular/README.md +0 -20
- package/test/apps/ng14/node_modules/@angular-eslint/builder/README.md +0 -1
- package/test/apps/ng14/node_modules/@angular-eslint/eslint-plugin/README.md +0 -1
- package/test/apps/ng14/node_modules/@angular-eslint/eslint-plugin-template/README.md +0 -1
- package/test/apps/ng14/node_modules/@angular-eslint/schematics/README.md +0 -1
- package/test/apps/ng14/node_modules/@angular-eslint/template-parser/README.md +0 -1
- package/test/apps/ng14/node_modules/@ionic/angular/README.md +0 -74
- package/test/apps/ng14/node_modules/@nguniversal/builders/README.md +0 -76
- package/test/apps/ng14/node_modules/@types/express/README.md +0 -15
- package/test/apps/ng14/node_modules/@types/node/README.md +0 -16
- package/test/apps/ng14/node_modules/@typescript-eslint/eslint-plugin/README.md +0 -10
- package/test/apps/ng14/node_modules/@typescript-eslint/parser/README.md +0 -10
- package/test/apps/ng14/node_modules/concurrently/README.md +0 -315
- package/test/apps/ng14/node_modules/core-js/README.md +0 -2307
- package/test/apps/ng14/node_modules/cypress/README.md +0 -25
- package/test/apps/ng14/node_modules/eslint/README.md +0 -308
- package/test/apps/ng14/node_modules/rxjs/README.md +0 -107
- package/test/apps/ng14/node_modules/ts-loader/README.md +0 -731
- package/test/apps/ng14/node_modules/ts-node/README.md +0 -302
- package/test/apps/ng14/node_modules/tslib/README.md +0 -164
- package/test/apps/ng14/node_modules/typescript/README.md +0 -104
- package/test/apps/ng14/node_modules/typescript-eslint-language-service/README.md +0 -77
- package/test/apps/ng14/node_modules/wait-on/README.md +0 -297
- package/test/apps/ng14/node_modules/webpack/README.md +0 -721
- package/test/apps/ng14/node_modules/webpack-cli/README.md +0 -147
- package/test/apps/ng14/node_modules/zone.js/README.md +0 -141
- package/test/apps/ng15/node_modules/@angular/animations/README.md +0 -8
- package/test/apps/ng15/node_modules/@angular/cli/README.md +0 -5
- package/test/apps/ng15/node_modules/@angular/common/README.md +0 -8
- package/test/apps/ng15/node_modules/@angular/compiler/README.md +0 -8
- package/test/apps/ng15/node_modules/@angular/core/README.md +0 -8
- package/test/apps/ng15/node_modules/@angular/forms/README.md +0 -8
- package/test/apps/ng15/node_modules/@angular/platform-browser/README.md +0 -8
- package/test/apps/ng15/node_modules/@angular/platform-browser-dynamic/README.md +0 -8
- package/test/apps/ng15/node_modules/@angular/platform-server/README.md +0 -8
- package/test/apps/ng15/node_modules/@angular/router/README.md +0 -8
- package/test/apps/ng15/node_modules/@angular-devkit/build-angular/README.md +0 -20
- package/test/apps/ng15/node_modules/@angular-eslint/builder/README.md +0 -1
- package/test/apps/ng15/node_modules/@angular-eslint/eslint-plugin/README.md +0 -1
- package/test/apps/ng15/node_modules/@angular-eslint/eslint-plugin-template/README.md +0 -1
- package/test/apps/ng15/node_modules/@angular-eslint/schematics/README.md +0 -1
- package/test/apps/ng15/node_modules/@angular-eslint/template-parser/README.md +0 -1
- package/test/apps/ng15/node_modules/@ionic/angular/README.md +0 -74
- package/test/apps/ng15/node_modules/@nguniversal/builders/README.md +0 -76
- package/test/apps/ng15/node_modules/@nguniversal/express-engine/README.md +0 -118
- package/test/apps/ng15/node_modules/@types/express/README.md +0 -15
- package/test/apps/ng15/node_modules/@types/node/README.md +0 -16
- package/test/apps/ng15/node_modules/@typescript-eslint/eslint-plugin/README.md +0 -234
- package/test/apps/ng15/node_modules/@typescript-eslint/parser/README.md +0 -265
- package/test/apps/ng15/node_modules/concurrently/README.md +0 -315
- package/test/apps/ng15/node_modules/core-js/README.md +0 -2307
- package/test/apps/ng15/node_modules/cypress/README.md +0 -25
- package/test/apps/ng15/node_modules/eslint/README.md +0 -308
- package/test/apps/ng15/node_modules/rxjs/README.md +0 -107
- package/test/apps/ng15/node_modules/ts-loader/README.md +0 -731
- package/test/apps/ng15/node_modules/ts-node/README.md +0 -302
- package/test/apps/ng15/node_modules/tslib/README.md +0 -164
- package/test/apps/ng15/node_modules/typescript/README.md +0 -104
- package/test/apps/ng15/node_modules/typescript-eslint-language-service/README.md +0 -77
- package/test/apps/ng15/node_modules/wait-on/README.md +0 -297
- package/test/apps/ng15/node_modules/webpack/README.md +0 -721
- package/test/apps/ng15/node_modules/webpack-cli/README.md +0 -147
- package/test/apps/ng15/node_modules/zone.js/README.md +0 -141
- package/test/apps/ng16/node_modules/@angular/animations/README.md +0 -8
- package/test/apps/ng16/node_modules/@angular/cli/README.md +0 -5
- package/test/apps/ng16/node_modules/@angular/common/README.md +0 -8
- package/test/apps/ng16/node_modules/@angular/compiler/README.md +0 -8
- package/test/apps/ng16/node_modules/@angular/core/README.md +0 -8
- package/test/apps/ng16/node_modules/@angular/forms/README.md +0 -8
- package/test/apps/ng16/node_modules/@angular/platform-browser/README.md +0 -8
- package/test/apps/ng16/node_modules/@angular/platform-browser-dynamic/README.md +0 -8
- package/test/apps/ng16/node_modules/@angular/platform-server/README.md +0 -8
- package/test/apps/ng16/node_modules/@angular/router/README.md +0 -8
- package/test/apps/ng16/node_modules/@angular-devkit/build-angular/README.md +0 -20
- package/test/apps/ng16/node_modules/@angular-eslint/builder/README.md +0 -1
- package/test/apps/ng16/node_modules/@angular-eslint/eslint-plugin/README.md +0 -84
- package/test/apps/ng16/node_modules/@angular-eslint/eslint-plugin-template/README.md +0 -93
- package/test/apps/ng16/node_modules/@angular-eslint/schematics/README.md +0 -1
- package/test/apps/ng16/node_modules/@angular-eslint/template-parser/README.md +0 -1
- package/test/apps/ng16/node_modules/@ionic/angular/README.md +0 -74
- package/test/apps/ng16/node_modules/@nguniversal/builders/README.md +0 -76
- package/test/apps/ng16/node_modules/@nguniversal/express-engine/README.md +0 -118
- package/test/apps/ng16/node_modules/@types/express/README.md +0 -15
- package/test/apps/ng16/node_modules/@types/node/README.md +0 -16
- package/test/apps/ng16/node_modules/@typescript-eslint/eslint-plugin/README.md +0 -234
- package/test/apps/ng16/node_modules/@typescript-eslint/parser/README.md +0 -265
- package/test/apps/ng16/node_modules/concurrently/README.md +0 -315
- package/test/apps/ng16/node_modules/core-js/README.md +0 -2307
- package/test/apps/ng16/node_modules/cypress/README.md +0 -25
- package/test/apps/ng16/node_modules/eslint/README.md +0 -308
- package/test/apps/ng16/node_modules/rxjs/README.md +0 -107
- package/test/apps/ng16/node_modules/ts-loader/README.md +0 -731
- package/test/apps/ng16/node_modules/ts-node/README.md +0 -302
- package/test/apps/ng16/node_modules/tslib/README.md +0 -164
- package/test/apps/ng16/node_modules/typescript/README.md +0 -49
- package/test/apps/ng16/node_modules/typescript-eslint-language-service/README.md +0 -77
- package/test/apps/ng16/node_modules/wait-on/README.md +0 -297
- package/test/apps/ng16/node_modules/webpack/README.md +0 -721
- package/test/apps/ng16/node_modules/webpack-cli/README.md +0 -147
- package/test/apps/ng16/node_modules/zone.js/README.md +0 -141
- package/test/apps/ng17/node_modules/@angular/animations/README.md +0 -8
- package/test/apps/ng17/node_modules/@angular/cli/README.md +0 -5
- package/test/apps/ng17/node_modules/@angular/common/README.md +0 -8
- package/test/apps/ng17/node_modules/@angular/compiler/README.md +0 -8
- package/test/apps/ng17/node_modules/@angular/core/README.md +0 -8
- package/test/apps/ng17/node_modules/@angular/forms/README.md +0 -8
- package/test/apps/ng17/node_modules/@angular/platform-browser/README.md +0 -8
- package/test/apps/ng17/node_modules/@angular/platform-browser-dynamic/README.md +0 -8
- package/test/apps/ng17/node_modules/@angular/platform-server/README.md +0 -8
- package/test/apps/ng17/node_modules/@angular/router/README.md +0 -8
- package/test/apps/ng17/node_modules/@angular-devkit/build-angular/README.md +0 -24
- package/test/apps/ng17/node_modules/@angular-eslint/builder/README.md +0 -1
- package/test/apps/ng17/node_modules/@angular-eslint/eslint-plugin/README.md +0 -84
- package/test/apps/ng17/node_modules/@angular-eslint/eslint-plugin-template/README.md +0 -94
- package/test/apps/ng17/node_modules/@angular-eslint/schematics/README.md +0 -1
- package/test/apps/ng17/node_modules/@angular-eslint/template-parser/README.md +0 -1
- package/test/apps/ng17/node_modules/@ionic/angular/README.md +0 -74
- package/test/apps/ng17/node_modules/@types/express/README.md +0 -15
- package/test/apps/ng17/node_modules/@types/ws/README.md +0 -16
- package/test/apps/ng17/node_modules/@typescript-eslint/eslint-plugin/README.md +0 -12
- package/test/apps/ng17/node_modules/@typescript-eslint/parser/README.md +0 -12
- package/test/apps/ng17/node_modules/concurrently/README.md +0 -315
- package/test/apps/ng17/node_modules/core-js/README.md +0 -95
- package/test/apps/ng17/node_modules/cypress/README.md +0 -25
- package/test/apps/ng17/node_modules/eslint/README.md +0 -308
- package/test/apps/ng17/node_modules/rxjs/README.md +0 -107
- package/test/apps/ng17/node_modules/ts-loader/README.md +0 -731
- package/test/apps/ng17/node_modules/ts-node/README.md +0 -302
- package/test/apps/ng17/node_modules/tslib/README.md +0 -164
- package/test/apps/ng17/node_modules/typescript/README.md +0 -51
- package/test/apps/ng17/node_modules/typescript-eslint-language-service/README.md +0 -77
- package/test/apps/ng17/node_modules/wait-on/README.md +0 -297
- package/test/apps/ng17/node_modules/webpack/README.md +0 -721
- package/test/apps/ng17/node_modules/webpack-cli/README.md +0 -147
- package/test/apps/ng17/node_modules/zone.js/README.md +0 -141
|
@@ -1,302 +0,0 @@
|
|
|
1
|
-
# 
|
|
2
|
-
|
|
3
|
-
[![NPM version][npm-image]][npm-url]
|
|
4
|
-
[![NPM downloads][downloads-image]][downloads-url]
|
|
5
|
-
[![Build status][travis-image]][travis-url]
|
|
6
|
-
[![Test coverage][coveralls-image]][coveralls-url]
|
|
7
|
-
|
|
8
|
-
> TypeScript execution and REPL for node.js, with source map support. **Works with `typescript@>=2.7`**.
|
|
9
|
-
|
|
10
|
-
### *Experimental ESM support*
|
|
11
|
-
|
|
12
|
-
Native ESM support is currently experimental. For usage, limitations, and to provide feedback, see [#1007](https://github.com/TypeStrong/ts-node/issues/1007).
|
|
13
|
-
|
|
14
|
-
## Installation
|
|
15
|
-
|
|
16
|
-
```sh
|
|
17
|
-
# Locally in your project.
|
|
18
|
-
npm install -D typescript
|
|
19
|
-
npm install -D ts-node
|
|
20
|
-
|
|
21
|
-
# Or globally with TypeScript.
|
|
22
|
-
npm install -g typescript
|
|
23
|
-
npm install -g ts-node
|
|
24
|
-
```
|
|
25
|
-
|
|
26
|
-
**Tip:** Installing modules locally allows you to control and share the versions through `package.json`. TS Node will always resolve the compiler from `cwd` before checking relative to its own installation.
|
|
27
|
-
|
|
28
|
-
## Usage
|
|
29
|
-
|
|
30
|
-
### Shell
|
|
31
|
-
|
|
32
|
-
```sh
|
|
33
|
-
# Execute a script as `node` + `tsc`.
|
|
34
|
-
ts-node script.ts
|
|
35
|
-
|
|
36
|
-
# Starts a TypeScript REPL.
|
|
37
|
-
ts-node
|
|
38
|
-
|
|
39
|
-
# Execute code with TypeScript.
|
|
40
|
-
ts-node -e 'console.log("Hello, world!")'
|
|
41
|
-
|
|
42
|
-
# Execute, and print, code with TypeScript.
|
|
43
|
-
ts-node -p -e '"Hello, world!"'
|
|
44
|
-
|
|
45
|
-
# Pipe scripts to execute with TypeScript.
|
|
46
|
-
echo 'console.log("Hello, world!")' | ts-node
|
|
47
|
-
|
|
48
|
-
# Equivalent to ts-node --script-mode
|
|
49
|
-
ts-node-script scripts.ts
|
|
50
|
-
|
|
51
|
-
# Equivalent to ts-node --transpile-only
|
|
52
|
-
ts-node-transpile-only scripts.ts
|
|
53
|
-
```
|
|
54
|
-
|
|
55
|
-

|
|
56
|
-
|
|
57
|
-
### Shebang
|
|
58
|
-
|
|
59
|
-
```typescript
|
|
60
|
-
#!/usr/bin/env ts-node-script
|
|
61
|
-
|
|
62
|
-
console.log("Hello, world!")
|
|
63
|
-
```
|
|
64
|
-
|
|
65
|
-
`ts-node-script` is recommended because it enables `--script-mode`, discovering `tsconfig.json` relative to the script's location instead of `process.cwd()`. This makes scripts more portable.
|
|
66
|
-
|
|
67
|
-
Passing CLI arguments via shebang is allowed on Mac but not Linux. For example, the following will fail on Linux:
|
|
68
|
-
|
|
69
|
-
```
|
|
70
|
-
#!/usr/bin/env ts-node --script-mode --transpile-only --files
|
|
71
|
-
// This shebang is not portable. It only works on Mac
|
|
72
|
-
```
|
|
73
|
-
|
|
74
|
-
### Programmatic
|
|
75
|
-
|
|
76
|
-
You can require `ts-node` and register the loader for future requires by using `require('ts-node').register({ /* options */ })`. You can also use file shortcuts - `node -r ts-node/register` or `node -r ts-node/register/transpile-only` - depending on your preferences.
|
|
77
|
-
|
|
78
|
-
**Note:** If you need to use advanced node.js CLI arguments (e.g. `--inspect`), use them with `node -r ts-node/register` instead of the `ts-node` CLI.
|
|
79
|
-
|
|
80
|
-
#### Developers
|
|
81
|
-
|
|
82
|
-
**TS Node** exports a `create()` function that can be used to initialize a TypeScript compiler that isn't registered to `require.extensions`, and it uses the same code as `register`.
|
|
83
|
-
|
|
84
|
-
### Mocha
|
|
85
|
-
|
|
86
|
-
Mocha 6
|
|
87
|
-
|
|
88
|
-
```sh
|
|
89
|
-
mocha --require ts-node/register --watch-extensions ts,tsx "test/**/*.{ts,tsx}" [...args]
|
|
90
|
-
```
|
|
91
|
-
|
|
92
|
-
**Note:** `--watch-extensions` is only used in `--watch` mode.
|
|
93
|
-
|
|
94
|
-
Mocha 7
|
|
95
|
-
|
|
96
|
-
```sh
|
|
97
|
-
mocha --require ts-node/register --extensions ts,tsx --watch --watch-files src 'tests/**/*.{ts,tsx}' [...args]
|
|
98
|
-
```
|
|
99
|
-
|
|
100
|
-
### Tape
|
|
101
|
-
|
|
102
|
-
```sh
|
|
103
|
-
ts-node node_modules/tape/bin/tape [...args]
|
|
104
|
-
```
|
|
105
|
-
|
|
106
|
-
### Gulp
|
|
107
|
-
|
|
108
|
-
```sh
|
|
109
|
-
# Create a `gulpfile.ts` and run `gulp`.
|
|
110
|
-
gulp
|
|
111
|
-
```
|
|
112
|
-
|
|
113
|
-
### Visual Studio Code
|
|
114
|
-
|
|
115
|
-
Create a new node.js configuration, add `-r ts-node/register` to node args and move the `program` to the `args` list (so VS Code doesn't look for `outFiles`).
|
|
116
|
-
|
|
117
|
-
```json
|
|
118
|
-
{
|
|
119
|
-
"type": "node",
|
|
120
|
-
"request": "launch",
|
|
121
|
-
"name": "Launch Program",
|
|
122
|
-
"runtimeArgs": [
|
|
123
|
-
"-r",
|
|
124
|
-
"ts-node/register"
|
|
125
|
-
],
|
|
126
|
-
"args": [
|
|
127
|
-
"${workspaceFolder}/index.ts"
|
|
128
|
-
]
|
|
129
|
-
}
|
|
130
|
-
```
|
|
131
|
-
|
|
132
|
-
**Note:** If you are using the `--project <tsconfig.json>` command line argument as per the [Configuration Options](#configuration-options), and want to apply this same behavior when launching in VS Code, add an "env" key into the launch configuration: `"env": { "TS_NODE_PROJECT": "<tsconfig.json>" }`.
|
|
133
|
-
|
|
134
|
-
### IntelliJ (and WebStorm)
|
|
135
|
-
|
|
136
|
-
Create a new Node.js configuration and add `-r ts-node/register` to "Node parameters."
|
|
137
|
-
|
|
138
|
-
**Note:** If you are using the `--project <tsconfig.json>` command line argument as per the [Configuration Options](#configuration-options), and want to apply this same behavior when launching in IntelliJ, specify under "Environment Variables": `TS_NODE_PROJECT=<tsconfig.json>`.
|
|
139
|
-
|
|
140
|
-
## How It Works
|
|
141
|
-
|
|
142
|
-
**TypeScript Node** works by registering the TypeScript compiler for `.tsx?` and `.jsx?` (when `allowJs == true`) extensions. When node.js has an extension registered (via `require.extensions`), it will use the extension internally for module resolution. When an extension is unknown to node.js, it handles the file as `.js` (JavaScript). By default, **TypeScript Node** avoids compiling files in `/node_modules/` for three reasons:
|
|
143
|
-
|
|
144
|
-
1. Modules should always be published in a format node.js can consume
|
|
145
|
-
2. Transpiling the entire dependency tree will make your project slower
|
|
146
|
-
3. Differing behaviours between TypeScript and node.js (e.g. ES2015 modules) can result in a project that works until you decide to support a feature natively from node.js
|
|
147
|
-
|
|
148
|
-
**P.S.** This means if you don't register an extension, it is compiled as JavaScript. When `ts-node` is used with `allowJs`, JavaScript files are transpiled using the TypeScript compiler.
|
|
149
|
-
|
|
150
|
-
## Loading `tsconfig.json`
|
|
151
|
-
|
|
152
|
-
**Typescript Node** loads `tsconfig.json` automatically. Use `--skip-project` to skip loading the `tsconfig.json`.
|
|
153
|
-
|
|
154
|
-
It is resolved relative to `--dir` using [the same search behavior as `tsc`](https://www.typescriptlang.org/docs/handbook/tsconfig-json.html). In `--script-mode`, this is the directory containing the script. Otherwise it is resolved relative to `process.cwd()`, which matches the behavior of `tsc`.
|
|
155
|
-
|
|
156
|
-
Use `--project` to specify the path to your `tsconfig.json`, ignoring `--dir`.
|
|
157
|
-
|
|
158
|
-
**Tip**: You can use `ts-node` together with [tsconfig-paths](https://www.npmjs.com/package/tsconfig-paths) to load modules according to the `paths` section in `tsconfig.json`.
|
|
159
|
-
|
|
160
|
-
## Configuration Options
|
|
161
|
-
|
|
162
|
-
You can set options by passing them before the script path, via programmatic usage, via `tsconfig.json`, or via environment variables.
|
|
163
|
-
|
|
164
|
-
```sh
|
|
165
|
-
ts-node --compiler ntypescript --project src/tsconfig.json hello-world.ts
|
|
166
|
-
```
|
|
167
|
-
|
|
168
|
-
**Note:** [`ntypescript`](https://github.com/TypeStrong/ntypescript#readme) is an example of a TypeScript-compatible `compiler`.
|
|
169
|
-
|
|
170
|
-
### CLI Options
|
|
171
|
-
|
|
172
|
-
`ts-node` supports `--print` (`-p`), `--eval` (`-e`), `--require` (`-r`) and `--interactive` (`-i`) similar to the [node.js CLI options](https://nodejs.org/api/cli.html).
|
|
173
|
-
|
|
174
|
-
* `-h, --help` Prints the help text
|
|
175
|
-
* `-v, --version` Prints the version. `-vv` prints node and typescript compiler versions, too
|
|
176
|
-
* `-s, --script-mode` Resolve config relative to the directory of the passed script instead of the current directory. Changes default of `--dir`
|
|
177
|
-
|
|
178
|
-
### CLI and Programmatic Options
|
|
179
|
-
|
|
180
|
-
_The name of the environment variable and the option's default value are denoted in parentheses._
|
|
181
|
-
|
|
182
|
-
* `-T, --transpile-only` Use TypeScript's faster `transpileModule` (`TS_NODE_TRANSPILE_ONLY`, default: `false`)
|
|
183
|
-
* `-H, --compiler-host` Use TypeScript's compiler host API (`TS_NODE_COMPILER_HOST`, default: `false`)
|
|
184
|
-
* `-I, --ignore [pattern]` Override the path patterns to skip compilation (`TS_NODE_IGNORE`, default: `/node_modules/`)
|
|
185
|
-
* `-P, --project [path]` Path to TypeScript JSON project file (`TS_NODE_PROJECT`)
|
|
186
|
-
* `-C, --compiler [name]` Specify a custom TypeScript compiler (`TS_NODE_COMPILER`, default: `typescript`)
|
|
187
|
-
* `-D, --ignore-diagnostics [code]` Ignore TypeScript warnings by diagnostic code (`TS_NODE_IGNORE_DIAGNOSTICS`)
|
|
188
|
-
* `-O, --compiler-options [opts]` JSON object to merge with compiler options (`TS_NODE_COMPILER_OPTIONS`)
|
|
189
|
-
* `--dir` Specify working directory for config resolution (`TS_NODE_CWD`, default: `process.cwd()`, or `dirname(scriptPath)` if `--script-mode`)
|
|
190
|
-
* `--scope` Scope compiler to files within `cwd` (`TS_NODE_SCOPE`, default: `false`)
|
|
191
|
-
* `--files` Load `files`, `include` and `exclude` from `tsconfig.json` on startup (`TS_NODE_FILES`, default: `false`)
|
|
192
|
-
* `--pretty` Use pretty diagnostic formatter (`TS_NODE_PRETTY`, default: `false`)
|
|
193
|
-
* `--skip-project` Skip project config resolution and loading (`TS_NODE_SKIP_PROJECT`, default: `false`)
|
|
194
|
-
* `--skip-ignore` Skip ignore checks (`TS_NODE_SKIP_IGNORE`, default: `false`)
|
|
195
|
-
* `--emit` Emit output files into `.ts-node` directory (`TS_NODE_EMIT`, default: `false`)
|
|
196
|
-
* `--prefer-ts-exts` Re-order file extensions so that TypeScript imports are preferred (`TS_NODE_PREFER_TS_EXTS`, default: `false`)
|
|
197
|
-
* `--log-error` Logs TypeScript errors to stderr instead of throwing exceptions (`TS_NODE_LOG_ERROR`, default: `false`)
|
|
198
|
-
|
|
199
|
-
### Programmatic-only Options
|
|
200
|
-
|
|
201
|
-
* `transformers` `_ts.CustomTransformers | ((p: _ts.Program) => _ts.CustomTransformers)`: An object with transformers or a function that accepts a program and returns an transformers object to pass to TypeScript. Function isn't available with `transpileOnly` flag
|
|
202
|
-
* `readFile`: Custom TypeScript-compatible file reading function
|
|
203
|
-
* `fileExists`: Custom TypeScript-compatible file existence function
|
|
204
|
-
|
|
205
|
-
### Options via tsconfig.json
|
|
206
|
-
|
|
207
|
-
Most options can be specified by a `"ts-node"` object in `tsconfig.json` using their programmatic, camelCase names. For example, to enable `--transpile-only`:
|
|
208
|
-
|
|
209
|
-
```json
|
|
210
|
-
// tsconfig.json
|
|
211
|
-
{
|
|
212
|
-
"ts-node": {
|
|
213
|
-
"transpileOnly": true
|
|
214
|
-
},
|
|
215
|
-
"compilerOptions": {}
|
|
216
|
-
}
|
|
217
|
-
```
|
|
218
|
-
|
|
219
|
-
Our bundled [JSON schema](https://unpkg.com/browse/ts-node@8.8.2/tsconfig.schema.json) lists all compatible options.
|
|
220
|
-
|
|
221
|
-
## SyntaxError
|
|
222
|
-
|
|
223
|
-
Any error that is not a `TSError` is from node.js (e.g. `SyntaxError`), and cannot be fixed by TypeScript or `ts-node`. These are runtime issues with your code.
|
|
224
|
-
|
|
225
|
-
### Import Statements
|
|
226
|
-
|
|
227
|
-
Current node.js stable releases do not support ES modules. Additionally, `ts-node` does not have the required hooks into node.js to support ES modules. You will need to set `"module": "commonjs"` in your `tsconfig.json` for your code to work.
|
|
228
|
-
|
|
229
|
-
## Help! My Types Are Missing!
|
|
230
|
-
|
|
231
|
-
**TypeScript Node** does _not_ use `files`, `include` or `exclude`, by default. This is because a large majority projects do not use all of the files in a project directory (e.g. `Gulpfile.ts`, runtime vs tests) and parsing every file for types slows startup time. Instead, `ts-node` starts with the script file (e.g. `ts-node index.ts`) and TypeScript resolves dependencies based on imports and references.
|
|
232
|
-
|
|
233
|
-
For global definitions, you can use the `typeRoots` compiler option. This requires that your type definitions be structured as type packages (not loose TypeScript definition files). More details on how this works can be found in the [TypeScript Handbook](https://www.typescriptlang.org/docs/handbook/tsconfig-json.html#types-typeroots-and-types).
|
|
234
|
-
|
|
235
|
-
Example `tsconfig.json`:
|
|
236
|
-
|
|
237
|
-
```json
|
|
238
|
-
{
|
|
239
|
-
"compilerOptions": {
|
|
240
|
-
"typeRoots" : ["./node_modules/@types", "./typings"]
|
|
241
|
-
}
|
|
242
|
-
}
|
|
243
|
-
```
|
|
244
|
-
|
|
245
|
-
Example project structure:
|
|
246
|
-
|
|
247
|
-
```text
|
|
248
|
-
<project_root>/
|
|
249
|
-
-- tsconfig.json
|
|
250
|
-
-- typings/
|
|
251
|
-
-- <module_name>/
|
|
252
|
-
-- index.d.ts
|
|
253
|
-
```
|
|
254
|
-
|
|
255
|
-
Example module declaration file:
|
|
256
|
-
|
|
257
|
-
```typescript
|
|
258
|
-
declare module '<module_name>' {
|
|
259
|
-
// module definitions go here
|
|
260
|
-
}
|
|
261
|
-
```
|
|
262
|
-
|
|
263
|
-
For module definitions, you can use [`paths`](https://www.typescriptlang.org/docs/handbook/module-resolution.html#path-mapping):
|
|
264
|
-
|
|
265
|
-
```json
|
|
266
|
-
{
|
|
267
|
-
"compilerOptions": {
|
|
268
|
-
"baseUrl": ".",
|
|
269
|
-
"paths": {
|
|
270
|
-
"custom-module-type": ["types/custom-module-type"]
|
|
271
|
-
}
|
|
272
|
-
}
|
|
273
|
-
}
|
|
274
|
-
```
|
|
275
|
-
|
|
276
|
-
An alternative approach for definitions of third-party libraries are [triple-slash directives](https://www.typescriptlang.org/docs/handbook/triple-slash-directives.html). This may be helpful if you prefer not to change your TypeScript `compilerOptions` or structure your custom type definitions when using `typeRoots`. Below is an example of the triple-slash directive as a relative path within your project:
|
|
277
|
-
|
|
278
|
-
```typescript
|
|
279
|
-
/// <reference types="./types/untyped_js_lib" />
|
|
280
|
-
import UntypedJsLib from "untyped_js_lib"
|
|
281
|
-
```
|
|
282
|
-
|
|
283
|
-
**Tip:** If you _must_ use `files`, `include`, or `exclude`, enable `--files` flags or set `TS_NODE_FILES=true`.
|
|
284
|
-
|
|
285
|
-
## Watching and Restarting
|
|
286
|
-
|
|
287
|
-
**TypeScript Node** compiles source code via `require()`, watching files and code reloads are out of scope for the project. If you want to restart the `ts-node` process on file change, existing node.js tools such as [nodemon](https://github.com/remy/nodemon), [onchange](https://github.com/Qard/onchange) and [node-dev](https://github.com/fgnass/node-dev) work.
|
|
288
|
-
|
|
289
|
-
There's also [`ts-node-dev`](https://github.com/whitecolor/ts-node-dev), a modified version of [`node-dev`](https://github.com/fgnass/node-dev) using `ts-node` for compilation and won't restart the process on file change.
|
|
290
|
-
|
|
291
|
-
## License
|
|
292
|
-
|
|
293
|
-
MIT
|
|
294
|
-
|
|
295
|
-
[npm-image]: https://img.shields.io/npm/v/ts-node.svg?style=flat
|
|
296
|
-
[npm-url]: https://npmjs.org/package/ts-node
|
|
297
|
-
[downloads-image]: https://img.shields.io/npm/dm/ts-node.svg?style=flat
|
|
298
|
-
[downloads-url]: https://npmjs.org/package/ts-node
|
|
299
|
-
[travis-image]: https://img.shields.io/travis/TypeStrong/ts-node.svg?style=flat
|
|
300
|
-
[travis-url]: https://travis-ci.org/TypeStrong/ts-node
|
|
301
|
-
[coveralls-image]: https://img.shields.io/coveralls/TypeStrong/ts-node.svg?style=flat
|
|
302
|
-
[coveralls-url]: https://coveralls.io/r/TypeStrong/ts-node?branch=master
|
|
@@ -1,164 +0,0 @@
|
|
|
1
|
-
# tslib
|
|
2
|
-
|
|
3
|
-
This is a runtime library for [TypeScript](https://www.typescriptlang.org/) that contains all of the TypeScript helper functions.
|
|
4
|
-
|
|
5
|
-
This library is primarily used by the `--importHelpers` flag in TypeScript.
|
|
6
|
-
When using `--importHelpers`, a module that uses helper functions like `__extends` and `__assign` in the following emitted file:
|
|
7
|
-
|
|
8
|
-
```ts
|
|
9
|
-
var __assign = (this && this.__assign) || Object.assign || function(t) {
|
|
10
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
11
|
-
s = arguments[i];
|
|
12
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
13
|
-
t[p] = s[p];
|
|
14
|
-
}
|
|
15
|
-
return t;
|
|
16
|
-
};
|
|
17
|
-
exports.x = {};
|
|
18
|
-
exports.y = __assign({}, exports.x);
|
|
19
|
-
|
|
20
|
-
```
|
|
21
|
-
|
|
22
|
-
will instead be emitted as something like the following:
|
|
23
|
-
|
|
24
|
-
```ts
|
|
25
|
-
var tslib_1 = require("tslib");
|
|
26
|
-
exports.x = {};
|
|
27
|
-
exports.y = tslib_1.__assign({}, exports.x);
|
|
28
|
-
```
|
|
29
|
-
|
|
30
|
-
Because this can avoid duplicate declarations of things like `__extends`, `__assign`, etc., this means delivering users smaller files on average, as well as less runtime overhead.
|
|
31
|
-
For optimized bundles with TypeScript, you should absolutely consider using `tslib` and `--importHelpers`.
|
|
32
|
-
|
|
33
|
-
# Installing
|
|
34
|
-
|
|
35
|
-
For the latest stable version, run:
|
|
36
|
-
|
|
37
|
-
## npm
|
|
38
|
-
|
|
39
|
-
```sh
|
|
40
|
-
# TypeScript 3.9.2 or later
|
|
41
|
-
npm install tslib
|
|
42
|
-
|
|
43
|
-
# TypeScript 3.8.4 or earlier
|
|
44
|
-
npm install tslib@^1
|
|
45
|
-
|
|
46
|
-
# TypeScript 2.3.2 or earlier
|
|
47
|
-
npm install tslib@1.6.1
|
|
48
|
-
```
|
|
49
|
-
|
|
50
|
-
## yarn
|
|
51
|
-
|
|
52
|
-
```sh
|
|
53
|
-
# TypeScript 3.9.2 or later
|
|
54
|
-
yarn add tslib
|
|
55
|
-
|
|
56
|
-
# TypeScript 3.8.4 or earlier
|
|
57
|
-
yarn add tslib@^1
|
|
58
|
-
|
|
59
|
-
# TypeScript 2.3.2 or earlier
|
|
60
|
-
yarn add tslib@1.6.1
|
|
61
|
-
```
|
|
62
|
-
|
|
63
|
-
## bower
|
|
64
|
-
|
|
65
|
-
```sh
|
|
66
|
-
# TypeScript 3.9.2 or later
|
|
67
|
-
bower install tslib
|
|
68
|
-
|
|
69
|
-
# TypeScript 3.8.4 or earlier
|
|
70
|
-
bower install tslib@^1
|
|
71
|
-
|
|
72
|
-
# TypeScript 2.3.2 or earlier
|
|
73
|
-
bower install tslib@1.6.1
|
|
74
|
-
```
|
|
75
|
-
|
|
76
|
-
## JSPM
|
|
77
|
-
|
|
78
|
-
```sh
|
|
79
|
-
# TypeScript 3.9.2 or later
|
|
80
|
-
jspm install tslib
|
|
81
|
-
|
|
82
|
-
# TypeScript 3.8.4 or earlier
|
|
83
|
-
jspm install tslib@^1
|
|
84
|
-
|
|
85
|
-
# TypeScript 2.3.2 or earlier
|
|
86
|
-
jspm install tslib@1.6.1
|
|
87
|
-
```
|
|
88
|
-
|
|
89
|
-
# Usage
|
|
90
|
-
|
|
91
|
-
Set the `importHelpers` compiler option on the command line:
|
|
92
|
-
|
|
93
|
-
```
|
|
94
|
-
tsc --importHelpers file.ts
|
|
95
|
-
```
|
|
96
|
-
|
|
97
|
-
or in your tsconfig.json:
|
|
98
|
-
|
|
99
|
-
```json
|
|
100
|
-
{
|
|
101
|
-
"compilerOptions": {
|
|
102
|
-
"importHelpers": true
|
|
103
|
-
}
|
|
104
|
-
}
|
|
105
|
-
```
|
|
106
|
-
|
|
107
|
-
#### For bower and JSPM users
|
|
108
|
-
|
|
109
|
-
You will need to add a `paths` mapping for `tslib`, e.g. For Bower users:
|
|
110
|
-
|
|
111
|
-
```json
|
|
112
|
-
{
|
|
113
|
-
"compilerOptions": {
|
|
114
|
-
"module": "amd",
|
|
115
|
-
"importHelpers": true,
|
|
116
|
-
"baseUrl": "./",
|
|
117
|
-
"paths": {
|
|
118
|
-
"tslib" : ["bower_components/tslib/tslib.d.ts"]
|
|
119
|
-
}
|
|
120
|
-
}
|
|
121
|
-
}
|
|
122
|
-
```
|
|
123
|
-
|
|
124
|
-
For JSPM users:
|
|
125
|
-
|
|
126
|
-
```json
|
|
127
|
-
{
|
|
128
|
-
"compilerOptions": {
|
|
129
|
-
"module": "system",
|
|
130
|
-
"importHelpers": true,
|
|
131
|
-
"baseUrl": "./",
|
|
132
|
-
"paths": {
|
|
133
|
-
"tslib" : ["jspm_packages/npm/tslib@2.x.y/tslib.d.ts"]
|
|
134
|
-
}
|
|
135
|
-
}
|
|
136
|
-
}
|
|
137
|
-
```
|
|
138
|
-
|
|
139
|
-
## Deployment
|
|
140
|
-
|
|
141
|
-
- Choose your new version number
|
|
142
|
-
- Set it in `package.json` and `bower.json`
|
|
143
|
-
- Create a tag: `git tag [version]`
|
|
144
|
-
- Push the tag: `git push --tags`
|
|
145
|
-
- Create a [release in GitHub](https://github.com/microsoft/tslib/releases)
|
|
146
|
-
- Run the [publish to npm](https://github.com/microsoft/tslib/actions?query=workflow%3A%22Publish+to+NPM%22) workflow
|
|
147
|
-
|
|
148
|
-
Done.
|
|
149
|
-
|
|
150
|
-
# Contribute
|
|
151
|
-
|
|
152
|
-
There are many ways to [contribute](https://github.com/Microsoft/TypeScript/blob/master/CONTRIBUTING.md) to TypeScript.
|
|
153
|
-
|
|
154
|
-
* [Submit bugs](https://github.com/Microsoft/TypeScript/issues) and help us verify fixes as they are checked in.
|
|
155
|
-
* Review the [source code changes](https://github.com/Microsoft/TypeScript/pulls).
|
|
156
|
-
* Engage with other TypeScript users and developers on [StackOverflow](http://stackoverflow.com/questions/tagged/typescript).
|
|
157
|
-
* Join the [#typescript](http://twitter.com/#!/search/realtime/%23typescript) discussion on Twitter.
|
|
158
|
-
* [Contribute bug fixes](https://github.com/Microsoft/TypeScript/blob/master/CONTRIBUTING.md).
|
|
159
|
-
|
|
160
|
-
# Documentation
|
|
161
|
-
|
|
162
|
-
* [Quick tutorial](http://www.typescriptlang.org/Tutorial)
|
|
163
|
-
* [Programming handbook](http://www.typescriptlang.org/Handbook)
|
|
164
|
-
* [Homepage](http://www.typescriptlang.org/)
|
|
@@ -1,104 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
# TypeScript
|
|
3
|
-
|
|
4
|
-
[](https://github.com/microsoft/TypeScript/actions?query=workflow%3ACI)
|
|
5
|
-
[](https://dev.azure.com/typescript/TypeScript/_build?definitionId=7)
|
|
6
|
-
[](https://www.npmjs.com/package/typescript)
|
|
7
|
-
[](https://www.npmjs.com/package/typescript)
|
|
8
|
-
|
|
9
|
-
[TypeScript](https://www.typescriptlang.org/) is a language for application-scale JavaScript. TypeScript adds optional types to JavaScript that support tools for large-scale JavaScript applications for any browser, for any host, on any OS. TypeScript compiles to readable, standards-based JavaScript. Try it out at the [playground](https://www.typescriptlang.org/play/), and stay up to date via [our blog](https://blogs.msdn.microsoft.com/typescript) and [Twitter account](https://twitter.com/typescript).
|
|
10
|
-
|
|
11
|
-
Find others who are using TypeScript at [our community page](https://www.typescriptlang.org/community/).
|
|
12
|
-
|
|
13
|
-
## Installing
|
|
14
|
-
|
|
15
|
-
For the latest stable version:
|
|
16
|
-
|
|
17
|
-
```bash
|
|
18
|
-
npm install -g typescript
|
|
19
|
-
```
|
|
20
|
-
|
|
21
|
-
For our nightly builds:
|
|
22
|
-
|
|
23
|
-
```bash
|
|
24
|
-
npm install -g typescript@next
|
|
25
|
-
```
|
|
26
|
-
|
|
27
|
-
## Contribute
|
|
28
|
-
|
|
29
|
-
There are many ways to [contribute](https://github.com/microsoft/TypeScript/blob/main/CONTRIBUTING.md) to TypeScript.
|
|
30
|
-
* [Submit bugs](https://github.com/microsoft/TypeScript/issues) and help us verify fixes as they are checked in.
|
|
31
|
-
* Review the [source code changes](https://github.com/microsoft/TypeScript/pulls).
|
|
32
|
-
* Engage with other TypeScript users and developers on [StackOverflow](https://stackoverflow.com/questions/tagged/typescript).
|
|
33
|
-
* Help each other in the [TypeScript Community Discord](https://discord.gg/typescript).
|
|
34
|
-
* Join the [#typescript](https://twitter.com/search?q=%23TypeScript) discussion on Twitter.
|
|
35
|
-
* [Contribute bug fixes](https://github.com/microsoft/TypeScript/blob/main/CONTRIBUTING.md).
|
|
36
|
-
* Read the archived language specification ([docx](https://github.com/microsoft/TypeScript/blob/main/doc/TypeScript%20Language%20Specification%20-%20ARCHIVED.docx?raw=true),
|
|
37
|
-
[pdf](https://github.com/microsoft/TypeScript/blob/main/doc/TypeScript%20Language%20Specification%20-%20ARCHIVED.pdf?raw=true), [md](https://github.com/microsoft/TypeScript/blob/main/doc/spec-ARCHIVED.md)).
|
|
38
|
-
|
|
39
|
-
This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). For more information see
|
|
40
|
-
the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or contact [opencode@microsoft.com](mailto:opencode@microsoft.com)
|
|
41
|
-
with any additional questions or comments.
|
|
42
|
-
|
|
43
|
-
## Documentation
|
|
44
|
-
|
|
45
|
-
* [TypeScript in 5 minutes](https://www.typescriptlang.org/docs/handbook/typescript-in-5-minutes.html)
|
|
46
|
-
* [Programming handbook](https://www.typescriptlang.org/docs/handbook/intro.html)
|
|
47
|
-
* [Homepage](https://www.typescriptlang.org/)
|
|
48
|
-
|
|
49
|
-
## Building
|
|
50
|
-
|
|
51
|
-
In order to build the TypeScript compiler, ensure that you have [Git](https://git-scm.com/downloads) and [Node.js](https://nodejs.org/) installed.
|
|
52
|
-
|
|
53
|
-
Clone a copy of the repo:
|
|
54
|
-
|
|
55
|
-
```bash
|
|
56
|
-
git clone https://github.com/microsoft/TypeScript.git
|
|
57
|
-
```
|
|
58
|
-
|
|
59
|
-
Change to the TypeScript directory:
|
|
60
|
-
|
|
61
|
-
```bash
|
|
62
|
-
cd TypeScript
|
|
63
|
-
```
|
|
64
|
-
|
|
65
|
-
Install [Gulp](https://gulpjs.com/) tools and dev dependencies:
|
|
66
|
-
|
|
67
|
-
```bash
|
|
68
|
-
npm install -g gulp
|
|
69
|
-
npm ci
|
|
70
|
-
```
|
|
71
|
-
|
|
72
|
-
Use one of the following to build and test:
|
|
73
|
-
|
|
74
|
-
```
|
|
75
|
-
gulp local # Build the compiler into built/local.
|
|
76
|
-
gulp clean # Delete the built compiler.
|
|
77
|
-
gulp LKG # Replace the last known good with the built one.
|
|
78
|
-
# Bootstrapping step to be executed when the built compiler reaches a stable state.
|
|
79
|
-
gulp tests # Build the test infrastructure using the built compiler.
|
|
80
|
-
gulp runtests # Run tests using the built compiler and test infrastructure.
|
|
81
|
-
# You can override the specific suite runner used or specify a test for this command.
|
|
82
|
-
# Use --tests=<testPath> for a specific test and/or --runner=<runnerName> for a specific suite.
|
|
83
|
-
# Valid runners include conformance, compiler, fourslash, project, user, and docker
|
|
84
|
-
# The user and docker runners are extended test suite runners - the user runner
|
|
85
|
-
# works on disk in the tests/cases/user directory, while the docker runner works in containers.
|
|
86
|
-
# You'll need to have the docker executable in your system path for the docker runner to work.
|
|
87
|
-
gulp runtests-parallel # Like runtests, but split across multiple threads. Uses a number of threads equal to the system
|
|
88
|
-
# core count by default. Use --workers=<number> to adjust this.
|
|
89
|
-
gulp baseline-accept # This replaces the baseline test results with the results obtained from gulp runtests.
|
|
90
|
-
gulp lint # Runs eslint on the TypeScript source.
|
|
91
|
-
gulp help # List the above commands.
|
|
92
|
-
```
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
## Usage
|
|
96
|
-
|
|
97
|
-
```bash
|
|
98
|
-
node built/local/tsc.js hello.ts
|
|
99
|
-
```
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
## Roadmap
|
|
103
|
-
|
|
104
|
-
For details on our planned features and future direction please refer to our [roadmap](https://github.com/microsoft/TypeScript/wiki/Roadmap).
|
|
@@ -1,77 +0,0 @@
|
|
|
1
|
-
# typescript-eslint-language-service
|
|
2
|
-
|
|
3
|
-
[](https://github.com/Quramy/typescript-eslint-language-service/actions)
|
|
4
|
-
[](https://badge.fury.io/js/typescript-eslint-language-service)
|
|
5
|
-

|
|
6
|
-
[](https://raw.githubusercontent.com/Quramy/ts-graphql-plugin/master/LICENSE.txt)
|
|
7
|
-
|
|
8
|
-
TypeScript language service plugin to check ESLint errors.
|
|
9
|
-
|
|
10
|
-

|
|
11
|
-
|
|
12
|
-
## Features
|
|
13
|
-
|
|
14
|
-
- Report ESLint errors as TypeScript semantic diagnostics
|
|
15
|
-
- Create code-fix for ESLint errors if they have fixer
|
|
16
|
-
|
|
17
|
-
## Usage
|
|
18
|
-
|
|
19
|
-
### Requirements (peer dependencies)
|
|
20
|
-
|
|
21
|
-
- `typescript`
|
|
22
|
-
- `@typescript-eslint/parser` >= 4.0.0
|
|
23
|
-
- `@typescript-eslint/typescript-estree` >= 4.0.0
|
|
24
|
-
- `eslint`
|
|
25
|
-
|
|
26
|
-
### Install
|
|
27
|
-
|
|
28
|
-
```sh
|
|
29
|
-
npm install typescript-eslint-language-service -D
|
|
30
|
-
```
|
|
31
|
-
|
|
32
|
-
### Configure
|
|
33
|
-
|
|
34
|
-
And configure `plugins` section in your tsconfig.json, for example:
|
|
35
|
-
|
|
36
|
-
```json
|
|
37
|
-
{
|
|
38
|
-
"compilerOptions": {
|
|
39
|
-
"module": "commonjs",
|
|
40
|
-
"target": "es5",
|
|
41
|
-
"plugins": [
|
|
42
|
-
{
|
|
43
|
-
"name": "typescript-eslint-language-service"
|
|
44
|
-
}
|
|
45
|
-
]
|
|
46
|
-
}
|
|
47
|
-
}
|
|
48
|
-
```
|
|
49
|
-
|
|
50
|
-
It's ready to go. Launch your TypeScript IDE.
|
|
51
|
-
|
|
52
|
-
### Plugin options
|
|
53
|
-
|
|
54
|
-
```ts
|
|
55
|
-
type PluginOptions = {
|
|
56
|
-
name: "typescript-eslint-language-service";
|
|
57
|
-
watchDirs?: string[];
|
|
58
|
-
};
|
|
59
|
-
```
|
|
60
|
-
|
|
61
|
-
#### `watchDirs`
|
|
62
|
-
|
|
63
|
-
By default, this plugins watches only `.eslintrc.*` files that exist in your project root directory. If you want to watch other directories, add their names.
|
|
64
|
-
|
|
65
|
-
### Tips
|
|
66
|
-
|
|
67
|
-
- Set `TS_ESLINT_SERVICE_DISABLED` env parameter and restart your IDE to turn this plugin off.
|
|
68
|
-
|
|
69
|
-
### If you use older version of `@typescript-eslint` packages
|
|
70
|
-
|
|
71
|
-
- **If your @typescript-eslint tool's version is < 4.0.0, install `typescript-eslint-language-service@3.1.x`.**
|
|
72
|
-
- **If your @typescript-eslint tool's version is <= 3.4.0, install `typescript-eslint-language-service@3.0.x`.**
|
|
73
|
-
- **If your @typescript-eslint tool's version is <= 2.x.x, install `typescript-eslint-language-service@2.x.x`.**
|
|
74
|
-
|
|
75
|
-
## LICENSE
|
|
76
|
-
|
|
77
|
-
MIT
|