@ionic/angular 7.6.2-dev.11702924017.193c825c → 7.6.2-dev.11702954699.17da50be
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/LICENSE +21 -0
- package/directives/control-value-accessors/index.d.ts +1 -0
- package/directives/control-value-accessors/radio-value-accessor.d.ts +9 -0
- package/directives/proxies-list.d.ts +1 -1
- package/directives/proxies.d.ts +7 -39
- 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 +7 -7
- 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 +2 -1
- package/esm2020/directives/control-value-accessors/numeric-value-accessor.mjs +4 -4
- package/esm2020/directives/control-value-accessors/radio-value-accessor.mjs +42 -0
- 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 +4 -4
- package/esm2020/directives/navigation/ion-tabs.mjs +4 -4
- 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 +1 -4
- package/esm2020/directives/proxies.mjs +237 -314
- package/esm2020/directives/validators/max-validator.mjs +4 -4
- package/esm2020/directives/validators/min-validator.mjs +4 -4
- package/esm2020/index.mjs +2 -1
- package/esm2020/ionic-module.mjs +10 -7
- 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 +4 -7
- 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 +2 -1
- package/esm2020/standalone/directives/input.mjs +4 -4
- package/esm2020/standalone/directives/proxies.mjs +201 -316
- package/esm2020/standalone/directives/radio-group.mjs +4 -4
- package/esm2020/standalone/directives/radio.mjs +62 -0
- 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 +4 -4
- package/esm2020/standalone/navigation/tabs.mjs +4 -4
- 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 +5 -8
- package/esm2020/standalone/providers/toast-controller.mjs +4 -4
- package/fesm2015/ionic-angular-common.mjs +47 -47
- package/fesm2015/ionic-angular-common.mjs.map +1 -1
- package/fesm2015/ionic-angular-standalone.mjs +412 -471
- package/fesm2015/ionic-angular-standalone.mjs.map +1 -1
- package/fesm2015/ionic-angular.mjs +352 -391
- package/fesm2015/ionic-angular.mjs.map +1 -1
- package/fesm2020/ionic-angular-common.mjs +47 -47
- package/fesm2020/ionic-angular-common.mjs.map +1 -1
- package/fesm2020/ionic-angular-standalone.mjs +412 -471
- package/fesm2020/ionic-angular-standalone.mjs.map +1 -1
- package/fesm2020/ionic-angular.mjs +352 -391
- package/fesm2020/ionic-angular.mjs.map +1 -1
- package/index.d.ts +1 -0
- package/ionic-module.d.ts +12 -11
- package/package.json +2 -2
- package/providers/picker-controller.d.ts +1 -4
- package/standalone/directives/index.d.ts +1 -0
- package/standalone/directives/proxies.d.ts +7 -56
- package/standalone/directives/radio.d.ts +22 -0
- package/standalone/index.d.ts +1 -1
- package/standalone/providers/picker-controller.d.ts +1 -4
- package/test/apps/ng14/node_modules/@angular/animations/README.md +8 -0
- package/test/apps/ng14/node_modules/@angular/cli/README.md +5 -0
- package/test/apps/ng14/node_modules/@angular/common/README.md +8 -0
- package/test/apps/ng14/node_modules/@angular/compiler/README.md +8 -0
- package/test/apps/ng14/node_modules/@angular/core/README.md +8 -0
- package/test/apps/ng14/node_modules/@angular/forms/README.md +8 -0
- package/test/apps/ng14/node_modules/@angular/platform-browser/README.md +8 -0
- package/test/apps/ng14/node_modules/@angular/platform-browser-dynamic/README.md +8 -0
- package/test/apps/ng14/node_modules/@angular/platform-server/README.md +8 -0
- package/test/apps/ng14/node_modules/@angular/router/README.md +8 -0
- package/test/apps/ng14/node_modules/@angular-devkit/build-angular/README.md +20 -0
- package/test/apps/ng14/node_modules/@angular-eslint/builder/README.md +1 -0
- package/test/apps/ng14/node_modules/@angular-eslint/eslint-plugin/README.md +1 -0
- package/test/apps/ng14/node_modules/@angular-eslint/eslint-plugin-template/README.md +1 -0
- package/test/apps/ng14/node_modules/@angular-eslint/schematics/README.md +1 -0
- package/test/apps/ng14/node_modules/@angular-eslint/template-parser/README.md +1 -0
- package/test/apps/ng14/node_modules/@ionic/angular/README.md +74 -0
- package/test/apps/ng14/node_modules/@nguniversal/builders/README.md +76 -0
- package/test/apps/ng14/node_modules/@types/express/README.md +15 -0
- package/test/apps/ng14/node_modules/@types/node/README.md +16 -0
- package/test/apps/ng14/node_modules/@typescript-eslint/eslint-plugin/README.md +10 -0
- package/test/apps/ng14/node_modules/@typescript-eslint/parser/README.md +10 -0
- package/test/apps/ng14/node_modules/concurrently/README.md +315 -0
- package/test/apps/ng14/node_modules/core-js/README.md +2307 -0
- package/test/apps/ng14/node_modules/cypress/README.md +25 -0
- package/test/apps/ng14/node_modules/eslint/README.md +308 -0
- package/test/apps/ng14/node_modules/rxjs/README.md +107 -0
- package/test/apps/ng14/node_modules/ts-loader/README.md +731 -0
- package/test/apps/ng14/node_modules/ts-node/README.md +302 -0
- package/test/apps/ng14/node_modules/tslib/README.md +164 -0
- package/test/apps/ng14/node_modules/typescript/README.md +104 -0
- package/test/apps/ng14/node_modules/typescript-eslint-language-service/README.md +77 -0
- package/test/apps/ng14/node_modules/wait-on/README.md +297 -0
- package/test/apps/ng14/node_modules/webpack/README.md +721 -0
- package/test/apps/ng14/node_modules/webpack-cli/README.md +147 -0
- package/test/apps/ng14/node_modules/zone.js/README.md +141 -0
- package/test/apps/ng15/node_modules/@angular/animations/README.md +8 -0
- package/test/apps/ng15/node_modules/@angular/cli/README.md +5 -0
- package/test/apps/ng15/node_modules/@angular/common/README.md +8 -0
- package/test/apps/ng15/node_modules/@angular/compiler/README.md +8 -0
- package/test/apps/ng15/node_modules/@angular/core/README.md +8 -0
- package/test/apps/ng15/node_modules/@angular/forms/README.md +8 -0
- package/test/apps/ng15/node_modules/@angular/platform-browser/README.md +8 -0
- package/test/apps/ng15/node_modules/@angular/platform-browser-dynamic/README.md +8 -0
- package/test/apps/ng15/node_modules/@angular/platform-server/README.md +8 -0
- package/test/apps/ng15/node_modules/@angular/router/README.md +8 -0
- package/test/apps/ng15/node_modules/@angular-devkit/build-angular/README.md +20 -0
- package/test/apps/ng15/node_modules/@angular-eslint/builder/README.md +1 -0
- package/test/apps/ng15/node_modules/@angular-eslint/eslint-plugin/README.md +1 -0
- package/test/apps/ng15/node_modules/@angular-eslint/eslint-plugin-template/README.md +1 -0
- package/test/apps/ng15/node_modules/@angular-eslint/schematics/README.md +1 -0
- package/test/apps/ng15/node_modules/@angular-eslint/template-parser/README.md +1 -0
- package/test/apps/ng15/node_modules/@ionic/angular/README.md +74 -0
- package/test/apps/ng15/node_modules/@nguniversal/builders/README.md +76 -0
- package/test/apps/ng15/node_modules/@nguniversal/express-engine/README.md +118 -0
- package/test/apps/ng15/node_modules/@types/express/README.md +15 -0
- package/test/apps/ng15/node_modules/@types/node/README.md +16 -0
- package/test/apps/ng15/node_modules/@typescript-eslint/eslint-plugin/README.md +234 -0
- package/test/apps/ng15/node_modules/@typescript-eslint/parser/README.md +265 -0
- package/test/apps/ng15/node_modules/concurrently/README.md +315 -0
- package/test/apps/ng15/node_modules/core-js/README.md +2307 -0
- package/test/apps/ng15/node_modules/cypress/README.md +25 -0
- package/test/apps/ng15/node_modules/eslint/README.md +308 -0
- package/test/apps/ng15/node_modules/rxjs/README.md +107 -0
- package/test/apps/ng15/node_modules/ts-loader/README.md +731 -0
- package/test/apps/ng15/node_modules/ts-node/README.md +302 -0
- package/test/apps/ng15/node_modules/tslib/README.md +164 -0
- package/test/apps/ng15/node_modules/typescript/README.md +104 -0
- package/test/apps/ng15/node_modules/typescript-eslint-language-service/README.md +77 -0
- package/test/apps/ng15/node_modules/wait-on/README.md +297 -0
- package/test/apps/ng15/node_modules/webpack/README.md +721 -0
- package/test/apps/ng15/node_modules/webpack-cli/README.md +147 -0
- package/test/apps/ng15/node_modules/zone.js/README.md +141 -0
- package/test/apps/ng16/node_modules/@angular/animations/README.md +8 -0
- package/test/apps/ng16/node_modules/@angular/cli/README.md +5 -0
- package/test/apps/ng16/node_modules/@angular/common/README.md +8 -0
- package/test/apps/ng16/node_modules/@angular/compiler/README.md +8 -0
- package/test/apps/ng16/node_modules/@angular/core/README.md +8 -0
- package/test/apps/ng16/node_modules/@angular/forms/README.md +8 -0
- package/test/apps/ng16/node_modules/@angular/platform-browser/README.md +8 -0
- package/test/apps/ng16/node_modules/@angular/platform-browser-dynamic/README.md +8 -0
- package/test/apps/ng16/node_modules/@angular/platform-server/README.md +8 -0
- package/test/apps/ng16/node_modules/@angular/router/README.md +8 -0
- package/test/apps/ng16/node_modules/@angular-devkit/build-angular/README.md +20 -0
- package/test/apps/ng16/node_modules/@angular-eslint/builder/README.md +1 -0
- package/test/apps/ng16/node_modules/@angular-eslint/eslint-plugin/README.md +84 -0
- package/test/apps/ng16/node_modules/@angular-eslint/eslint-plugin-template/README.md +93 -0
- package/test/apps/ng16/node_modules/@angular-eslint/schematics/README.md +1 -0
- package/test/apps/ng16/node_modules/@angular-eslint/template-parser/README.md +1 -0
- package/test/apps/ng16/node_modules/@ionic/angular/README.md +74 -0
- package/test/apps/ng16/node_modules/@nguniversal/builders/README.md +76 -0
- package/test/apps/ng16/node_modules/@nguniversal/express-engine/README.md +118 -0
- package/test/apps/ng16/node_modules/@types/express/README.md +15 -0
- package/test/apps/ng16/node_modules/@types/node/README.md +16 -0
- package/test/apps/ng16/node_modules/@typescript-eslint/eslint-plugin/README.md +234 -0
- package/test/apps/ng16/node_modules/@typescript-eslint/parser/README.md +265 -0
- package/test/apps/ng16/node_modules/concurrently/README.md +315 -0
- package/test/apps/ng16/node_modules/core-js/README.md +2307 -0
- package/test/apps/ng16/node_modules/cypress/README.md +25 -0
- package/test/apps/ng16/node_modules/eslint/README.md +308 -0
- package/test/apps/ng16/node_modules/rxjs/README.md +107 -0
- package/test/apps/ng16/node_modules/ts-loader/README.md +731 -0
- package/test/apps/ng16/node_modules/ts-node/README.md +302 -0
- package/test/apps/ng16/node_modules/tslib/README.md +164 -0
- package/test/apps/ng16/node_modules/typescript/README.md +49 -0
- package/test/apps/ng16/node_modules/typescript-eslint-language-service/README.md +77 -0
- package/test/apps/ng16/node_modules/wait-on/README.md +297 -0
- package/test/apps/ng16/node_modules/webpack/README.md +721 -0
- package/test/apps/ng16/node_modules/webpack-cli/README.md +147 -0
- package/test/apps/ng16/node_modules/zone.js/README.md +141 -0
- package/test/apps/ng17/node_modules/@angular/animations/README.md +8 -0
- package/test/apps/ng17/node_modules/@angular/cli/README.md +5 -0
- package/test/apps/ng17/node_modules/@angular/common/README.md +8 -0
- package/test/apps/ng17/node_modules/@angular/compiler/README.md +8 -0
- package/test/apps/ng17/node_modules/@angular/core/README.md +8 -0
- package/test/apps/ng17/node_modules/@angular/forms/README.md +8 -0
- package/test/apps/ng17/node_modules/@angular/platform-browser/README.md +8 -0
- package/test/apps/ng17/node_modules/@angular/platform-browser-dynamic/README.md +8 -0
- package/test/apps/ng17/node_modules/@angular/platform-server/README.md +8 -0
- package/test/apps/ng17/node_modules/@angular/router/README.md +8 -0
- package/test/apps/ng17/node_modules/@angular-devkit/build-angular/README.md +24 -0
- package/test/apps/ng17/node_modules/@angular-eslint/builder/README.md +1 -0
- package/test/apps/ng17/node_modules/@angular-eslint/eslint-plugin/README.md +84 -0
- package/test/apps/ng17/node_modules/@angular-eslint/eslint-plugin-template/README.md +94 -0
- package/test/apps/ng17/node_modules/@angular-eslint/schematics/README.md +1 -0
- package/test/apps/ng17/node_modules/@angular-eslint/template-parser/README.md +1 -0
- package/test/apps/ng17/node_modules/@ionic/angular/README.md +74 -0
- package/test/apps/ng17/node_modules/@types/express/README.md +15 -0
- package/test/apps/ng17/node_modules/@types/ws/README.md +16 -0
- package/test/apps/ng17/node_modules/@typescript-eslint/eslint-plugin/README.md +12 -0
- package/test/apps/ng17/node_modules/@typescript-eslint/parser/README.md +12 -0
- package/test/apps/ng17/node_modules/concurrently/README.md +315 -0
- package/test/apps/ng17/node_modules/core-js/README.md +95 -0
- package/test/apps/ng17/node_modules/cypress/README.md +25 -0
- package/test/apps/ng17/node_modules/eslint/README.md +308 -0
- package/test/apps/ng17/node_modules/rxjs/README.md +107 -0
- package/test/apps/ng17/node_modules/ts-loader/README.md +731 -0
- package/test/apps/ng17/node_modules/ts-node/README.md +302 -0
- package/test/apps/ng17/node_modules/tslib/README.md +164 -0
- package/test/apps/ng17/node_modules/typescript/README.md +51 -0
- package/test/apps/ng17/node_modules/typescript-eslint-language-service/README.md +77 -0
- package/test/apps/ng17/node_modules/wait-on/README.md +297 -0
- package/test/apps/ng17/node_modules/webpack/README.md +721 -0
- package/test/apps/ng17/node_modules/webpack-cli/README.md +147 -0
- package/test/apps/ng17/node_modules/zone.js/README.md +141 -0
|
@@ -0,0 +1,265 @@
|
|
|
1
|
+
<h1 align="center">TypeScript ESLint Parser</h1>
|
|
2
|
+
|
|
3
|
+
<p align="center">An ESLint parser which leverages <a href="https://github.com/typescript-eslint/typescript-eslint/tree/master/packages/typescript-estree">TypeScript ESTree</a> to allow for ESLint to lint TypeScript source code.</p>
|
|
4
|
+
|
|
5
|
+
<p align="center">
|
|
6
|
+
<img src="https://github.com/typescript-eslint/typescript-eslint/workflows/CI/badge.svg" alt="CI" />
|
|
7
|
+
<a href="https://www.npmjs.com/package/@typescript-eslint/parser"><img src="https://img.shields.io/npm/v/@typescript-eslint/parser.svg?style=flat-square" alt="NPM Version" /></a>
|
|
8
|
+
<a href="https://www.npmjs.com/package/@typescript-eslint/parser"><img src="https://img.shields.io/npm/dm/@typescript-eslint/parser.svg?style=flat-square" alt="NPM Downloads" /></a>
|
|
9
|
+
</p>
|
|
10
|
+
|
|
11
|
+
## Getting Started
|
|
12
|
+
|
|
13
|
+
**[You can find our Getting Started docs here](../../docs/getting-started/linting/README.md)**
|
|
14
|
+
|
|
15
|
+
These docs walk you through setting up ESLint, this parser, and our plugin. If you know what you're doing and just want to quick start, read on...
|
|
16
|
+
|
|
17
|
+
## Quick-start
|
|
18
|
+
|
|
19
|
+
### Installation
|
|
20
|
+
|
|
21
|
+
```bash
|
|
22
|
+
$ yarn add -D typescript @typescript-eslint/parser
|
|
23
|
+
$ npm i --save-dev typescript @typescript-eslint/parser
|
|
24
|
+
```
|
|
25
|
+
|
|
26
|
+
### Usage
|
|
27
|
+
|
|
28
|
+
In your ESLint configuration file, set the `parser` property:
|
|
29
|
+
|
|
30
|
+
```json
|
|
31
|
+
{
|
|
32
|
+
"parser": "@typescript-eslint/parser"
|
|
33
|
+
}
|
|
34
|
+
```
|
|
35
|
+
|
|
36
|
+
There is sometimes an incorrect assumption that the parser itself is what does everything necessary to facilitate the use of ESLint with TypeScript. In actuality, it is the combination of the parser _and_ one or more plugins which allow you to maximize your usage of ESLint with TypeScript.
|
|
37
|
+
|
|
38
|
+
For example, once this parser successfully produces an AST for the TypeScript source code, it might well contain some information which simply does not exist in a standard JavaScript context, such as the data for a TypeScript-specific construct, like an `interface`.
|
|
39
|
+
|
|
40
|
+
The core rules built into ESLint, such as `indent` have no knowledge of such constructs, so it is impossible to expect them to work out of the box with them.
|
|
41
|
+
|
|
42
|
+
Instead, you also need to make use of one more plugins which will add or extend rules with TypeScript-specific features.
|
|
43
|
+
|
|
44
|
+
By far the most common case will be installing the [`@typescript-eslint/eslint-plugin`](https://github.com/typescript-eslint/typescript-eslint/tree/master/packages/eslint-plugin) plugin, but there are also other relevant options available such a [`@typescript-eslint/eslint-plugin-tslint`](https://github.com/typescript-eslint/typescript-eslint/tree/master/packages/eslint-plugin-tslint).
|
|
45
|
+
|
|
46
|
+
## Configuration
|
|
47
|
+
|
|
48
|
+
The following additional configuration options are available by specifying them in [`parserOptions`](https://eslint.org/docs/user-guide/configuring/language-options#specifying-parser-options) in your ESLint configuration file.
|
|
49
|
+
|
|
50
|
+
```ts
|
|
51
|
+
interface ParserOptions {
|
|
52
|
+
ecmaFeatures?: {
|
|
53
|
+
jsx?: boolean;
|
|
54
|
+
globalReturn?: boolean;
|
|
55
|
+
};
|
|
56
|
+
ecmaVersion?: number;
|
|
57
|
+
|
|
58
|
+
jsxPragma?: string;
|
|
59
|
+
jsxFragmentName?: string | null;
|
|
60
|
+
lib?: string[];
|
|
61
|
+
|
|
62
|
+
project?: string | string[];
|
|
63
|
+
projectFolderIgnoreList?: string[];
|
|
64
|
+
tsconfigRootDir?: string;
|
|
65
|
+
extraFileExtensions?: string[];
|
|
66
|
+
warnOnUnsupportedTypeScriptVersion?: boolean;
|
|
67
|
+
|
|
68
|
+
program?: import('typescript').Program;
|
|
69
|
+
}
|
|
70
|
+
```
|
|
71
|
+
|
|
72
|
+
### `parserOptions.ecmaFeatures.jsx`
|
|
73
|
+
|
|
74
|
+
Default `false`.
|
|
75
|
+
|
|
76
|
+
Enable parsing JSX when `true`. More details can be found [here](https://www.typescriptlang.org/docs/handbook/jsx.html).
|
|
77
|
+
|
|
78
|
+
**NOTE:** this setting does not affect known file types (`.js`, `.jsx`, `.ts`, `.tsx`, `.json`) because the TypeScript compiler has its own internal handling for known file extensions. The exact behavior is as follows:
|
|
79
|
+
|
|
80
|
+
- if `parserOptions.project` is _not_ provided:
|
|
81
|
+
- `.js`, `.jsx`, `.tsx` files are parsed as if this is true.
|
|
82
|
+
- `.ts` files are parsed as if this is false.
|
|
83
|
+
- unknown extensions (`.md`, `.vue`) will respect this setting.
|
|
84
|
+
- if `parserOptions.project` is provided (i.e. you are using rules with type information):
|
|
85
|
+
- `.js`, `.jsx`, `.tsx` files are parsed as if this is true.
|
|
86
|
+
- `.ts` files are parsed as if this is false.
|
|
87
|
+
- "unknown" extensions (`.md`, `.vue`) **are parsed as if this is false**.
|
|
88
|
+
|
|
89
|
+
### `parserOptions.ecmaFeatures.globalReturn`
|
|
90
|
+
|
|
91
|
+
Default `false`.
|
|
92
|
+
|
|
93
|
+
This options allows you to tell the parser if you want to allow global `return` statements in your codebase.
|
|
94
|
+
|
|
95
|
+
### `parserOptions.ecmaVersion`
|
|
96
|
+
|
|
97
|
+
Default `2018`.
|
|
98
|
+
|
|
99
|
+
Accepts any valid ECMAScript version number:
|
|
100
|
+
|
|
101
|
+
- A version: es3, es5, es6, es7, es8, es9, es10, es11, ..., or
|
|
102
|
+
- A year: es2015, es2016, es2017, es2018, es2019, es2020, ...
|
|
103
|
+
|
|
104
|
+
The value **must** be a number - so do not include the `es` prefix.
|
|
105
|
+
|
|
106
|
+
Specifies the version of ECMAScript syntax you want to use. This is used by the parser to determine how to perform scope analysis, and it affects the default
|
|
107
|
+
|
|
108
|
+
### `parserOptions.jsxPragma`
|
|
109
|
+
|
|
110
|
+
Default `'React'`
|
|
111
|
+
|
|
112
|
+
The identifier that's used for JSX Elements creation (after transpilation).
|
|
113
|
+
If you're using a library other than React (like `preact`), then you should change this value.
|
|
114
|
+
|
|
115
|
+
This should not be a member expression - just the root identifier (i.e. use `"React"` instead of `"React.createElement"`).
|
|
116
|
+
|
|
117
|
+
If you provide `parserOptions.project`, you do not need to set this, as it will automatically detected from the compiler.
|
|
118
|
+
|
|
119
|
+
### `parserOptions.jsxFragmentName`
|
|
120
|
+
|
|
121
|
+
Default `null`
|
|
122
|
+
|
|
123
|
+
The identifier that's used for JSX fragment elements (after transpilation).
|
|
124
|
+
If `null`, assumes transpilation will always use a member of the configured `jsxPragma`.
|
|
125
|
+
This should not be a member expression - just the root identifier (i.e. use `"h"` instead of `"h.Fragment"`).
|
|
126
|
+
|
|
127
|
+
If you provide `parserOptions.project`, you do not need to set this, as it will automatically detected from the compiler.
|
|
128
|
+
|
|
129
|
+
### `parserOptions.lib`
|
|
130
|
+
|
|
131
|
+
Default `['es2018']`
|
|
132
|
+
|
|
133
|
+
For valid options, see the [TypeScript compiler options](https://www.typescriptlang.org/tsconfig#lib).
|
|
134
|
+
|
|
135
|
+
Specifies the TypeScript `lib`s that are available. This is used by the scope analyser to ensure there are global variables declared for the types exposed by TypeScript.
|
|
136
|
+
|
|
137
|
+
If you provide `parserOptions.project`, you do not need to set this, as it will automatically detected from the compiler.
|
|
138
|
+
|
|
139
|
+
### `parserOptions.project`
|
|
140
|
+
|
|
141
|
+
Default `undefined`.
|
|
142
|
+
|
|
143
|
+
This option allows you to provide a path to your project's `tsconfig.json`. **This setting is required if you want to use rules which require type information**. Relative paths are interpreted relative to the current working directory if `tsconfigRootDir` is not set. If you intend on running ESLint from directories other than the project root, you should consider using `tsconfigRootDir`.
|
|
144
|
+
|
|
145
|
+
- Accepted values:
|
|
146
|
+
|
|
147
|
+
```js
|
|
148
|
+
// path
|
|
149
|
+
project: './tsconfig.json';
|
|
150
|
+
|
|
151
|
+
// glob pattern
|
|
152
|
+
project: './packages/**/tsconfig.json';
|
|
153
|
+
|
|
154
|
+
// array of paths and/or glob patterns
|
|
155
|
+
project: ['./packages/**/tsconfig.json', './separate-package/tsconfig.json'];
|
|
156
|
+
```
|
|
157
|
+
|
|
158
|
+
- If you use project references, TypeScript will not automatically use project references to resolve files. This means that you will have to add each referenced tsconfig to the `project` field either separately, or via a glob.
|
|
159
|
+
|
|
160
|
+
- TypeScript will ignore files with duplicate filenames in the same folder (for example, `src/file.ts` and `src/file.js`). TypeScript purposely ignore all but one of the files, only keeping the one file with the highest priority extension (the extension priority order (from highest to lowest) is `.ts`, `.tsx`, `.d.ts`, `.js`, `.jsx`). For more info see #955.
|
|
161
|
+
|
|
162
|
+
- Note that if this setting is specified and `createDefaultProgram` is not, you must only lint files that are included in the projects as defined by the provided `tsconfig.json` files. If your existing configuration does not include all of the files you would like to lint, you can create a separate `tsconfig.eslint.json` as follows:
|
|
163
|
+
|
|
164
|
+
```jsonc
|
|
165
|
+
{
|
|
166
|
+
// extend your base config so you don't have to redefine your compilerOptions
|
|
167
|
+
"extends": "./tsconfig.json",
|
|
168
|
+
"include": [
|
|
169
|
+
"src/**/*.ts",
|
|
170
|
+
"test/**/*.ts",
|
|
171
|
+
"typings/**/*.ts",
|
|
172
|
+
// etc
|
|
173
|
+
|
|
174
|
+
// if you have a mixed JS/TS codebase, don't forget to include your JS files
|
|
175
|
+
"src/**/*.js"
|
|
176
|
+
]
|
|
177
|
+
}
|
|
178
|
+
```
|
|
179
|
+
|
|
180
|
+
### `parserOptions.tsconfigRootDir`
|
|
181
|
+
|
|
182
|
+
Default `undefined`.
|
|
183
|
+
|
|
184
|
+
This option allows you to provide the root directory for relative tsconfig paths specified in the `project` option above.
|
|
185
|
+
|
|
186
|
+
### `parserOptions.projectFolderIgnoreList`
|
|
187
|
+
|
|
188
|
+
Default `["**/node_modules/**"]`.
|
|
189
|
+
|
|
190
|
+
This option allows you to ignore folders from being included in your provided list of `project`s.
|
|
191
|
+
This is useful if you have configured glob patterns, but want to make sure you ignore certain folders.
|
|
192
|
+
|
|
193
|
+
It accepts an array of globs to exclude from the `project` globs.
|
|
194
|
+
|
|
195
|
+
For example, by default it will ensure that a glob like `./**/tsconfig.json` will not match any `tsconfig`s within your `node_modules` folder (some npm packages do not exclude their source files from their published packages).
|
|
196
|
+
|
|
197
|
+
### `parserOptions.extraFileExtensions`
|
|
198
|
+
|
|
199
|
+
Default `undefined`.
|
|
200
|
+
|
|
201
|
+
This option allows you to provide one or more additional file extensions which should be considered in the TypeScript Program compilation.
|
|
202
|
+
The default extensions are `.ts`, `.tsx`, `.js`, and `.jsx`. Add extensions starting with `.`, followed by the file extension. E.g. for a `.vue` file use `"extraFileExtensions: [".vue"]`.
|
|
203
|
+
|
|
204
|
+
### `parserOptions.warnOnUnsupportedTypeScriptVersion`
|
|
205
|
+
|
|
206
|
+
Default `true`.
|
|
207
|
+
|
|
208
|
+
This option allows you to toggle the warning that the parser will give you if you use a version of TypeScript which is not explicitly supported
|
|
209
|
+
|
|
210
|
+
### `parserOptions.createDefaultProgram`
|
|
211
|
+
|
|
212
|
+
Default `false`.
|
|
213
|
+
|
|
214
|
+
This option allows you to request that when the `project` setting is specified, files will be allowed when not included in the projects defined by the provided `tsconfig.json` files. **Using this option will incur significant performance costs. This option is primarily included for backwards-compatibility.** See the **`project`** section above for more information.
|
|
215
|
+
|
|
216
|
+
### `parserOptions.programs`
|
|
217
|
+
|
|
218
|
+
Default `undefined`.
|
|
219
|
+
|
|
220
|
+
This option allows you to programmatically provide an array of one or more instances of a TypeScript Program object that will provide type information to rules.
|
|
221
|
+
This will override any programs that would have been computed from `parserOptions.project` or `parserOptions.createDefaultProgram`.
|
|
222
|
+
All linted files must be part of the provided program(s).
|
|
223
|
+
|
|
224
|
+
## Utilities
|
|
225
|
+
|
|
226
|
+
### `createProgram(configFile, projectDirectory)`
|
|
227
|
+
|
|
228
|
+
This serves as a utility method for users of the `parserOptions.programs` feature to create a TypeScript program instance from a config file.
|
|
229
|
+
|
|
230
|
+
```ts
|
|
231
|
+
declare function createProgram(
|
|
232
|
+
configFile: string,
|
|
233
|
+
projectDirectory?: string,
|
|
234
|
+
): import('typescript').Program;
|
|
235
|
+
```
|
|
236
|
+
|
|
237
|
+
Example usage in .eslintrc.js:
|
|
238
|
+
|
|
239
|
+
```js
|
|
240
|
+
const parser = require('@typescript-eslint/parser');
|
|
241
|
+
const programs = [parser.createProgram('tsconfig.json')];
|
|
242
|
+
module.exports = {
|
|
243
|
+
parserOptions: {
|
|
244
|
+
programs,
|
|
245
|
+
},
|
|
246
|
+
};
|
|
247
|
+
```
|
|
248
|
+
|
|
249
|
+
## Supported TypeScript Version
|
|
250
|
+
|
|
251
|
+
Please see [`typescript-eslint`](https://github.com/typescript-eslint/typescript-eslint) for the supported TypeScript version.
|
|
252
|
+
|
|
253
|
+
**Please ensure that you are using a supported version before submitting any issues/bug reports.**
|
|
254
|
+
|
|
255
|
+
## Reporting Issues
|
|
256
|
+
|
|
257
|
+
Please use the `@typescript-eslint/parser` issue template when creating your issue and fill out the information requested as best you can. This will really help us when looking into your issue.
|
|
258
|
+
|
|
259
|
+
## License
|
|
260
|
+
|
|
261
|
+
TypeScript ESLint Parser is licensed under a permissive BSD 2-clause license.
|
|
262
|
+
|
|
263
|
+
## Contributing
|
|
264
|
+
|
|
265
|
+
[See the contributing guide here](../../CONTRIBUTING.md)
|
|
@@ -0,0 +1,315 @@
|
|
|
1
|
+
# Concurrently
|
|
2
|
+
|
|
3
|
+
[](https://github.com/open-cli-tools/concurrently/actions?workflow=Tests)
|
|
4
|
+
[](https://coveralls.io/github/open-cli-tools/concurrently?branch=master)
|
|
5
|
+
|
|
6
|
+
[](https://www.npmjs.com/package/concurrently)
|
|
7
|
+
|
|
8
|
+
Run multiple commands concurrently.
|
|
9
|
+
Like `npm run watch-js & npm run watch-less` but better.
|
|
10
|
+
|
|
11
|
+

|
|
12
|
+
|
|
13
|
+
**Table of contents**
|
|
14
|
+
- [Concurrently](#concurrently)
|
|
15
|
+
- [Why](#why)
|
|
16
|
+
- [Install](#install)
|
|
17
|
+
- [Usage](#usage)
|
|
18
|
+
- [Programmatic Usage](#programmatic-usage)
|
|
19
|
+
- [`concurrently(commands[, options])`](#concurrentlycommands-options)
|
|
20
|
+
- [FAQ](#faq)
|
|
21
|
+
|
|
22
|
+
## Why
|
|
23
|
+
|
|
24
|
+
I like [task automation with npm](https://github.com/substack/blog/blob/master/npm_run.markdown)
|
|
25
|
+
but the usual way to run multiple commands concurrently is
|
|
26
|
+
`npm run watch-js & npm run watch-css`. That's fine but it's hard to keep
|
|
27
|
+
on track of different outputs. Also if one process fails, others still keep running
|
|
28
|
+
and you won't even notice the difference.
|
|
29
|
+
|
|
30
|
+
Another option would be to just run all commands in separate terminals. I got
|
|
31
|
+
tired of opening terminals and made **concurrently**.
|
|
32
|
+
|
|
33
|
+
**Features:**
|
|
34
|
+
|
|
35
|
+
* Cross platform (including Windows)
|
|
36
|
+
* Output is easy to follow with prefixes
|
|
37
|
+
* With `--kill-others` switch, all commands are killed if one dies
|
|
38
|
+
* Spawns commands with [spawn-command](https://github.com/mmalecki/spawn-command)
|
|
39
|
+
|
|
40
|
+
## Install
|
|
41
|
+
|
|
42
|
+
The tool is written in Node.js, but you can use it to run **any** commands.
|
|
43
|
+
|
|
44
|
+
```bash
|
|
45
|
+
npm install -g concurrently
|
|
46
|
+
```
|
|
47
|
+
|
|
48
|
+
or if you are using it from npm scripts:
|
|
49
|
+
|
|
50
|
+
```bash
|
|
51
|
+
npm install concurrently --save
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
## Usage
|
|
55
|
+
|
|
56
|
+
Remember to surround separate commands with quotes:
|
|
57
|
+
```bash
|
|
58
|
+
concurrently "command1 arg" "command2 arg"
|
|
59
|
+
```
|
|
60
|
+
|
|
61
|
+
Otherwise **concurrently** would try to run 4 separate commands:
|
|
62
|
+
`command1`, `arg`, `command2`, `arg`.
|
|
63
|
+
|
|
64
|
+
In package.json, escape quotes:
|
|
65
|
+
|
|
66
|
+
```bash
|
|
67
|
+
"start": "concurrently \"command1 arg\" \"command2 arg\""
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
NPM run commands can be shortened:
|
|
71
|
+
|
|
72
|
+
```bash
|
|
73
|
+
concurrently "npm:watch-js" "npm:watch-css" "npm:watch-node"
|
|
74
|
+
|
|
75
|
+
# Equivalent to:
|
|
76
|
+
concurrently -n watch-js,watch-css,watch-node "npm run watch-js" "npm run watch-css" "npm run watch-node"
|
|
77
|
+
```
|
|
78
|
+
|
|
79
|
+
NPM shortened commands also support wildcards. Given the following scripts in
|
|
80
|
+
package.json:
|
|
81
|
+
|
|
82
|
+
```javascript
|
|
83
|
+
{
|
|
84
|
+
//...
|
|
85
|
+
"scripts": {
|
|
86
|
+
// ...
|
|
87
|
+
"watch-js": "...",
|
|
88
|
+
"watch-css": "...",
|
|
89
|
+
"watch-node": "...",
|
|
90
|
+
// ...
|
|
91
|
+
},
|
|
92
|
+
// ...
|
|
93
|
+
}
|
|
94
|
+
```
|
|
95
|
+
|
|
96
|
+
```bash
|
|
97
|
+
concurrently "npm:watch-*"
|
|
98
|
+
|
|
99
|
+
# Equivalent to:
|
|
100
|
+
concurrently -n js,css,node "npm run watch-js" "npm run watch-css" "npm run watch-node"
|
|
101
|
+
|
|
102
|
+
# Any name provided for the wildcard command will be used as a prefix to the wildcard
|
|
103
|
+
# part of the script name:
|
|
104
|
+
concurrently -n w: npm:watch-*
|
|
105
|
+
|
|
106
|
+
# Equivalent to:
|
|
107
|
+
concurrently -n w:js,w:css,w:node "npm run watch-js" "npm run watch-css" "npm run watch-node"
|
|
108
|
+
```
|
|
109
|
+
|
|
110
|
+
Good frontend one-liner example [here](https://github.com/kimmobrunfeldt/dont-copy-paste-this-frontend-template/blob/5cd2bde719654941bdfc0a42c6f1b8e69ae79980/package.json#L9).
|
|
111
|
+
|
|
112
|
+
Help:
|
|
113
|
+
|
|
114
|
+
```
|
|
115
|
+
|
|
116
|
+
concurrently [options] <command ...>
|
|
117
|
+
|
|
118
|
+
General
|
|
119
|
+
-m, --max-processes How many processes should run at once.
|
|
120
|
+
New processes only spawn after all restart tries of a
|
|
121
|
+
process. [number]
|
|
122
|
+
-n, --names List of custom names to be used in prefix template.
|
|
123
|
+
Example names: "main,browser,server" [string]
|
|
124
|
+
--name-separator The character to split <names> on. Example usage:
|
|
125
|
+
concurrently -n "styles|scripts|server" --name-separator
|
|
126
|
+
"|" [default: ","]
|
|
127
|
+
-r, --raw Output only raw output of processes, disables
|
|
128
|
+
prettifying and concurrently coloring. [boolean]
|
|
129
|
+
-s, --success Return exit code of zero or one based on the success or
|
|
130
|
+
failure of the "first" child to terminate, the "last
|
|
131
|
+
child", or succeed only if "all" child processes
|
|
132
|
+
succeed.
|
|
133
|
+
[choices: "first", "last", "all"] [default: "all"]
|
|
134
|
+
--no-color Disables colors from logging [boolean]
|
|
135
|
+
--hide Comma-separated list of processes to hide the output.
|
|
136
|
+
The processes can be identified by their name or index.
|
|
137
|
+
[string] [default: ""]
|
|
138
|
+
|
|
139
|
+
Prefix styling
|
|
140
|
+
-p, --prefix Prefix used in logging for each process.
|
|
141
|
+
Possible values: index, pid, time, command, name,
|
|
142
|
+
none, or a template. Example template: "{time}-{pid}"
|
|
143
|
+
[string] [default: index or name (when --names is set)]
|
|
144
|
+
-c, --prefix-colors Comma-separated list of chalk colors to use on
|
|
145
|
+
prefixes. If there are more commands than colors, the
|
|
146
|
+
last color will be repeated.
|
|
147
|
+
- Available modifiers: reset, bold, dim, italic,
|
|
148
|
+
underline, inverse, hidden, strikethrough
|
|
149
|
+
- Available colors: black, red, green, yellow, blue,
|
|
150
|
+
magenta, cyan, white, gray, or any hex values for
|
|
151
|
+
colors, eg #23de43
|
|
152
|
+
- Available background colors: bgBlack, bgRed,
|
|
153
|
+
bgGreen, bgYellow, bgBlue, bgMagenta, bgCyan, bgWhite
|
|
154
|
+
See https://www.npmjs.com/package/chalk for more
|
|
155
|
+
information. [string] [default: "reset"]
|
|
156
|
+
-l, --prefix-length Limit how many characters of the command is displayed
|
|
157
|
+
in prefix. The option can be used to shorten the
|
|
158
|
+
prefix when it is set to "command"
|
|
159
|
+
[number] [default: 10]
|
|
160
|
+
-t, --timestamp-format Specify the timestamp in moment/date-fns format.
|
|
161
|
+
[string] [default: "yyyy-MM-dd HH:mm:ss.SSS"]
|
|
162
|
+
|
|
163
|
+
Input handling
|
|
164
|
+
-i, --handle-input Whether input should be forwarded to the child
|
|
165
|
+
processes. See examples for more information.[boolean]
|
|
166
|
+
--default-input-target Identifier for child process to which input on stdin
|
|
167
|
+
should be sent if not specified at start of input.
|
|
168
|
+
Can be either the index or the name of the process.
|
|
169
|
+
[default: 0]
|
|
170
|
+
|
|
171
|
+
Killing other processes
|
|
172
|
+
-k, --kill-others kill other processes if one exits or dies [boolean]
|
|
173
|
+
--kill-others-on-fail kill other processes if one exits with non zero status
|
|
174
|
+
code [boolean]
|
|
175
|
+
|
|
176
|
+
Restarting
|
|
177
|
+
--restart-tries How many times a process that died should restart.
|
|
178
|
+
Negative numbers will make the process restart forever.
|
|
179
|
+
[number] [default: 0]
|
|
180
|
+
--restart-after Delay time to respawn the process, in milliseconds.
|
|
181
|
+
[number] [default: 0]
|
|
182
|
+
|
|
183
|
+
Options:
|
|
184
|
+
-h, --help Show help [boolean]
|
|
185
|
+
-v, -V, --version Show version number [boolean]
|
|
186
|
+
|
|
187
|
+
Examples:
|
|
188
|
+
|
|
189
|
+
- Output nothing more than stdout+stderr of child processes
|
|
190
|
+
|
|
191
|
+
$ concurrently --raw "npm run watch-less" "npm run watch-js"
|
|
192
|
+
|
|
193
|
+
- Normal output but without colors e.g. when logging to file
|
|
194
|
+
|
|
195
|
+
$ concurrently --no-color "grunt watch" "http-server" > log
|
|
196
|
+
|
|
197
|
+
- Custom prefix
|
|
198
|
+
|
|
199
|
+
$ concurrently --prefix "{time}-{pid}" "npm run watch" "http-server"
|
|
200
|
+
|
|
201
|
+
- Custom names and colored prefixes
|
|
202
|
+
|
|
203
|
+
$ concurrently --names "HTTP,WATCH" -c "bgBlue.bold,bgMagenta.bold"
|
|
204
|
+
"http-server" "npm run watch"
|
|
205
|
+
|
|
206
|
+
- Configuring via environment variables with CONCURRENTLY_ prefix
|
|
207
|
+
|
|
208
|
+
$ CONCURRENTLY_RAW=true CONCURRENTLY_KILL_OTHERS=true concurrently "echo hello" "echo world"
|
|
209
|
+
|
|
210
|
+
- Send input to default
|
|
211
|
+
|
|
212
|
+
$ concurrently --handle-input "nodemon" "npm run watch-js"
|
|
213
|
+
rs # Sends rs command to nodemon process
|
|
214
|
+
|
|
215
|
+
- Send input to specific child identified by index
|
|
216
|
+
|
|
217
|
+
$ concurrently --handle-input "npm run watch-js" nodemon
|
|
218
|
+
1:rs
|
|
219
|
+
|
|
220
|
+
- Send input to specific child identified by name
|
|
221
|
+
|
|
222
|
+
$ concurrently --handle-input -n js,srv "npm run watch-js" nodemon
|
|
223
|
+
srv:rs
|
|
224
|
+
|
|
225
|
+
- Shortened NPM run commands
|
|
226
|
+
|
|
227
|
+
$ concurrently npm:watch-node npm:watch-js npm:watch-css
|
|
228
|
+
|
|
229
|
+
- Shortened NPM run command with wildcard (make sure to wrap it in quotes!)
|
|
230
|
+
|
|
231
|
+
$ concurrently "npm:watch-*"
|
|
232
|
+
|
|
233
|
+
For more details, visit https://github.com/open-cli-tools/concurrently
|
|
234
|
+
```
|
|
235
|
+
|
|
236
|
+
## Programmatic Usage
|
|
237
|
+
concurrently can be used programmatically by using the API documented below:
|
|
238
|
+
|
|
239
|
+
### `concurrently(commands[, options])`
|
|
240
|
+
|
|
241
|
+
- `commands`: an array of either strings (containing the commands to run) or objects
|
|
242
|
+
with the shape `{ command, name, prefixColor, env, cwd }`.
|
|
243
|
+
|
|
244
|
+
- `options` (optional): an object containing any of the below:
|
|
245
|
+
- `cwd`: the working directory to be used by all commands. Can be overriden per command.
|
|
246
|
+
Default: `process.cwd()`.
|
|
247
|
+
- `defaultInputTarget`: the default input target when reading from `inputStream`.
|
|
248
|
+
Default: `0`.
|
|
249
|
+
- `handleInput`: when `true`, reads input from `process.stdin`.
|
|
250
|
+
- `inputStream`: a [`Readable` stream](https://nodejs.org/dist/latest-v10.x/docs/api/stream.html#stream_readable_streams)
|
|
251
|
+
to read the input from. Should only be used in the rare instance you would like to stream anything other than `process.stdin`. Overrides `handleInput`.
|
|
252
|
+
- `pauseInputStreamOnFinish`: by default, pauses the input stream (`process.stdin` when `handleInput` is enabled, or `inputStream` if provided) when all of the processes have finished. If you need to read from the input stream after `concurrently` has finished, set this to `false`. ([#252](https://github.com/kimmobrunfeldt/concurrently/issues/252)).
|
|
253
|
+
- `killOthers`: an array of exitting conditions that will cause a process to kill others.
|
|
254
|
+
Can contain any of `success` or `failure`.
|
|
255
|
+
- `maxProcesses`: how many processes should run at once.
|
|
256
|
+
- `outputStream`: a [`Writable` stream](https://nodejs.org/dist/latest-v10.x/docs/api/stream.html#stream_writable_streams)
|
|
257
|
+
to write logs to. Default: `process.stdout`.
|
|
258
|
+
- `prefix`: the prefix type to use when logging processes output.
|
|
259
|
+
Possible values: `index`, `pid`, `time`, `command`, `name`, `none`, or a template (eg `[{time} process: {pid}]`).
|
|
260
|
+
Default: the name of the process, or its index if no name is set.
|
|
261
|
+
- `prefixColors`: a list of colors as supported by [chalk](https://www.npmjs.com/package/chalk).
|
|
262
|
+
If concurrently would run more commands than there are colors, the last color is repeated.
|
|
263
|
+
Prefix colors specified per-command take precedence over this list.
|
|
264
|
+
- `prefixLength`: how many characters to show when prefixing with `command`. Default: `10`
|
|
265
|
+
- `raw`: whether raw mode should be used, meaning strictly process output will
|
|
266
|
+
be logged, without any prefixes, colouring or extra stuff.
|
|
267
|
+
- `successCondition`: the condition to consider the run was successful.
|
|
268
|
+
If `first`, only the first process to exit will make up the success of the run; if `last`, the last process that exits will determine whether the run succeeds.
|
|
269
|
+
Anything else means all processes should exit successfully.
|
|
270
|
+
- `restartTries`: how many attempts to restart a process that dies will be made. Default: `0`.
|
|
271
|
+
- `restartDelay`: how many milliseconds to wait between process restarts. Default: `0`.
|
|
272
|
+
- `timestampFormat`: a [date-fns format](https://date-fns.org/v2.0.1/docs/format)
|
|
273
|
+
to use when prefixing with `time`. Default: `yyyy-MM-dd HH:mm:ss.ZZZ`
|
|
274
|
+
|
|
275
|
+
> Returns: a `Promise` that resolves if the run was successful (according to `successCondition` option),
|
|
276
|
+
> or rejects, containing an array of objects with information for each command that has been run, in the order
|
|
277
|
+
> that the commands terminated. The objects have the shape `{ command, index, exitCode, killed }`, where `command` is the object
|
|
278
|
+
> passed in the `commands` array, `index` its index there and `killed` indicates if the process was killed as a result of
|
|
279
|
+
> `killOthers`. Default values (empty strings or objects) are returned for the fields that were not specified.
|
|
280
|
+
|
|
281
|
+
Example:
|
|
282
|
+
|
|
283
|
+
```js
|
|
284
|
+
const concurrently = require('concurrently');
|
|
285
|
+
concurrently([
|
|
286
|
+
'npm:watch-*',
|
|
287
|
+
{ command: 'nodemon', name: 'server' },
|
|
288
|
+
{ command: 'deploy', name: 'deploy', env: { PUBLIC_KEY: '...' } },
|
|
289
|
+
{ command: 'watch', name: 'watch', cwd: path.resolve(__dirname, 'scripts/watchers')}
|
|
290
|
+
], {
|
|
291
|
+
prefix: 'name',
|
|
292
|
+
killOthers: ['failure', 'success'],
|
|
293
|
+
restartTries: 3,
|
|
294
|
+
cwd: path.resolve(__dirname, 'scripts'),
|
|
295
|
+
}).then(success, failure);
|
|
296
|
+
```
|
|
297
|
+
|
|
298
|
+
## FAQ
|
|
299
|
+
|
|
300
|
+
* Process exited with code *null*?
|
|
301
|
+
|
|
302
|
+
From [Node child_process documentation](http://nodejs.org/api/child_process.html#child_process_event_exit), `exit` event:
|
|
303
|
+
|
|
304
|
+
> This event is emitted after the child process ends. If the process
|
|
305
|
+
> terminated normally, code is the final exit code of the process,
|
|
306
|
+
> otherwise null. If the process terminated due to receipt of a signal,
|
|
307
|
+
> signal is the string name of the signal, otherwise null.
|
|
308
|
+
|
|
309
|
+
|
|
310
|
+
So *null* means the process didn't terminate normally. This will make **concurrent**
|
|
311
|
+
to return non-zero exit code too.
|
|
312
|
+
|
|
313
|
+
* Does this work with the npm-replacements [yarn](https://github.com/yarnpkg/yarn) or [pnpm](https://pnpm.js.org/)?
|
|
314
|
+
|
|
315
|
+
Yes! In all examples above, you may replace "`npm`" with "`yarn`" or "`pnpm`".
|