Skip to content

Commit 60daa03

Browse files
committed
Improve README.md
1 parent 3c5068b commit 60daa03

File tree

1 file changed

+19
-21
lines changed

1 file changed

+19
-21
lines changed

README.md

Lines changed: 19 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -50,65 +50,63 @@ This is why we've created this plugin. To provide better performance, plugin reu
5050
these trees with tslint. It can be scaled with a multi-process mode to utilize maximum CPU power.
5151

5252
## Modules resolution
53-
It's very important to be aware that this plugin uses [typescript](https://github.com/Microsoft/TypeScript)'s, not
54-
[webpack](https://github.com/webpack/webpack)'s modules resolution. It means that you have to setup `tsconfig.json` correctly. For example
53+
It's very important to be aware that **this plugin uses [typescript](https://github.com/Microsoft/TypeScript)'s, not
54+
[webpack](https://github.com/webpack/webpack)'s modules resolution**. It means that you have to setup `tsconfig.json` correctly. For example
5555
if you set `files: ['./src/someFile.ts']` in `tsconfig.json`, this plugin will check only `someFile.ts` for semantic errors. It's because
56-
of performance. The goal of this plugin is to be as fast as possible. With typescript's module resolution we don't have to wait for webpack
56+
of performance. The goal of this plugin is to be *as fast as possible*. With typescript's module resolution we don't have to wait for webpack
5757
to compile files (which traverses dependency graph during compilation) - we have a full list of files from the begin.
5858

5959
To debug typescript's modules resolution, you can use `tsc --traceResolution` command.
6060

6161
## TSLint
6262
If you have installed [tslint](https://palantir.github.io/tslint), it's enabled by default. To disable it, set `tslint: false` in plugin
63-
options. We recommend changing `defaultSeverity` to the `warning` in `tslint.json` file. It helps to distinguish lints from typescript's
63+
options. We recommend changing `defaultSeverity` to the `"warning"` in `tslint.json` file. It helps to distinguish lints from typescript's
6464
diagnostics.
6565

6666
## Options
67-
#### tsconfig `string`
67+
* **tsconfig** `string`:
6868
Path to tsconfig.json file. Default: `path.resolve(compiler.options.context, './tsconfig.json')`
6969

70-
#### tslint `string | false`
70+
* **tslint** `string | false`:
7171
Path to tslint.json file. If `false`, disables tslint. Default: `path.resolve(compiler.options.context, './tslint.json')`
7272

73-
#### watch `string | string[]`
73+
* **watch** `string | string[]`:
7474
Directories or files to watch by service. Not necessary but improves performance (reduces number of `fs.stat` calls).
7575

76-
#### blockEmit `boolean`
76+
* **blockEmit** `boolean`:
7777
If `true`, plugin will block emit until check will be done. It's good setting for ci/production build because webpack will return code != 0
7878
if there are type/lint errors. Default: `false`.
7979

80-
#### ignoreDiagnostics `number[]`
80+
* **ignoreDiagnostics** `number[]`:
8181
List of typescript diagnostic codes to ignore.
8282

83-
#### ignoreLints `string[]`
83+
* **ignoreLints** `string[]`:
8484
List of tslint rule names to ignore.
8585

86-
#### colors `boolean`
86+
* **colors** `boolean`:
8787
If `false`, disables built-in colors in logger messages. Default: `true`.
8888

89-
#### logger `object`
89+
* **logger** `object`:
9090
Logger instance. It should be object that implements method: `error`, `warn`, `info`. Default: `console`.
9191

92-
#### silent `boolean`
92+
* **silent** `boolean`:
9393
If `true`, logger will not be used. Default: `false`.
9494

95-
#### workers `number`
95+
* **memoryLimit** `number`:
96+
Memory limit for service process in MB. If service exits with allocation failed error, increase this number. Default: `2048`.
97+
98+
* **workers** `number`:
9699
You can split type checking to a few workers to speed-up increment build. **Be careful** - if you don't want to increase build time, you
97100
should keep free 1 core for *build* and 1 core for a *system* *(for example system with 4 CPUs should use max 2 workers)*. Second thing -
98101
node doesn't share memory between workers - keep in mind that memory usage will increase. Be aware that in some scenarios increasing workers
99-
number **can increase checking time**.
100-
101-
Default: `ForkTsCheckerWebpackPlugin.ONE_CPU`.
102+
number **can increase checking time**. Default: `ForkTsCheckerWebpackPlugin.ONE_CPU`.
102103

103-
Pre-computed consts:
104+
### Pre-computed consts:
104105
* `ForkTsCheckerWebpackPlugin.ONE_CPU` - always use one CPU
105106
* `ForkTsCheckerWebpackPlugin.ALL_CPUS` - always use all CPUs (will increase build time)
106107
* `ForkTsCheckerWebpackPlugin.ONE_CPU_FREE` - leave only one CPU for build (probably will increase build time)
107108
* `ForkTsCheckerWebpackPlugin.TWO_CPUS_FREE` - **recommended** - leave two CPUs free (one for build, one for system)
108109

109-
#### memoryLimit `number`
110-
Memory limit for service process in MB. If service exits with allocation failed error, increase this number. Default: `2048`.
111-
112110
## Plugin Hooks
113111
This plugin provides some custom webpack hooks (all are sync):
114112

0 commit comments

Comments
 (0)