fork-ts-checker-webpack-plugin 1.0.2 → 1.1.1
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/CHANGELOG.md +19 -3
- package/README.md +47 -28
- package/lib/ApiIncrementalChecker.d.ts +2 -1
- package/lib/ApiIncrementalChecker.js +2 -2
- package/lib/ApiIncrementalChecker.js.map +1 -1
- package/lib/CancellationToken.d.ts +1 -2
- package/lib/CompilerHost.d.ts +4 -1
- package/lib/CompilerHost.js +15 -1
- package/lib/CompilerHost.js.map +1 -1
- package/lib/IncrementalChecker.d.ts +4 -1
- package/lib/IncrementalChecker.js +18 -4
- package/lib/IncrementalChecker.js.map +1 -1
- package/lib/NormalizedMessage.d.ts +3 -0
- package/lib/NormalizedMessage.js +5 -1
- package/lib/NormalizedMessage.js.map +1 -1
- package/lib/NormalizedMessageFactories.d.ts +1 -0
- package/lib/NormalizedMessageFactories.js +13 -0
- package/lib/NormalizedMessageFactories.js.map +1 -1
- package/lib/RpcTypes.d.ts +5 -0
- package/lib/RpcTypes.js +4 -0
- package/lib/RpcTypes.js.map +1 -0
- package/lib/VueProgram.d.ts +2 -1
- package/lib/VueProgram.js +13 -1
- package/lib/VueProgram.js.map +1 -1
- package/lib/cluster.js +42 -34
- package/lib/cluster.js.map +1 -1
- package/lib/formatter/codeframeFormatter.js +8 -0
- package/lib/formatter/codeframeFormatter.js.map +1 -1
- package/lib/formatter/defaultFormatter.js +8 -0
- package/lib/formatter/defaultFormatter.js.map +1 -1
- package/lib/index.d.ts +6 -0
- package/lib/index.js +35 -6
- package/lib/index.js.map +1 -1
- package/lib/resolution.d.ts +7 -0
- package/lib/resolution.js +25 -0
- package/lib/resolution.js.map +1 -0
- package/lib/service.d.ts +1 -0
- package/lib/service.js +35 -19
- package/lib/service.js.map +1 -1
- package/package.json +3 -2
- package/lib/WorkResult.d.ts +0 -13
- package/lib/WorkResult.js +0 -39
- package/lib/WorkResult.js.map +0 -1
package/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,22 @@
|
|
|
1
|
+
## v1.1.1
|
|
2
|
+
|
|
3
|
+
* [Fix a regression w/ plugins like tsconfig-paths-webpack-plugin](https://github.com/Realytics/fork-ts-checker-webpack-plugin/pull/260)
|
|
4
|
+
|
|
5
|
+
## v1.1.0
|
|
6
|
+
|
|
7
|
+
* [Add new custom resolution options](https://github.com/Realytics/fork-ts-checker-webpack-plugin/pull/250)
|
|
8
|
+
|
|
9
|
+
## v1.0.4
|
|
10
|
+
|
|
11
|
+
* [gracefully handle error thrown from the service](https://github.com/Realytics/fork-ts-checker-webpack-plugin/pull/249)
|
|
12
|
+
|
|
13
|
+
## v1.0.3
|
|
14
|
+
|
|
15
|
+
* [use worker-rpc library for inter-process communication](https://github.com/Realytics/fork-ts-checker-webpack-plugin/pull/231)
|
|
16
|
+
|
|
1
17
|
## v1.0.2
|
|
2
18
|
|
|
3
|
-
* [Fix ignoreLintWarning mark warnings as errors](https://github.com/Realytics/fork-ts-checker-webpack-plugin/pull/243)
|
|
19
|
+
* [Fix ignoreLintWarning mark warnings as errors](https://github.com/Realytics/fork-ts-checker-webpack-plugin/pull/243)
|
|
4
20
|
|
|
5
21
|
## v1.0.1
|
|
6
22
|
|
|
@@ -12,7 +28,7 @@
|
|
|
12
28
|
|
|
13
29
|
This is the first major version of `fork-ts-checker-webpack-plugin`. A long time coming :-)
|
|
14
30
|
|
|
15
|
-
There are actually no breaking changes that we're aware of; users of 0.x `fork-ts-checker-webpack-plugin` should be be able to upgrade without any drama. Users of TypeScript 3+ may notice a performance improvement as by default the plugin now uses the [incremental watch API](https://github.com/Microsoft/TypeScript/pull/20234) in TypeScript. Should this prove problematic you can opt out of using it by supplying `useTypescriptIncrementalApi: false`.
|
|
31
|
+
There are actually no breaking changes that we're aware of; users of 0.x `fork-ts-checker-webpack-plugin` should be be able to upgrade without any drama. Users of TypeScript 3+ may notice a performance improvement as by default the plugin now uses the [incremental watch API](https://github.com/Microsoft/TypeScript/pull/20234) in TypeScript. Should this prove problematic you can opt out of using it by supplying `useTypescriptIncrementalApi: false`.
|
|
16
32
|
|
|
17
33
|
We are aware of an [issue with Vue and the incremental API](https://github.com/Realytics/fork-ts-checker-webpack-plugin/issues/219). We hope it will be fixed soon - a generous member of the community is taking a look. In the meantime, we will *not* default to using the incremental watch API when in Vue mode.
|
|
18
34
|
|
|
@@ -71,7 +87,7 @@ Version `1.x` additionally supports webpack 5 alongside webpack 4, whose hooks a
|
|
|
71
87
|
```diff
|
|
72
88
|
- compiler.hooks.forkTsCheckerDone.tap(...args)
|
|
73
89
|
+ const forkTsCheckerHooks = ForkTsCheckerWebpackPlugin.getCompilerHooks(compiler)
|
|
74
|
-
+ forkTsCheckerHooks.done.tap(...args)
|
|
90
|
+
+ forkTsCheckerHooks.done.tap(...args)
|
|
75
91
|
```
|
|
76
92
|
|
|
77
93
|
v1.0.0-alpha.0 drops support for node 6.
|
package/README.md
CHANGED
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
[](https://travis-ci.org/Realytics/fork-ts-checker-webpack-plugin)
|
|
4
4
|
|
|
5
5
|
Webpack plugin that runs typescript type checker on a separate process.
|
|
6
|
-
|
|
6
|
+
|
|
7
7
|
## Installation
|
|
8
8
|
This plugin requires minimum **webpack 2.3**, **typescript 2.1** and optionally **tslint 4.0**
|
|
9
9
|
```sh
|
|
@@ -23,7 +23,7 @@ var webpackConfig = {
|
|
|
23
23
|
loader: 'ts-loader',
|
|
24
24
|
options: {
|
|
25
25
|
// disable type checker - we will use it in fork plugin
|
|
26
|
-
transpileOnly: true
|
|
26
|
+
transpileOnly: true
|
|
27
27
|
}
|
|
28
28
|
}
|
|
29
29
|
]
|
|
@@ -39,21 +39,21 @@ There is already similar solution - [awesome-typescript-loader](https://github.c
|
|
|
39
39
|
add `CheckerPlugin` and delegate checker to the separate process. The problem with `awesome-typescript-loader` was that, in our case,
|
|
40
40
|
it was a lot slower than [ts-loader](https://github.com/TypeStrong/ts-loader) on an incremental build (~20s vs ~3s).
|
|
41
41
|
Secondly, we use [tslint](https://palantir.github.io/tslint) and we wanted to run this, along with type checker, in a separate process.
|
|
42
|
-
This is why we've created this plugin. To provide better performance, plugin reuses Abstract Syntax Trees between compilations and shares
|
|
42
|
+
This is why we've created this plugin. To provide better performance, plugin reuses Abstract Syntax Trees between compilations and shares
|
|
43
43
|
these trees with tslint. It can be scaled with a multi-process mode to utilize maximum CPU power.
|
|
44
44
|
|
|
45
45
|
## Modules resolution
|
|
46
|
-
It's very important to be aware that **this plugin uses [typescript](https://github.com/Microsoft/TypeScript)'s, not
|
|
47
|
-
[webpack](https://github.com/webpack/webpack)'s modules resolution**. It means that you have to setup `tsconfig.json` correctly. For example
|
|
48
|
-
if you set `files: ['./src/someFile.ts']` in `tsconfig.json`, this plugin will check only `someFile.ts` for semantic errors. It's because
|
|
49
|
-
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
|
|
46
|
+
It's very important to be aware that **this plugin uses [typescript](https://github.com/Microsoft/TypeScript)'s, not
|
|
47
|
+
[webpack](https://github.com/webpack/webpack)'s modules resolution**. It means that you have to setup `tsconfig.json` correctly. For example
|
|
48
|
+
if you set `files: ['./src/someFile.ts']` in `tsconfig.json`, this plugin will check only `someFile.ts` for semantic errors. It's because
|
|
49
|
+
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
|
|
50
50
|
to compile files (which traverses dependency graph during compilation) - we have a full list of files from the begin.
|
|
51
51
|
|
|
52
52
|
To debug typescript's modules resolution, you can use `tsc --traceResolution` command.
|
|
53
53
|
|
|
54
54
|
## TSLint
|
|
55
|
-
If you have installed [tslint](https://palantir.github.io/tslint), you can enable it by setting `tslint: true` or
|
|
56
|
-
`tslint: './path/to/tslint.json'`. We recommend changing `defaultSeverity` to a `"warning"` in `tslint.json` file.
|
|
55
|
+
If you have installed [tslint](https://palantir.github.io/tslint), you can enable it by setting `tslint: true` or
|
|
56
|
+
`tslint: './path/to/tslint.json'`. We recommend changing `defaultSeverity` to a `"warning"` in `tslint.json` file.
|
|
57
57
|
It helps to distinguish lints from typescript's diagnostics.
|
|
58
58
|
|
|
59
59
|
## Options
|
|
@@ -63,7 +63,7 @@ Path to *tsconfig.json* file. Default: `path.resolve(compiler.options.context, '
|
|
|
63
63
|
* **compilerOptions** `object`:
|
|
64
64
|
Allows overriding TypeScript options. Should be specified in the same format as you would do for the `compilerOptions` property in tsconfig.json. Default: `{}`.
|
|
65
65
|
|
|
66
|
-
* **tslint** `string | true | undefined`:
|
|
66
|
+
* **tslint** `string | true | undefined`:
|
|
67
67
|
- If `string`, path to *tslint.json* file to check source files against.
|
|
68
68
|
- If `true`, path to `tslint.json` file will be computed with respect to currently checked file, just like TSLint
|
|
69
69
|
CLI would do. Suppose you have a project:
|
|
@@ -81,13 +81,13 @@ Allows overriding TypeScript options. Should be specified in the same format as
|
|
|
81
81
|
```
|
|
82
82
|
In such a case `src/file.ts` and `src/anotherFile.ts` would be checked against root `tslint.json`, and
|
|
83
83
|
`src/lib/someHelperFile.ts` would be checked against `src/lib/tslint.json`.
|
|
84
|
-
|
|
84
|
+
|
|
85
85
|
Default: `undefined`.
|
|
86
86
|
|
|
87
87
|
* **tslintAutoFix** `boolean `:
|
|
88
88
|
Passes on `--fix` flag while running `tslint` to auto fix linting errors. Default: false.
|
|
89
89
|
|
|
90
|
-
* **watch** `string | string[]`:
|
|
90
|
+
* **watch** `string | string[]`:
|
|
91
91
|
Directories or files to watch by service. Not necessary but improves performance (reduces number of `fs.stat` calls).
|
|
92
92
|
|
|
93
93
|
* **async** `boolean`:
|
|
@@ -97,13 +97,13 @@ We recommend to set this to `false` in projects where type checking is faster th
|
|
|
97
97
|
* **ignoreDiagnostics** `number[]`:
|
|
98
98
|
List of typescript diagnostic codes to ignore.
|
|
99
99
|
|
|
100
|
-
* **ignoreLints** `string[]`:
|
|
100
|
+
* **ignoreLints** `string[]`:
|
|
101
101
|
List of tslint rule names to ignore.
|
|
102
102
|
|
|
103
103
|
* **ignoreLintWarnings** `boolean`:
|
|
104
104
|
If true, will ignore all lint warnings.
|
|
105
105
|
|
|
106
|
-
* **reportFiles** `string[]`:
|
|
106
|
+
* **reportFiles** `string[]`:
|
|
107
107
|
Only report errors on files matching these glob patterns. This can be useful when certain types definitions have errors that are not fatal to your application. Default: `[]`. Please note that this may behave unexpectedly if using the incremental API as the incremental API doesn't look for global and semantic errors [if it has already found syntactic errors](https://github.com/Microsoft/TypeScript/blob/89386ddda7dafc63cb35560e05412487f47cc267/src/compiler/watch.ts#L141).
|
|
108
108
|
|
|
109
109
|
```js
|
|
@@ -127,25 +127,25 @@ Options passed to formatters (currently only `codeframe` - see [available option
|
|
|
127
127
|
* **silent** `boolean`:
|
|
128
128
|
If `true`, logger will not be used. Default: `false`.
|
|
129
129
|
|
|
130
|
-
* **checkSyntacticErrors** `boolean`:
|
|
130
|
+
* **checkSyntacticErrors** `boolean`:
|
|
131
131
|
This option is useful if you're using ts-loader in `happyPackMode` with [HappyPack](https://github.com/amireh/happypack) or [thread-loader](https://github.com/webpack-contrib/thread-loader) to parallelise your builds. If `true` it will ensure that the plugin checks for *both* syntactic errors (eg `const array = [{} {}];`) and semantic errors (eg `const x: number = '1';`). By default the plugin only checks for semantic errors. This is because when ts-loader is used in `transpileOnly` mode, ts-loader will still report syntactic errors. When used in `happyPackMode` it does not. Default: `false`.
|
|
132
132
|
|
|
133
|
-
* **memoryLimit** `number`:
|
|
133
|
+
* **memoryLimit** `number`:
|
|
134
134
|
Memory limit for service process in MB. If service exits with allocation failed error, increase this number. Default: `2048`.
|
|
135
135
|
|
|
136
136
|
* **workers** `number`:
|
|
137
|
-
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
|
|
137
|
+
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
|
|
138
138
|
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 -
|
|
139
139
|
node doesn't share memory between workers - keep in mind that memory usage will increase. Be aware that in some scenarios increasing workers
|
|
140
140
|
number **can increase checking time**. Default: `ForkTsCheckerWebpackPlugin.ONE_CPU`.
|
|
141
141
|
|
|
142
142
|
* **vue** `boolean`:
|
|
143
|
-
If `true`, the linter and compiler will process VueJs single-file-component (.vue) files. See the
|
|
143
|
+
If `true`, the linter and compiler will process VueJs single-file-component (.vue) files. See the
|
|
144
144
|
[Vue section](https://github.com/Realytics/fork-ts-checker-webpack-plugin#vue) further down for information on how to correctly setup your project.
|
|
145
145
|
|
|
146
146
|
* **useTypescriptIncrementalApi** `boolean`:
|
|
147
|
-
If true, the plugin will use incremental compilation API introduced in typescript 2.7. In this mode you can only have 1
|
|
148
|
-
worker, but if the changes in your code are small (like you normally have when you work in 'watch' mode), the compilation
|
|
147
|
+
If true, the plugin will use incremental compilation API introduced in typescript 2.7. In this mode you can only have 1
|
|
148
|
+
worker, but if the changes in your code are small (like you normally have when you work in 'watch' mode), the compilation
|
|
149
149
|
may be much faster, even compared to multi-threaded compilation. Defaults to `true` when working with typescript 3+ and `false` when below 3. The default can be overridden by directly specifying a value.
|
|
150
150
|
|
|
151
151
|
* **measureCompilationTime** `boolean`:
|
|
@@ -155,7 +155,26 @@ especially if there are other loaders/plugins involved in the compilation. **req
|
|
|
155
155
|
* **typescript** `string`:
|
|
156
156
|
If supplied this is a custom path where `typescript` can be found. Defaults to `require.resolve('typescript')`.
|
|
157
157
|
|
|
158
|
-
|
|
158
|
+
* **resolveModuleNameModule** and **resolveTypeReferenceDirectiveModule** `string`:
|
|
159
|
+
Both of those options refer to files on the disk that respectively export a `resolveModuleName` or a `resolveTypeReferenceDirectiveModule` function. These functions will be used to resolve the import statements and the `<reference types="...">` directives instead of the default TypeScript implementation. Check the following code for an example of what those functions should look like:
|
|
160
|
+
<details>
|
|
161
|
+
<summary>Code sample</summary>
|
|
162
|
+
|
|
163
|
+
```js
|
|
164
|
+
const {resolveModuleName} = require(`ts-pnp`);
|
|
165
|
+
|
|
166
|
+
exports.resolveModuleName = (typescript, moduleName, containingFile, compilerOptions, resolutionHost) => {
|
|
167
|
+
return resolveModuleName(moduleName, containingFile, compilerOptions, resolutionHost, typescript.resolveModuleName);
|
|
168
|
+
};
|
|
169
|
+
|
|
170
|
+
exports.resolveTypeReferenceDirective = (typescript, moduleName, containingFile, compilerOptions, resolutionHost) => {
|
|
171
|
+
return resolveModuleName(moduleName, containingFile, compilerOptions, resolutionHost, typescript.resolveTypeReferenceDirective);
|
|
172
|
+
};
|
|
173
|
+
```
|
|
174
|
+
|
|
175
|
+
</details>
|
|
176
|
+
|
|
177
|
+
### Pre-computed consts:
|
|
159
178
|
* `ForkTsCheckerWebpackPlugin.ONE_CPU` - always use one CPU
|
|
160
179
|
* `ForkTsCheckerWebpackPlugin.ALL_CPUS` - always use all CPUs (will increase build time)
|
|
161
180
|
* `ForkTsCheckerWebpackPlugin.ONE_CPU_FREE` - leave only one CPU for build (probably will increase build time)
|
|
@@ -188,7 +207,7 @@ This plugin provides some custom webpack hooks (all are sync):
|
|
|
188
207
|
|`fork-ts-checker-service-start`| Service will be started | `tsconfigPath`, `tslintPath`, `watchPaths`, `workersNumber`, `memoryLimit` |
|
|
189
208
|
|`fork-ts-checker-service-start-error` | Cannot start service | `error` |
|
|
190
209
|
|`fork-ts-checker-service-out-of-memory`| Service is out of memory | - |
|
|
191
|
-
|`fork-ts-checker-receive`| Plugin receives diagnostics and lints from service | `diagnostics`, `lints` |
|
|
210
|
+
|`fork-ts-checker-receive`| Plugin receives diagnostics and lints from service | `diagnostics`, `lints` |
|
|
192
211
|
|`fork-ts-checker-emit`| Service will add errors and warnings to webpack compilation ('build' mode) | `diagnostics`, `lints`, `elapsed` |
|
|
193
212
|
|`fork-ts-checker-done`| Service finished type checking and webpack finished compilation ('watch' mode) | `diagnostics`, `lints`, `elapsed` |
|
|
194
213
|
|
|
@@ -203,7 +222,7 @@ new ForkTsCheckerWebpackPlugin({
|
|
|
203
222
|
```
|
|
204
223
|
|
|
205
224
|
2. To activate TypeScript in your `.vue` files, you need to ensure your script tag's language attribute is set
|
|
206
|
-
to `ts` or `tsx` (also make sure you include the `.vue` extension in all your import statements as shown below):
|
|
225
|
+
to `ts` or `tsx` (also make sure you include the `.vue` extension in all your import statements as shown below):
|
|
207
226
|
|
|
208
227
|
```html
|
|
209
228
|
<script lang="ts">
|
|
@@ -213,7 +232,7 @@ import Hello from '@/components/hello.vue'
|
|
|
213
232
|
</script>
|
|
214
233
|
```
|
|
215
234
|
|
|
216
|
-
3. Ideally you are also using `ts-loader` (in transpileOnly mode). Your Webpack config rules may look something like this:
|
|
235
|
+
3. Ideally you are also using `ts-loader` (in transpileOnly mode). Your Webpack config rules may look something like this:
|
|
217
236
|
|
|
218
237
|
```js
|
|
219
238
|
{
|
|
@@ -231,7 +250,7 @@ import Hello from '@/components/hello.vue'
|
|
|
231
250
|
options: vueLoaderConfig
|
|
232
251
|
},
|
|
233
252
|
```
|
|
234
|
-
4. Add rules to your `tslint.json` and they will be applied to Vue files. For example, you could apply the Standard JS rules [tslint-config-standard](https://github.com/blakeembrey/tslint-config-standard) like this:
|
|
253
|
+
4. Add rules to your `tslint.json` and they will be applied to Vue files. For example, you could apply the Standard JS rules [tslint-config-standard](https://github.com/blakeembrey/tslint-config-standard) like this:
|
|
235
254
|
|
|
236
255
|
```json
|
|
237
256
|
{
|
|
@@ -241,7 +260,7 @@ import Hello from '@/components/hello.vue'
|
|
|
241
260
|
]
|
|
242
261
|
}
|
|
243
262
|
```
|
|
244
|
-
5. Ensure your `tsconfig.json` includes .vue files:
|
|
263
|
+
5. Ensure your `tsconfig.json` includes .vue files:
|
|
245
264
|
|
|
246
265
|
```js
|
|
247
266
|
// tsconfig.json
|
|
@@ -256,12 +275,12 @@ import Hello from '@/components/hello.vue'
|
|
|
256
275
|
}
|
|
257
276
|
```
|
|
258
277
|
|
|
259
|
-
6. It accepts any wildcard in your TypeScript configuration:
|
|
278
|
+
6. It accepts any wildcard in your TypeScript configuration:
|
|
260
279
|
```js
|
|
261
280
|
// tsconfig.json
|
|
262
281
|
{
|
|
263
282
|
"compilerOptions": {
|
|
264
|
-
|
|
283
|
+
|
|
265
284
|
// ...
|
|
266
285
|
|
|
267
286
|
"baseUrl": ".",
|
|
@@ -3,6 +3,7 @@ import { RuleFailure } from 'tslint';
|
|
|
3
3
|
import { IncrementalCheckerInterface } from './IncrementalCheckerInterface';
|
|
4
4
|
import { CancellationToken } from './CancellationToken';
|
|
5
5
|
import { NormalizedMessage } from './NormalizedMessage';
|
|
6
|
+
import { ResolveModuleName, ResolveTypeReferenceDirective } from './resolution';
|
|
6
7
|
export declare class ApiIncrementalChecker implements IncrementalCheckerInterface {
|
|
7
8
|
private createNormalizedMessageFromDiagnostic;
|
|
8
9
|
private createNormalizedMessageFromRuleFailure;
|
|
@@ -17,7 +18,7 @@ export declare class ApiIncrementalChecker implements IncrementalCheckerInterfac
|
|
|
17
18
|
private lastUpdatedFiles;
|
|
18
19
|
private lastRemovedFiles;
|
|
19
20
|
private readonly hasFixedConfig;
|
|
20
|
-
constructor(typescript: typeof ts, createNormalizedMessageFromDiagnostic: (diagnostic: ts.Diagnostic) => NormalizedMessage, createNormalizedMessageFromRuleFailure: (ruleFailure: RuleFailure) => NormalizedMessage, programConfigFile: string, compilerOptions: ts.CompilerOptions, context: string, linterConfigFile: string | boolean, linterAutoFix: boolean, checkSyntacticErrors: boolean);
|
|
21
|
+
constructor(typescript: typeof ts, createNormalizedMessageFromDiagnostic: (diagnostic: ts.Diagnostic) => NormalizedMessage, createNormalizedMessageFromRuleFailure: (ruleFailure: RuleFailure) => NormalizedMessage, programConfigFile: string, compilerOptions: ts.CompilerOptions, context: string, linterConfigFile: string | boolean, linterAutoFix: boolean, checkSyntacticErrors: boolean, resolveModuleName: ResolveModuleName | undefined, resolveTypeReferenceDirective: ResolveTypeReferenceDirective | undefined);
|
|
21
22
|
private initLinterConfig;
|
|
22
23
|
private getLinterConfig;
|
|
23
24
|
private createLinter;
|
|
@@ -15,7 +15,7 @@ const NormalizedMessage_1 = require("./NormalizedMessage");
|
|
|
15
15
|
const CompilerHost_1 = require("./CompilerHost");
|
|
16
16
|
const FsHelper_1 = require("./FsHelper");
|
|
17
17
|
class ApiIncrementalChecker {
|
|
18
|
-
constructor(typescript, createNormalizedMessageFromDiagnostic, createNormalizedMessageFromRuleFailure, programConfigFile, compilerOptions, context, linterConfigFile, linterAutoFix, checkSyntacticErrors) {
|
|
18
|
+
constructor(typescript, createNormalizedMessageFromDiagnostic, createNormalizedMessageFromRuleFailure, programConfigFile, compilerOptions, context, linterConfigFile, linterAutoFix, checkSyntacticErrors, resolveModuleName, resolveTypeReferenceDirective) {
|
|
19
19
|
this.createNormalizedMessageFromDiagnostic = createNormalizedMessageFromDiagnostic;
|
|
20
20
|
this.createNormalizedMessageFromRuleFailure = createNormalizedMessageFromRuleFailure;
|
|
21
21
|
this.context = context;
|
|
@@ -29,7 +29,7 @@ class ApiIncrementalChecker {
|
|
|
29
29
|
this.getLinterConfig = linterConfigHelpers_1.makeGetLinterConfig(this.linterConfigs, this.linterExclusions, this.context);
|
|
30
30
|
this.hasFixedConfig = typeof this.linterConfigFile === 'string';
|
|
31
31
|
this.initLinterConfig();
|
|
32
|
-
this.tsIncrementalCompiler = new CompilerHost_1.CompilerHost(typescript, programConfigFile, compilerOptions, checkSyntacticErrors);
|
|
32
|
+
this.tsIncrementalCompiler = new CompilerHost_1.CompilerHost(typescript, programConfigFile, compilerOptions, checkSyntacticErrors, resolveModuleName, resolveTypeReferenceDirective);
|
|
33
33
|
}
|
|
34
34
|
initLinterConfig() {
|
|
35
35
|
if (!this.linterConfig && this.hasFixedConfig) {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ApiIncrementalChecker.js","sourceRoot":"","sources":["../src/ApiIncrementalChecker.ts"],"names":[],"mappings":";;;;;;;;;;AAIA,uCAAuC;AACvC,6BAA6B;AAG7B,+DAI+B;AAC/B,2DAAwD;AACxD,iDAA8C;
|
|
1
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AC;aAC5C;SACF;QAED,MAAM,QAAQ,GAAG,EAAE,CAAC;QACpB,KAAK,MAAM,CAAC,EAAE,KAAK,CAAC,IAAI,IAAI,CAAC,iBAAiB,EAAE;YAC9C,QAAQ,CAAC,IAAI,CAAC,GAAG,KAAK,CAAC,QAAQ,CAAC,CAAC;SAClC;QAED,OAAO,qCAAiB,CAAC,WAAW,CAClC,QAAQ,CAAC,GAAG,CAAC,IAAI,CAAC,sCAAsC,CAAC,CAC1D,CAAC;IACJ,CAAC;CACF;AArJD,sDAqJC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as ts from 'typescript';
|
|
2
|
-
interface CancellationTokenData {
|
|
2
|
+
export interface CancellationTokenData {
|
|
3
3
|
isCancelled: boolean;
|
|
4
4
|
cancellationFileName: string;
|
|
5
5
|
}
|
|
@@ -20,4 +20,3 @@ export declare class CancellationToken {
|
|
|
20
20
|
requestCancellation(): void;
|
|
21
21
|
cleanupCancellation(): void;
|
|
22
22
|
}
|
|
23
|
-
export {};
|
package/lib/CompilerHost.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import * as ts from 'typescript';
|
|
2
|
+
import { ResolveModuleName, ResolveTypeReferenceDirective } from './resolution';
|
|
2
3
|
export declare class CompilerHost implements ts.WatchCompilerHostOfConfigFile<ts.EmitAndSemanticDiagnosticsBuilderProgram> {
|
|
3
4
|
private typescript;
|
|
4
5
|
private program?;
|
|
@@ -14,7 +15,9 @@ export declare class CompilerHost implements ts.WatchCompilerHostOfConfigFile<ts
|
|
|
14
15
|
private readonly tsHost;
|
|
15
16
|
private lastProcessing?;
|
|
16
17
|
private compilationStarted;
|
|
17
|
-
|
|
18
|
+
resolveModuleNames: ((moduleNames: string[], containingFile: string, reusedNames?: string[] | undefined, redirectedReference?: ts.ResolvedProjectReference | undefined) => (ts.ResolvedModule | undefined)[]) | undefined;
|
|
19
|
+
resolveTypeReferenceDirectives: ((typeReferenceDirectiveNames: string[], containingFile: string, redirectedReference?: ts.ResolvedProjectReference | undefined) => (ts.ResolvedTypeReferenceDirective | undefined)[]) | undefined;
|
|
20
|
+
constructor(typescript: typeof ts, programConfigFile: string, compilerOptions: ts.CompilerOptions, checkSyntacticErrors: boolean, userResolveModuleName?: ResolveModuleName, userResolveTypeReferenceDirective?: ResolveTypeReferenceDirective);
|
|
18
21
|
processChanges(): Promise<{
|
|
19
22
|
results: ts.Diagnostic[];
|
|
20
23
|
updatedFiles: string[];
|
package/lib/CompilerHost.js
CHANGED
|
@@ -11,7 +11,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
11
11
|
const LinkedList_1 = require("./LinkedList");
|
|
12
12
|
const VueProgram_1 = require("./VueProgram");
|
|
13
13
|
class CompilerHost {
|
|
14
|
-
constructor(typescript, programConfigFile, compilerOptions, checkSyntacticErrors) {
|
|
14
|
+
constructor(typescript, programConfigFile, compilerOptions, checkSyntacticErrors, userResolveModuleName, userResolveTypeReferenceDirective) {
|
|
15
15
|
this.typescript = typescript;
|
|
16
16
|
// intercept all watch events and collect them until we get notification to start compilation
|
|
17
17
|
this.directoryWatchers = new LinkedList_1.LinkedList();
|
|
@@ -34,6 +34,20 @@ class CompilerHost {
|
|
|
34
34
|
});
|
|
35
35
|
this.configFileName = this.tsHost.configFileName;
|
|
36
36
|
this.optionsToExtend = this.tsHost.optionsToExtend || {};
|
|
37
|
+
if (userResolveModuleName) {
|
|
38
|
+
this.resolveModuleNames = (moduleNames, containingFile) => {
|
|
39
|
+
return moduleNames.map(moduleName => {
|
|
40
|
+
return userResolveModuleName(this.typescript, moduleName, containingFile, this.optionsToExtend, this).resolvedModule;
|
|
41
|
+
});
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
if (userResolveTypeReferenceDirective) {
|
|
45
|
+
this.resolveTypeReferenceDirectives = (typeDirectiveNames, containingFile) => {
|
|
46
|
+
return typeDirectiveNames.map(typeDirectiveName => {
|
|
47
|
+
return userResolveTypeReferenceDirective(this.typescript, typeDirectiveName, containingFile, this.optionsToExtend, this).resolvedTypeReferenceDirective;
|
|
48
|
+
});
|
|
49
|
+
};
|
|
50
|
+
}
|
|
37
51
|
}
|
|
38
52
|
getProgram() {
|
|
39
53
|
return this.program.getProgram().getProgram();
|
package/lib/CompilerHost.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"CompilerHost.js","sourceRoot":"","sources":["../src/CompilerHost.ts"],"names":[],"mappings":";;;;;;;;;;AAEA,6CAA0C;AAC1C,6CAA0C;
|
|
1
|
+
{"version":3,"file":"CompilerHost.js","sourceRoot":"","sources":["../src/CompilerHost.ts"],"names":[],"mappings":";;;;;;;;;;AAEA,6CAA0C;AAC1C,6CAA0C;AAa1C,MAAa,YAAY;IAsDvB,YACU,UAAqB,EAC7B,iBAAyB,EACzB,eAAmC,EACnC,oBAA6B,EAC7B,qBAAyC,EACzC,iCAAiE;QALzD,eAAU,GAAV,UAAU,CAAW;QAnC/B,6FAA6F;QACrF,sBAAiB,GAAG,IAAI,uBAAU,EAA2B,CAAC;QAC9D,iBAAY,GAAG,IAAI,uBAAU,EAAsB,CAAC;QAEpD,eAAU,GAAG,IAAI,GAAG,EAAU,CAAC;QAE/B,uBAAkB,GAAoB,EAAE,CAAC;QACzC,iBAAY,GAAG,GAAG,EAAE;YAC1B,gBAAgB;QAClB,CAAC,CAAC;QAOM,uBAAkB,GAAG,KAAK,CAAC;QA6S5B,kBAAa,GAAG,IAAI,CAAC,UAAU;aACnC,8CAA8C,CAAC;QApRhD,IAAI,CAAC,MAAM,GAAG,UAAU,CAAC,uBAAuB,CAC9C,iBAAiB,EACjB,eAAe,EACf,UAAU,CAAC,GAAG,EACd,UAAU,CAAC,8CAA8C,EACzD,CAAC,IAAmB,EAAE,EAAE;YACtB,IAAI,CAAC,oBAAoB,IAAI,IAAI,CAAC,IAAI,IAAI,IAAI,IAAI,IAAI,CAAC,IAAI,GAAG,IAAI,EAAE;gBAClE,OAAO;aACR;YACD,IAAI,C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ClC,CAAC;IAEM,QAAQ,CAAC,IAAY;QAC1B,OAAO,IAAI,CAAC,MAAM,CAAC,QAAS,CAAC,IAAI,CAAC,CAAC;IACrC,CAAC;IAEM,KAAK,CAAC,CAAS;QACpB,IAAI,IAAI,CAAC,MAAM,CAAC,KAAK,EAAE;YACrB,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;SACtB;IACH,CAAC;IAEM,yBAAyB;QAC9B,OAAO,IAAI,CAAC,MAAM,CAAC,yBAAyB,EAAE,CAAC;IACjD,CAAC;IAEM,mCAAmC,CAAC,KAAoB;QAC7D,aAAa;IACf,CAAC;IAEM,kBAAkB,CACvB,OAAoD;QAEpD,sCAAsC;QACtC,IAAI,CAAC,MAAM,CAAC,kBAAmB,CAAC,OAAO,CAAC,CAAC;QACzC,IAAI,CAAC,YAAY,EAAE,CAAC;IACtB,CAAC;IAED,uHAAuH;IACvH,gBAAgB;IAChB,iCAAiC;IACjC,8BAA8B;IAC9B,4HAA4H;IACrH,eAAe,CAAC,KAAa;QAClC,4BAA4B;IAC9B,CAAC;IAEM,SAAS,CACd,KAAa,EACb,KAAa,EACb,mBAA6B;QAE7B,4BAA4B;IAC9B,CAAC;IAEM,oCAAoC,CAAE,KAAU;QACrD,4BAA4B;IAC9B,CAAC;CACF;AArZD,oCAqZC"}
|
|
@@ -2,6 +2,7 @@ import * as ts from 'typescript';
|
|
|
2
2
|
import { RuleFailure } from 'tslint';
|
|
3
3
|
import { NormalizedMessage } from './NormalizedMessage';
|
|
4
4
|
import { CancellationToken } from './CancellationToken';
|
|
5
|
+
import { ResolveModuleName, ResolveTypeReferenceDirective } from './resolution';
|
|
5
6
|
import * as minimatch from 'minimatch';
|
|
6
7
|
import { IncrementalCheckerInterface } from './IncrementalCheckerInterface';
|
|
7
8
|
export declare class IncrementalChecker implements IncrementalCheckerInterface {
|
|
@@ -18,6 +19,8 @@ export declare class IncrementalChecker implements IncrementalCheckerInterface {
|
|
|
18
19
|
private workDivision;
|
|
19
20
|
private checkSyntacticErrors;
|
|
20
21
|
private vue;
|
|
22
|
+
private resolveModuleName;
|
|
23
|
+
private resolveTypeReferenceDirective;
|
|
21
24
|
private linterConfigs;
|
|
22
25
|
private files;
|
|
23
26
|
private linter?;
|
|
@@ -27,7 +30,7 @@ export declare class IncrementalChecker implements IncrementalCheckerInterface {
|
|
|
27
30
|
private programConfig?;
|
|
28
31
|
private watcher?;
|
|
29
32
|
private readonly hasFixedConfig;
|
|
30
|
-
constructor(typescript: typeof ts, createNormalizedMessageFromDiagnostic: (diagnostic: ts.Diagnostic) => NormalizedMessage, createNormalizedMessageFromRuleFailure: (ruleFailure: RuleFailure) => NormalizedMessage, programConfigFile: string, compilerOptions: object, context: string, linterConfigFile: string | boolean, linterAutoFix: boolean, watchPaths: string[], workNumber
|
|
33
|
+
constructor(typescript: typeof ts, createNormalizedMessageFromDiagnostic: (diagnostic: ts.Diagnostic) => NormalizedMessage, createNormalizedMessageFromRuleFailure: (ruleFailure: RuleFailure) => NormalizedMessage, programConfigFile: string, compilerOptions: object, context: string, linterConfigFile: string | boolean, linterAutoFix: boolean, watchPaths: string[], workNumber: number, workDivision: number, checkSyntacticErrors: boolean, vue: boolean, resolveModuleName: ResolveModuleName | undefined, resolveTypeReferenceDirective: ResolveTypeReferenceDirective | undefined);
|
|
31
34
|
static loadProgramConfig(typescript: typeof ts, configFile: string, compilerOptions: object): ts.ParsedCommandLine;
|
|
32
35
|
private getLinterConfig;
|
|
33
36
|
private static createProgram;
|
|
@@ -7,11 +7,12 @@ const FilesWatcher_1 = require("./FilesWatcher");
|
|
|
7
7
|
const linterConfigHelpers_1 = require("./linterConfigHelpers");
|
|
8
8
|
const WorkSet_1 = require("./WorkSet");
|
|
9
9
|
const NormalizedMessage_1 = require("./NormalizedMessage");
|
|
10
|
+
const resolution_1 = require("./resolution");
|
|
10
11
|
const minimatch = require("minimatch");
|
|
11
12
|
const VueProgram_1 = require("./VueProgram");
|
|
12
13
|
const FsHelper_1 = require("./FsHelper");
|
|
13
14
|
class IncrementalChecker {
|
|
14
|
-
constructor(typescript, createNormalizedMessageFromDiagnostic, createNormalizedMessageFromRuleFailure, programConfigFile, compilerOptions, context, linterConfigFile, linterAutoFix, watchPaths, workNumber = 0, workDivision = 1, checkSyntacticErrors = false, vue = false) {
|
|
15
|
+
constructor(typescript, createNormalizedMessageFromDiagnostic, createNormalizedMessageFromRuleFailure, programConfigFile, compilerOptions, context, linterConfigFile, linterAutoFix, watchPaths, workNumber = 0, workDivision = 1, checkSyntacticErrors = false, vue = false, resolveModuleName, resolveTypeReferenceDirective) {
|
|
15
16
|
this.typescript = typescript;
|
|
16
17
|
this.createNormalizedMessageFromDiagnostic = createNormalizedMessageFromDiagnostic;
|
|
17
18
|
this.createNormalizedMessageFromRuleFailure = createNormalizedMessageFromRuleFailure;
|
|
@@ -25,6 +26,8 @@ class IncrementalChecker {
|
|
|
25
26
|
this.workDivision = workDivision;
|
|
26
27
|
this.checkSyntacticErrors = checkSyntacticErrors;
|
|
27
28
|
this.vue = vue;
|
|
29
|
+
this.resolveModuleName = resolveModuleName;
|
|
30
|
+
this.resolveTypeReferenceDirective = resolveTypeReferenceDirective;
|
|
28
31
|
// it's shared between compilations
|
|
29
32
|
this.linterConfigs = {};
|
|
30
33
|
this.files = new FilesRegister_1.FilesRegister(() => ({
|
|
@@ -46,9 +49,20 @@ class IncrementalChecker {
|
|
|
46
49
|
const parsed = typescript.parseJsonConfigFileContent(tsconfig, typescript.sys, path.dirname(configFile));
|
|
47
50
|
return parsed;
|
|
48
51
|
}
|
|
49
|
-
static createProgram(typescript, programConfig, files, watcher, oldProgram) {
|
|
52
|
+
static createProgram(typescript, programConfig, files, watcher, oldProgram, userResolveModuleName, userResolveTypeReferenceDirective) {
|
|
50
53
|
const host = typescript.createCompilerHost(programConfig.options);
|
|
51
54
|
const realGetSourceFile = host.getSourceFile;
|
|
55
|
+
const { resolveModuleName, resolveTypeReferenceDirective } = resolution_1.makeResolutionFunctions(userResolveModuleName, userResolveTypeReferenceDirective);
|
|
56
|
+
host.resolveModuleNames = (moduleNames, containingFile) => {
|
|
57
|
+
return moduleNames.map(moduleName => {
|
|
58
|
+
return resolveModuleName(typescript, moduleName, containingFile, programConfig.options, host).resolvedModule;
|
|
59
|
+
});
|
|
60
|
+
};
|
|
61
|
+
host.resolveTypeReferenceDirectives = (typeDirectiveNames, containingFile) => {
|
|
62
|
+
return typeDirectiveNames.map(typeDirectiveName => {
|
|
63
|
+
return resolveTypeReferenceDirective(typescript, typeDirectiveName, containingFile, programConfig.options, host).resolvedTypeReferenceDirective;
|
|
64
|
+
});
|
|
65
|
+
};
|
|
52
66
|
host.getSourceFile = (filePath, languageVersion, onError) => {
|
|
53
67
|
// first check if watcher is watching file - if not - check it's mtime
|
|
54
68
|
if (!watcher.isWatchingFile(filePath)) {
|
|
@@ -118,13 +132,13 @@ class IncrementalChecker {
|
|
|
118
132
|
this.programConfig =
|
|
119
133
|
this.programConfig ||
|
|
120
134
|
VueProgram_1.VueProgram.loadProgramConfig(this.typescript, this.programConfigFile, this.compilerOptions);
|
|
121
|
-
return VueProgram_1.VueProgram.createProgram(this.typescript, this.programConfig, path.dirname(this.programConfigFile), this.files, this.watcher, this.program);
|
|
135
|
+
return VueProgram_1.VueProgram.createProgram(this.typescript, this.programConfig, path.dirname(this.programConfigFile), this.files, this.watcher, this.program, this.resolveModuleName, this.resolveTypeReferenceDirective);
|
|
122
136
|
}
|
|
123
137
|
loadDefaultProgram() {
|
|
124
138
|
this.programConfig =
|
|
125
139
|
this.programConfig ||
|
|
126
140
|
IncrementalChecker.loadProgramConfig(this.typescript, this.programConfigFile, this.compilerOptions);
|
|
127
|
-
return IncrementalChecker.createProgram(this.typescript, this.programConfig, this.files, this.watcher, this.program);
|
|
141
|
+
return IncrementalChecker.createProgram(this.typescript, this.programConfig, this.files, this.watcher, this.program, this.resolveModuleName, this.resolveTypeReferenceDirective);
|
|
128
142
|
}
|
|
129
143
|
getDiagnostics(cancellationToken) {
|
|
130
144
|
const { program } = this;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"IncrementalChecker.js","sourceRoot":"","sources":["../src/IncrementalChecker.ts"],"names":[],"mappings":";;AAAA,yBAAyB;AACzB,6BAA6B;AAK7B,mDAAgD;AAChD,iDAA8C;AAC9C,+DAI+B;AAC/B,uCAAoC;AACpC,2DAAwD;AAExD,uCAAuC;AACvC,6CAA0C;AAC1C,yCAAsC;AAGtC,MAAa,kBAAkB;IAuB7B,YACU,UAAqB,EACrB,qCAEc,EACd,sCAEc,EACd,iBAAyB,EACzB,eAAuB,EACvB,OAAe,EACf,gBAAkC,EAClC,aAAsB,EACtB,UAAoB,EACpB,aAAqB,CAAC,EACtB,eAAuB,CAAC,EACxB,uBAAgC,KAAK,EACrC,MAAe,KAAK;
|
|
1
|
+
{"version":3,"file":"IncrementalChecker.js","sourceRoot":"","sources":["../src/IncrementalChecker.ts"],"names":[],"mappings":";;AAAA,yBAAyB;AACzB,6BAA6B;AAK7B,mDAAgD;AAChD,iDAA8C;AAC9C,+DAI+B;AAC/B,uCAAoC;AACpC,2DAAwD;AAExD,6CAIsB;AACtB,uCAAuC;AACvC,6CAA0C;AAC1C,yCAAsC;AAGtC,MAAa,kBAAkB;IAuB7B,YACU,UAAqB,EACrB,qCAEc,EACd,sCAEc,EACd,iBAAyB,EACzB,eAAuB,EACvB,OAAe,EACf,gBAAkC,EAClC,aAAsB,EACtB,UAAoB,EACpB,aAAqB,CAAC,EACtB,eAAuB,CAAC,EACxB,uBAAgC,KAAK,EACrC,MAAe,KAAK,EACpB,iBAAgD,EAChD,6BAEK;QApBL,eAAU,GAAV,UAAU,CAAW;QACrB,0CAAqC,GAArC,qCAAqC,CAEvB;QACd,2CAAsC,GAAtC,sCAAsC,CAExB;QACd,sBAAiB,GAAjB,iBAAiB,CAAQ;QACzB,oBAAe,GAAf,eAAe,CAAQ;QACvB,YAAO,GAAP,OAAO,CAAQ;QACf,qBAAgB,GAAhB,gBA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,QAAQ,GAAG,IAAI,CAAC,WAAW,EAAE,CAAC;YAEpC,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,QAAQ,EAAE,IAAI,CAAC,EAAE;gBACrC,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC;gBACnB,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;YACxB,CAAC,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;QAEH,0BAA0B;QAC1B,IAAI,CAAC,KAAK,CAAC,IAAI,EAAE,CAAC,OAAO,CAAC,QAAQ,CAAC,EAAE;YACnC,IAAI,CAAC,KAAK,CAAC,UAAU,CAAC,QAAQ,EAAE,IAAI,CAAC,EAAE;gBACrC,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC;YACrB,CAAC,CAAC,CAAC;QACL,CAAC,CAAC,CAAC;QAEH,gBAAgB;QAChB,MAAM,KAAK,GAAG,IAAI,CAAC,KAAK;aACrB,IAAI,EAAE;aACN,MAAM,CACL,CAAC,UAAU,EAAE,QAAQ,EAAE,EAAE,CACvB,UAAU,CAAC,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,OAAO,CAAC,QAAQ,CAAC,CAAC,KAAK,CAAC,EACvD,EAAmB,CACpB,CAAC;QAEJ,kCAAkC;QAClC,OAAO,qCAAiB,CAAC,WAAW,CAClC,KAAK,CAAC,GAAG,CAAC,IAAI,CAAC,sCAAsC,CAAC,CACvD,CAAC;IACJ,CAAC;CACF;AAjYD,gDAiYC"}
|
|
@@ -8,12 +8,14 @@ interface NormalizedMessageJson {
|
|
|
8
8
|
file?: string;
|
|
9
9
|
line?: number;
|
|
10
10
|
character?: number;
|
|
11
|
+
stack?: string;
|
|
11
12
|
}
|
|
12
13
|
export declare class NormalizedMessage {
|
|
13
14
|
static readonly TYPE_DIAGNOSTIC: ErrorType;
|
|
14
15
|
static readonly TYPE_LINT: ErrorType;
|
|
15
16
|
static readonly SEVERITY_ERROR: Severity;
|
|
16
17
|
static readonly SEVERITY_WARNING: Severity;
|
|
18
|
+
static readonly ERROR_CODE_INTERNAL = "INTERNAL_ERROR";
|
|
17
19
|
readonly type: ErrorType;
|
|
18
20
|
readonly code: string | number;
|
|
19
21
|
readonly severity: Severity;
|
|
@@ -21,6 +23,7 @@ export declare class NormalizedMessage {
|
|
|
21
23
|
readonly file?: string;
|
|
22
24
|
readonly line?: number;
|
|
23
25
|
readonly character?: number;
|
|
26
|
+
readonly stack?: string;
|
|
24
27
|
constructor(data: NormalizedMessageJson);
|
|
25
28
|
static createFromJSON(json: NormalizedMessageJson): NormalizedMessage;
|
|
26
29
|
static compare(messageA: NormalizedMessage, messageB: NormalizedMessage): number;
|
package/lib/NormalizedMessage.js
CHANGED
|
@@ -9,6 +9,7 @@ class NormalizedMessage {
|
|
|
9
9
|
this.file = data.file;
|
|
10
10
|
this.line = data.line;
|
|
11
11
|
this.character = data.character;
|
|
12
|
+
this.stack = data.stack;
|
|
12
13
|
}
|
|
13
14
|
static createFromJSON(json) {
|
|
14
15
|
return new NormalizedMessage(json);
|
|
@@ -28,6 +29,7 @@ class NormalizedMessage {
|
|
|
28
29
|
// code can be string (lint failure) or number (typescript error) - should the following line cater for this in some way?
|
|
29
30
|
NormalizedMessage.compareOptionalStrings(messageA.code, messageB.code) ||
|
|
30
31
|
NormalizedMessage.compareOptionalStrings(messageA.content, messageB.content) ||
|
|
32
|
+
NormalizedMessage.compareOptionalStrings(messageA.stack, messageB.stack) ||
|
|
31
33
|
0 /* EqualTo */);
|
|
32
34
|
}
|
|
33
35
|
static equals(messageA, messageB) {
|
|
@@ -88,7 +90,8 @@ class NormalizedMessage {
|
|
|
88
90
|
content: this.content,
|
|
89
91
|
file: this.file,
|
|
90
92
|
line: this.line,
|
|
91
|
-
character: this.character
|
|
93
|
+
character: this.character,
|
|
94
|
+
stack: this.stack
|
|
92
95
|
};
|
|
93
96
|
}
|
|
94
97
|
isDiagnosticType() {
|
|
@@ -112,5 +115,6 @@ NormalizedMessage.TYPE_LINT = 'lint';
|
|
|
112
115
|
// severity types
|
|
113
116
|
NormalizedMessage.SEVERITY_ERROR = 'error';
|
|
114
117
|
NormalizedMessage.SEVERITY_WARNING = 'warning';
|
|
118
|
+
NormalizedMessage.ERROR_CODE_INTERNAL = 'INTERNAL_ERROR';
|
|
115
119
|
exports.NormalizedMessage = NormalizedMessage;
|
|
116
120
|
//# sourceMappingURL=NormalizedMessage.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"NormalizedMessage.js","sourceRoot":"","sources":["../src/NormalizedMessage.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"NormalizedMessage.js","sourceRoot":"","sources":["../src/NormalizedMessage.ts"],"names":[],"mappings":";;AAcA,MAAa,iBAAiB;IAmB5B,YAAY,IAA2B;QACrC,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC;QACtB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC;QACtB,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,QAAQ,CAAC;QAC9B,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC,OAAO,CAAC;QAC5B,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC;QACtB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC;QACtB,IAAI,CAAC,SAAS,GAAG,IAAI,CAAC,SAAS,CAAC;QAChC,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC;IAC1B,CAAC;IAEM,MAAM,CAAC,cAAc,CAAC,IAA2B;QACtD,OAAO,IAAI,iBAAiB,CAAC,IAAI,CAAC,CAAC;IACrC,CAAC;IAEM,MAAM,CAAC,OAAO,CACnB,QAA2B,EAC3B,QAA2B;QAE3B,IAAI,CAAC,CAAC,QAAQ,YAAY,iBAAiB,CAAC,EAAE;YAC5C,OAAO,CAAC,CAAC,CAAC;SACX;QACD,IAAI,CAAC,CAAC,QAAQ,YAAY,iBA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,MAAM,CAAC;AAErD,iBAAiB;AACM,gCAAc,GAAa,OAAO,CAAC;AACnC,kCAAgB,GAAa,SAAS,CAAC;AAEvC,qCAAmB,GAAG,gBAAgB,CAAC;AARhE,8CA0KC"}
|
|
@@ -3,3 +3,4 @@ import * as tslint from 'tslint';
|
|
|
3
3
|
import { NormalizedMessage } from './NormalizedMessage';
|
|
4
4
|
export declare const makeCreateNormalizedMessageFromDiagnostic: (typescript: typeof ts) => (diagnostic: ts.Diagnostic) => NormalizedMessage;
|
|
5
5
|
export declare const makeCreateNormalizedMessageFromRuleFailure: () => (lint: tslint.RuleFailure) => NormalizedMessage;
|
|
6
|
+
export declare const makeCreateNormalizedMessageFromInternalError: () => (error: any) => NormalizedMessage;
|