fork-ts-checker-webpack-plugin 4.0.0-beta.3 → 4.0.2

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.
Files changed (91) hide show
  1. package/LICENSE +1 -1
  2. package/README.md +21 -73
  3. package/lib/ApiIncrementalChecker.d.ts +2 -15
  4. package/lib/ApiIncrementalChecker.js +79 -109
  5. package/lib/ApiIncrementalChecker.js.map +1 -1
  6. package/lib/CancellationToken.js +32 -24
  7. package/lib/CancellationToken.js.map +1 -1
  8. package/lib/CompilerHost.d.ts +7 -7
  9. package/lib/CompilerHost.js +225 -155
  10. package/lib/CompilerHost.js.map +1 -1
  11. package/lib/FilesRegister.d.ts +2 -4
  12. package/lib/FilesRegister.js +24 -23
  13. package/lib/FilesRegister.js.map +1 -1
  14. package/lib/FsHelper.js +9 -1
  15. package/lib/FsHelper.js.map +1 -1
  16. package/lib/IncrementalChecker.d.ts +2 -15
  17. package/lib/IncrementalChecker.js +146 -172
  18. package/lib/IncrementalChecker.js.map +1 -1
  19. package/lib/IncrementalCheckerInterface.d.ts +0 -4
  20. package/lib/IncrementalCheckerInterface.js.map +1 -1
  21. package/lib/LinkedList.js +38 -36
  22. package/lib/LinkedList.js.map +1 -1
  23. package/lib/Message.js.map +1 -1
  24. package/lib/RpcTypes.js.map +1 -1
  25. package/lib/VueProgram.d.ts +1 -1
  26. package/lib/VueProgram.js +92 -71
  27. package/lib/VueProgram.js.map +1 -1
  28. package/lib/createEslinter.d.ts +2 -2
  29. package/lib/createEslinter.js +13 -6
  30. package/lib/createEslinter.js.map +1 -1
  31. package/lib/formatter/CodeframeFormatter.js +41 -17
  32. package/lib/formatter/CodeframeFormatter.js.map +1 -1
  33. package/lib/formatter/DefaultFormatter.js +18 -8
  34. package/lib/formatter/DefaultFormatter.js.map +1 -1
  35. package/lib/formatter/Formatter.js.map +1 -1
  36. package/lib/formatter/FormatterFactory.js +2 -2
  37. package/lib/formatter/FormatterFactory.js.map +1 -1
  38. package/lib/formatter/InternalFormatter.js +17 -7
  39. package/lib/formatter/InternalFormatter.js.map +1 -1
  40. package/lib/formatter/RawFormatter.js +3 -3
  41. package/lib/formatter/RawFormatter.js.map +1 -1
  42. package/lib/formatter/index.js.map +1 -1
  43. package/lib/hooks.d.ts +0 -3
  44. package/lib/hooks.js +5 -16
  45. package/lib/hooks.js.map +1 -1
  46. package/lib/index.d.ts +2 -10
  47. package/lib/index.js +247 -377
  48. package/lib/index.js.map +1 -1
  49. package/lib/issue/Issue.js +6 -4
  50. package/lib/issue/Issue.js.map +1 -1
  51. package/lib/issue/IssueOrigin.d.ts +0 -1
  52. package/lib/issue/IssueOrigin.js +8 -9
  53. package/lib/issue/IssueOrigin.js.map +1 -1
  54. package/lib/issue/IssueSeverity.js +4 -2
  55. package/lib/issue/IssueSeverity.js.map +1 -1
  56. package/lib/issue/eslint/EsLintIssueFactory.d.ts +2 -2
  57. package/lib/issue/eslint/EsLintIssueFactory.js +17 -12
  58. package/lib/issue/eslint/EsLintIssueFactory.js.map +1 -1
  59. package/lib/issue/eslint/FileAwareEsLintMessage.d.ts +2 -2
  60. package/lib/issue/eslint/FileAwareEsLintMessage.js.map +1 -1
  61. package/lib/issue/eslint/index.js.map +1 -1
  62. package/lib/issue/index.d.ts +0 -1
  63. package/lib/issue/index.js +0 -1
  64. package/lib/issue/index.js.map +1 -1
  65. package/lib/issue/internal/InternalIssueFactory.d.ts +6 -1
  66. package/lib/issue/internal/InternalIssueFactory.js +5 -3
  67. package/lib/issue/internal/InternalIssueFactory.js.map +1 -1
  68. package/lib/issue/internal/index.js.map +1 -1
  69. package/lib/issue/typescript/TypeScriptIssueFactory.js +14 -14
  70. package/lib/issue/typescript/TypeScriptIssueFactory.js.map +1 -1
  71. package/lib/issue/typescript/index.js.map +1 -1
  72. package/lib/patchTypescript.js +27 -20
  73. package/lib/patchTypescript.js.map +1 -1
  74. package/lib/resolution.js +3 -11
  75. package/lib/resolution.js.map +1 -1
  76. package/lib/service.js +107 -63
  77. package/lib/service.js.map +1 -1
  78. package/lib/types/eslint.d.ts +33 -0
  79. package/lib/types/eslint.js +3 -0
  80. package/lib/types/eslint.js.map +1 -0
  81. package/lib/types/vue-options.js.map +1 -1
  82. package/package.json +11 -33
  83. package/lib/issue/tslint/TsLintIssueFactory.d.ts +0 -5
  84. package/lib/issue/tslint/TsLintIssueFactory.js +0 -25
  85. package/lib/issue/tslint/TsLintIssueFactory.js.map +0 -1
  86. package/lib/issue/tslint/index.d.ts +0 -1
  87. package/lib/issue/tslint/index.js +0 -7
  88. package/lib/issue/tslint/index.js.map +0 -1
  89. package/lib/linterConfigHelpers.d.ts +0 -10
  90. package/lib/linterConfigHelpers.js +0 -35
  91. package/lib/linterConfigHelpers.js.map +0 -1
package/LICENSE CHANGED
@@ -1,6 +1,6 @@
1
1
  MIT License
2
2
 
3
- Copyright (c) 2019 TypeStrong
3
+ Copyright (c) 2020 TypeStrong
4
4
 
5
5
  Permission is hereby granted, free of charge, to any person obtaining a copy
6
6
  of this software and associated documentation files (the "Software"), to deal
package/README.md CHANGED
@@ -15,7 +15,9 @@
15
15
 
16
16
  ## Installation
17
17
 
18
- This plugin requires minimum **webpack 2.3**, **TypeScript 2.1** and optionally **ESLint 6.0.0** or **TSLint 4.0**
18
+ This plugin requires minimum **Node.js 6.11.5**, **webpack 4**, **TypeScript 2.1** and optionally **ESLint 6** (which itself requires minimum **Node.js 8.10.0**)
19
+
20
+ If you depend on **webpack 2**, **webpack 3**, or **tslint 4**, please use [older version](https://github.com/TypeStrong/fork-ts-checker-webpack-plugin/tree/v3.1.1) of the plugin.
19
21
 
20
22
  ```sh
21
23
  # with npm
@@ -98,17 +100,6 @@ module.exports = {
98
100
 
99
101
  There's a good explanation on setting up TypeScript ESLint support by Robert Cooper [here](https://dev.to/robertcoopercode/using-eslint-and-prettier-in-a-typescript-project-53jb).
100
102
 
101
- ## TSLint
102
-
103
- *[TSLint is being replaced by ESLint](https://medium.com/palantir/tslint-in-2019-1a144c2317a9).
104
- https://eslint.org/blog/2019/01/future-typescript-eslint. As a consequence, support for TSLint in fork-ts-checker-webpack-plugin will be deprecated and removed in future versions of the plugin.*
105
-
106
- If you have installed [tslint](https://palantir.github.io/tslint), you can enable it by setting `tslint: true` or
107
- `tslint: './path/to/tslint.json'`. We recommend changing `defaultSeverity` to a `"warning"` in `tslint.json` file.
108
- It helps to distinguish lints from TypeScript's diagnostics.
109
-
110
-
111
-
112
103
  ## Options
113
104
 
114
105
  - **tsconfig** `string`:
@@ -124,34 +115,7 @@ It helps to distinguish lints from TypeScript's diagnostics.
124
115
  - **eslintOptions** `object`:
125
116
 
126
117
  - Options that can be used to initialise ESLint. See https://eslint.org/docs/1.0.0/developer-guide/nodejs-api#cliengine
127
-
128
- - **tslint** `string | true | undefined`:
129
-
130
- - If `string`, path to _tslint.json_ file to check source files against.
131
- - If `true`, path to `tslint.json` file will be computed with respect to currently checked file, just like TSLint
132
- CLI would do. Suppose you have a project:
133
-
134
- ```
135
- ./
136
- tslint.json
137
-
138
- src/
139
- file.ts
140
- anotherFile.ts
141
-
142
- lib/
143
- tslint.json
144
- someHelperFile.ts
145
- ```
146
-
147
- In such a case `src/file.ts` and `src/anotherFile.ts` would be checked against root `tslint.json`, and
148
- `src/lib/someHelperFile.ts` would be checked against `src/lib/tslint.json`.
149
-
150
- Default: `undefined`.
151
-
152
- - **tslintAutoFix** `boolean`:
153
- Passes on `--fix` flag while running `tslint` to auto fix linting errors. Default: false.
154
-
118
+
155
119
  - **async** `boolean`:
156
120
  True by default - `async: false` can block webpack's emit to wait for type checker/linter and to add errors to the webpack's compilation.
157
121
  We recommend to set this to `false` in projects where type checking is faster than webpack's build - it's better for integration with other plugins. Another scenario where you might want to set this to `false` is if you use the `overlay` functionality of `webpack-dev-server`.
@@ -160,7 +124,7 @@ It helps to distinguish lints from TypeScript's diagnostics.
160
124
  List of TypeScript diagnostic codes to ignore.
161
125
 
162
126
  - **ignoreLints** `string[]`:
163
- List of tslint rule names to ignore.
127
+ List of eslint rule names to ignore.
164
128
 
165
129
  - **ignoreLintWarnings** `boolean`:
166
130
  If true, will ignore all lint warnings.
@@ -204,7 +168,7 @@ new ForkTsCheckerWebpackPlugin({
204
168
 
205
169
  - **measureCompilationTime** `boolean`:
206
170
  If true, the plugin will measure the time spent inside the compilation code. This may be useful to compare modes,
207
- especially if there are other loaders/plugins involved in the compilation. **requires node 8+**
171
+ especially if there are other loaders/plugins involved in the compilation. **requires Node.js >= 8.5.0**
208
172
 
209
173
  - **typescript** `string`:
210
174
  If supplied this is a custom path where `typescript` can be found. Defaults to `require.resolve('typescript')`.
@@ -273,26 +237,21 @@ We hope this will be resolved in future; the issue can be tracked [here](https:/
273
237
 
274
238
  This plugin provides some custom webpack hooks (all are sync):
275
239
 
276
- | Event name | Hook Access Key | Description | Params |
277
- | --------------------------------------- | -------------------- | ------------------------------------------------------------------------------ | ------------------------------------------- |
278
- | `fork-ts-checker-cancel` | `cancel` | Cancellation has been requested | `cancellationToken` |
279
- | `fork-ts-checker-waiting` | `waiting` | Waiting for results | `hasTsLint` |
280
- | `fork-ts-checker-service-before-start` | `serviceBeforeStart` | Async plugin that can be used for delaying `fork-ts-checker-service-start` | - |
281
- | `fork-ts-checker-service-start` | `serviceStart` | Service will be started | `tsconfigPath`, `tslintPath`, `memoryLimit` |
282
- | `fork-ts-checker-service-start-error` | `serviceStartError` | Cannot start service | `error` |
283
- | `fork-ts-checker-service-out-of-memory` | `serviceOutOfMemory` | Service is out of memory | - |
284
- | `fork-ts-checker-receive` | `receive` | Plugin receives diagnostics and lints from service | `diagnostics`, `lints` |
285
- | `fork-ts-checker-emit` | `emit` | Service will add errors and warnings to webpack compilation ('build' mode) | `diagnostics`, `lints`, `elapsed` |
286
- | `fork-ts-checker-done` | `done` | Service finished type checking and webpack finished compilation ('watch' mode) | `diagnostics`, `lints`, `elapsed` |
287
-
288
- The **Event name** is there for backward compatibility with webpack 2/3. Regardless
289
- of the version of webpack (2, 3 or 4) you are using, we will always access plugin hooks with **Hook Access Keys** as
290
- described below.
240
+ | Hook Access Key | Description | Params |
241
+ | -------------------- | ------------------------------------------------------------------------------ | --------------------------------- |
242
+ | `cancel` | Cancellation has been requested | `cancellationToken` |
243
+ | `waiting` | Waiting for results | - |
244
+ | `serviceBeforeStart` | Async plugin that can be used for delaying `fork-ts-checker-service-start` | - |
245
+ | `serviceStart` | Service will be started | `tsconfigPath`, `memoryLimit` |
246
+ | `serviceStartError` | Cannot start service | `error` |
247
+ | `serviceOutOfMemory` | Service is out of memory | - |
248
+ | `receive` | Plugin receives diagnostics and lints from service | `diagnostics`, `lints` |
249
+ | `emit` | Service will add errors and warnings to webpack compilation ('build' mode) | `diagnostics`, `lints`, `elapsed` |
250
+ | `done` | Service finished type checking and webpack finished compilation ('watch' mode) | `diagnostics`, `lints`, `elapsed` |
291
251
 
292
252
  ### Accessing plugin hooks
293
253
 
294
- All plugin hooks are compatible with both [webpack](https://webpack.js.org) version
295
- 4 and version 2. To access plugin hooks and tap into the event, we need to use
254
+ To access plugin hooks and tap into the event, we need to use
296
255
  the `getCompilerHooks` static method. When we call this method with a [webpack compiler instance](https://webpack.js.org/api/node/),
297
256
  it returns the series of [tapable](https://github.com/webpack/tapable)
298
257
  hooks where you can pass in your callbacks.
@@ -384,14 +343,12 @@ if ('compilers' in compiler) {
384
343
 
385
344
  ```js
386
345
  new ForkTsCheckerWebpackPlugin({
387
- tslint: true,
388
346
  vue: true
389
347
  });
390
348
  ```
391
349
  Optionally change default [vue-template-compiler](https://github.com/vuejs/vue/tree/dev/packages/vue-template-compiler) to [nativescript-vue-template-compiler](https://github.com/nativescript-vue/nativescript-vue/tree/master/packages/nativescript-vue-template-compiler) if you use [nativescript-vue](https://github.com/nativescript-vue/nativescript-vue)
392
350
  ```
393
351
  new ForkTsCheckerWebpackPlugin({
394
- tslint: true,
395
352
  vue: { enabled: true, compiler: 'nativescript-vue-template-compiler' }
396
353
  });
397
354
  ```
@@ -426,16 +383,7 @@ new ForkTsCheckerWebpackPlugin({
426
383
  },
427
384
  ```
428
385
 
429
- 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:
430
-
431
- ```json
432
- {
433
- "defaultSeverity": "error",
434
- "extends": ["tslint-config-standard"]
435
- }
436
- ```
437
-
438
- 5. Ensure your `tsconfig.json` includes .vue files:
386
+ 4. Ensure your `tsconfig.json` includes .vue files:
439
387
 
440
388
  ```js
441
389
  // tsconfig.json
@@ -450,7 +398,7 @@ new ForkTsCheckerWebpackPlugin({
450
398
  }
451
399
  ```
452
400
 
453
- 6. It accepts any wildcard in your TypeScript configuration:
401
+ 5. It accepts any wildcard in your TypeScript configuration:
454
402
 
455
403
  ```js
456
404
  // tsconfig.json
@@ -475,7 +423,7 @@ new ForkTsCheckerWebpackPlugin({
475
423
  import Hello from '@/components/hello.vue'
476
424
  ```
477
425
 
478
- 7. If you are working in **VSCode**, you can get extensions [Vetur](https://marketplace.visualstudio.com/items?itemName=octref.vetur) and [TSLint Vue](https://marketplace.visualstudio.com/items?itemName=prograhammer.tslint-vue) to complete the developer workflow.
426
+ 6. If you are working in **VSCode**, you can get the [Vetur](https://marketplace.visualstudio.com/items?itemName=octref.vetur) extension to complete the developer workflow.
479
427
 
480
428
  ## Credits
481
429
 
@@ -2,28 +2,15 @@ import { IncrementalCheckerInterface, IncrementalCheckerParams } from './Increme
2
2
  import { CancellationToken } from './CancellationToken';
3
3
  import { CompilerHost } from './CompilerHost';
4
4
  export declare class ApiIncrementalChecker implements IncrementalCheckerInterface {
5
- private linterConfig?;
6
- private linterConfigs;
7
5
  protected readonly tsIncrementalCompiler: CompilerHost;
8
- private linterExclusions;
9
- private currentLintErrors;
10
6
  private currentEsLintErrors;
11
7
  private lastUpdatedFiles;
12
8
  private lastRemovedFiles;
13
- private readonly hasFixedConfig;
14
- private readonly context;
15
- private readonly linterConfigFile;
16
- private readonly linterAutoFix;
17
9
  private readonly eslinter;
18
- constructor({ typescript, context, programConfigFile, compilerOptions, linterConfigFile, linterAutoFix, eslinter, vue, checkSyntacticErrors, resolveModuleName, resolveTypeReferenceDirective }: IncrementalCheckerParams);
19
- private initLinterConfig;
20
- private getLinterConfig;
21
- private createLinter;
22
- hasTsLinter(): boolean;
10
+ constructor({ typescript, programConfigFile, compilerOptions, eslinter, vue, checkSyntacticErrors, resolveModuleName, resolveTypeReferenceDirective }: IncrementalCheckerParams);
23
11
  hasEsLinter(): boolean;
24
12
  isFileExcluded(filePath: string): boolean;
25
13
  nextIteration(): void;
26
- getTypeScriptIssues(_cancellationToken: CancellationToken): Promise<import("./issue/Issue").Issue[]>;
27
- getTsLintIssues(_cancellationToken: CancellationToken): Promise<import("./issue/Issue").Issue[]>;
14
+ getTypeScriptIssues(): Promise<import("./issue/Issue").Issue[]>;
28
15
  getEsLintIssues(cancellationToken: CancellationToken): Promise<import("./issue/Issue").Issue[]>;
29
16
  }
@@ -7,130 +7,100 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, ge
7
7
  step((generator = generator.apply(thisArg, _arguments || [])).next());
8
8
  });
9
9
  };
10
+ var __generator = (this && this.__generator) || function (thisArg, body) {
11
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
12
+ return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
13
+ function verb(n) { return function (v) { return step([n, v]); }; }
14
+ function step(op) {
15
+ if (f) throw new TypeError("Generator is already executing.");
16
+ while (_) try {
17
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
18
+ if (y = 0, t) op = [op[0] & 2, t.value];
19
+ switch (op[0]) {
20
+ case 0: case 1: t = op; break;
21
+ case 4: _.label++; return { value: op[1], done: false };
22
+ case 5: _.label++; y = op[1]; op = [0]; continue;
23
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
24
+ default:
25
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
26
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
27
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
28
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
29
+ if (t[2]) _.ops.pop();
30
+ _.trys.pop(); continue;
31
+ }
32
+ op = body.call(thisArg, _);
33
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
34
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
35
+ }
36
+ };
10
37
  Object.defineProperty(exports, "__esModule", { value: true });
11
- const path = require("path");
12
- const minimatch = require("minimatch");
13
- const linterConfigHelpers_1 = require("./linterConfigHelpers");
14
- const CompilerHost_1 = require("./CompilerHost");
15
- const FsHelper_1 = require("./FsHelper");
16
- const issue_1 = require("./issue");
17
- class ApiIncrementalChecker {
18
- constructor({ typescript, context, programConfigFile, compilerOptions, linterConfigFile, linterAutoFix, eslinter, vue, checkSyntacticErrors = false, resolveModuleName, resolveTypeReferenceDirective }) {
19
- this.linterConfigs = {};
20
- this.linterExclusions = [];
21
- this.currentLintErrors = new Map();
38
+ var CompilerHost_1 = require("./CompilerHost");
39
+ var issue_1 = require("./issue");
40
+ var ApiIncrementalChecker = /** @class */ (function () {
41
+ function ApiIncrementalChecker(_a) {
42
+ var typescript = _a.typescript, programConfigFile = _a.programConfigFile, compilerOptions = _a.compilerOptions, eslinter = _a.eslinter, vue = _a.vue, _b = _a.checkSyntacticErrors, checkSyntacticErrors = _b === void 0 ? false : _b, resolveModuleName = _a.resolveModuleName, resolveTypeReferenceDirective = _a.resolveTypeReferenceDirective;
22
43
  this.currentEsLintErrors = new Map();
23
44
  this.lastUpdatedFiles = [];
24
45
  this.lastRemovedFiles = [];
25
- this.getLinterConfig = linterConfigHelpers_1.makeGetLinterConfig(this.linterConfigs, this.linterExclusions, this.context);
26
- this.context = context;
27
- this.linterConfigFile = linterConfigFile;
28
- this.linterAutoFix = linterAutoFix;
29
46
  this.eslinter = eslinter;
30
- this.hasFixedConfig = typeof this.linterConfigFile === 'string';
31
- this.initLinterConfig();
32
47
  this.tsIncrementalCompiler = new CompilerHost_1.CompilerHost(typescript, vue, programConfigFile, compilerOptions, checkSyntacticErrors, resolveModuleName, resolveTypeReferenceDirective);
33
48
  }
34
- initLinterConfig() {
35
- if (!this.linterConfig && this.hasFixedConfig) {
36
- this.linterConfig = linterConfigHelpers_1.loadLinterConfig(this.linterConfigFile);
37
- if (this.linterConfig.linterOptions &&
38
- this.linterConfig.linterOptions.exclude) {
39
- // Pre-build minimatch patterns to avoid additional overhead later on.
40
- // Note: Resolving the path is required to properly match against the full file paths,
41
- // and also deals with potential cross-platform problems regarding path separators.
42
- this.linterExclusions = this.linterConfig.linterOptions.exclude.map(pattern => new minimatch.Minimatch(path.resolve(pattern)));
43
- }
44
- }
45
- }
46
- createLinter(program) {
47
- // tslint:disable-next-line:no-implicit-dependencies
48
- const { Linter } = require('tslint');
49
- return new Linter({ fix: this.linterAutoFix }, program);
50
- }
51
- hasTsLinter() {
52
- return !!this.linterConfigFile;
53
- }
54
- hasEsLinter() {
49
+ ApiIncrementalChecker.prototype.hasEsLinter = function () {
55
50
  return this.eslinter !== undefined;
56
- }
57
- isFileExcluded(filePath) {
58
- return (filePath.endsWith('.d.ts') ||
59
- this.linterExclusions.some(matcher => matcher.match(filePath)));
60
- }
61
- nextIteration() {
51
+ };
52
+ ApiIncrementalChecker.prototype.isFileExcluded = function (filePath) {
53
+ return filePath.endsWith('.d.ts');
54
+ };
55
+ ApiIncrementalChecker.prototype.nextIteration = function () {
62
56
  // do nothing
63
- }
64
- getTypeScriptIssues(_cancellationToken) {
65
- return __awaiter(this, void 0, void 0, function* () {
66
- const tsDiagnostics = yield this.tsIncrementalCompiler.processChanges();
67
- this.lastUpdatedFiles = tsDiagnostics.updatedFiles;
68
- this.lastRemovedFiles = tsDiagnostics.removedFiles;
69
- return issue_1.createIssuesFromTsDiagnostics(tsDiagnostics.results);
57
+ };
58
+ ApiIncrementalChecker.prototype.getTypeScriptIssues = function () {
59
+ return __awaiter(this, void 0, void 0, function () {
60
+ var tsDiagnostics;
61
+ return __generator(this, function (_a) {
62
+ switch (_a.label) {
63
+ case 0: return [4 /*yield*/, this.tsIncrementalCompiler.processChanges()];
64
+ case 1:
65
+ tsDiagnostics = _a.sent();
66
+ this.lastUpdatedFiles = tsDiagnostics.updatedFiles;
67
+ this.lastRemovedFiles = tsDiagnostics.removedFiles;
68
+ return [2 /*return*/, issue_1.createIssuesFromTsDiagnostics(tsDiagnostics.results)];
69
+ }
70
+ });
70
71
  });
71
- }
72
- getTsLintIssues(_cancellationToken) {
73
- return __awaiter(this, void 0, void 0, function* () {
74
- for (const updatedFile of this.lastUpdatedFiles) {
75
- if (this.isFileExcluded(updatedFile)) {
76
- continue;
72
+ };
73
+ ApiIncrementalChecker.prototype.getEsLintIssues = function (cancellationToken) {
74
+ return __awaiter(this, void 0, void 0, function () {
75
+ var _i, _a, removedFile, _b, _c, updatedFile, report, reports;
76
+ return __generator(this, function (_d) {
77
+ if (!this.eslinter) {
78
+ throw new Error('EsLint is not enabled in the plugin.');
79
+ }
80
+ for (_i = 0, _a = this.lastRemovedFiles; _i < _a.length; _i++) {
81
+ removedFile = _a[_i];
82
+ this.currentEsLintErrors.delete(removedFile);
77
83
  }
78
- try {
79
- const linter = this.createLinter(this.tsIncrementalCompiler.getProgram());
80
- const config = this.hasFixedConfig
81
- ? this.linterConfig
82
- : this.getLinterConfig(updatedFile);
83
- if (!config) {
84
+ for (_b = 0, _c = this.lastUpdatedFiles; _b < _c.length; _b++) {
85
+ updatedFile = _c[_b];
86
+ cancellationToken.throwIfCancellationRequested();
87
+ if (this.isFileExcluded(updatedFile)) {
84
88
  continue;
85
89
  }
86
- // const source = fs.readFileSync(updatedFile, 'utf-8');
87
- linter.lint(updatedFile, undefined, config);
88
- const lints = linter.getResult();
89
- this.currentLintErrors.set(updatedFile, lints);
90
- }
91
- catch (e) {
92
- if (FsHelper_1.fileExistsSync(updatedFile) &&
93
- // check the error type due to file system lag
94
- !(e instanceof Error) &&
95
- !(e.constructor.name === 'FatalError') &&
96
- !(e.message && e.message.trim().startsWith('Invalid source file'))) {
97
- // it's not because file doesn't exist - throw error
98
- throw e;
90
+ report = this.eslinter.getReport(updatedFile);
91
+ if (report !== undefined) {
92
+ this.currentEsLintErrors.set(updatedFile, report);
93
+ }
94
+ else if (this.currentEsLintErrors.has(updatedFile)) {
95
+ this.currentEsLintErrors.delete(updatedFile);
99
96
  }
100
97
  }
101
- for (const removedFile of this.lastRemovedFiles) {
102
- this.currentLintErrors.delete(removedFile);
103
- }
104
- }
105
- const allLints = [];
106
- for (const [, value] of this.currentLintErrors) {
107
- allLints.push(...value.failures);
108
- }
109
- return issue_1.createIssuesFromTsLintRuleFailures(allLints);
110
- });
111
- }
112
- getEsLintIssues(cancellationToken) {
113
- return __awaiter(this, void 0, void 0, function* () {
114
- for (const removedFile of this.lastRemovedFiles) {
115
- this.currentEsLintErrors.delete(removedFile);
116
- }
117
- for (const updatedFile of this.lastUpdatedFiles) {
118
- cancellationToken.throwIfCancellationRequested();
119
- if (this.isFileExcluded(updatedFile)) {
120
- continue;
121
- }
122
- const report = this.eslinter.getReport(updatedFile);
123
- if (report !== undefined) {
124
- this.currentEsLintErrors.set(updatedFile, report);
125
- }
126
- else if (this.currentEsLintErrors.has(updatedFile)) {
127
- this.currentEsLintErrors.delete(updatedFile);
128
- }
129
- }
130
- const reports = Array.from(this.currentEsLintErrors.values());
131
- return issue_1.createIssuesFromEsLintReports(reports);
98
+ reports = Array.from(this.currentEsLintErrors.values());
99
+ return [2 /*return*/, issue_1.createIssuesFromEsLintReports(reports)];
100
+ });
132
101
  });
133
- }
134
- }
102
+ };
103
+ return ApiIncrementalChecker;
104
+ }());
135
105
  exports.ApiIncrementalChecker = ApiIncrementalChecker;
136
106
  //# sourceMappingURL=ApiIncrementalChecker.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"ApiIncrementalChecker.js","sourceRoot":"","sources":["../src/ApiIncrementalChecker.ts"],"names":[],"mappings":";;;;;;;;;;AAMA,6BAA6B;AAC7B,uCAAuC;AAOvC,+DAI+B;AAC/B,iDAA8C;AAC9C,yCAA4C;AAE5C,mCAIiB;AAEjB,MAAa,qBAAqB;IAmBhC,YAAY,EACV,UAAU,EACV,OAAO,EACP,iBAAiB,EACjB,eAAe,EACf,gBAAgB,EAChB,aAAa,EACb,QAAQ,EACR,GAAG,EACH,oBAAoB,GAAG,KAAK,EAC5B,iBAAiB,EACjB,6BAA6B,EACJ;QA7BnB,kBAAa,GAAkD,EAAE,CAAC;QAGlE,qBAAgB,GAA2B,EAAE,CAAC;QAE9C,sBAAiB,GAAG,IAAI,GAAG,EAA6B,CAAC;QACzD,wBAAmB,GAAG,IAAI,GAAG,EAAuC,CAAC;QACrE,qBAAgB,GAAa,EAAE,CAAC;QAChC,qBAAgB,GAAa,EAAE,CAAC;QA4DhC,oBAAe,GAEc,yCAAmB,CACtD,IAAI,CAAC,aAAa,EAClB,IAAI,CAAC,gBAAgB,EACrB,IAAI,CAAC,OAAO,CACb,CAAC;QA5CA,IAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,IAAI,CAAC,gBAAgB,GAAG,gBAAgB,CAAC;QACzC,IAAI,CAAC,aAAa,GAAG,aAAa,CAAC;QACnC,IAAI,CAAC,QAAQ,GAAG,QAAQ,CAAC;QAEzB,IAAI,CAAC,cAAc,GAAG,OAAO,IAAI,CAAC,gBAAgB,KAAK,QAAQ,CAAC;QAEhE,IAAI,CAAC,gBAAgB,EAAE,CAAC;QAExB,IAAI,CAAC,qBAAqB,GAAG,IAAI,2BAAY,CAC3C,UAAU,EACV,GAAG,EACH,iBAAiB,EACjB,e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,OAAO,CAAC,EAAC;;;;KAC7D;IAEY,+CAAe,GAA5B,UAA6B,iBAAoC;;;;gBAC/D,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE;oBAClB,MAAM,IAAI,KAAK,CAAC,sCAAsC,CAAC,CAAC;iBACzD;gBAED,WAA+C,EAArB,KAAA,IAAI,CAAC,gBAAgB,EAArB,cAAqB,EAArB,IAAqB,EAAE;oBAAtC,WAAW;oBACpB,IAAI,CAAC,mBAAmB,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC;iBAC9C;gBAED,WAA+C,EAArB,KAAA,IAAI,CAAC,gBAAgB,EAArB,cAAqB,EAArB,IAAqB,EAAE;oBAAtC,WAAW;oBACpB,iBAAiB,CAAC,4BAA4B,EAAE,CAAC;oBACjD,IAAI,IAAI,CAAC,cAAc,CAAC,WAAW,CAAC,EAAE;wBACpC,SAAS;qBACV;oBAEK,MAAM,GAAG,IAAI,CAAC,QAAQ,CAAC,SAAS,CAAC,WAAW,CAAC,CAAC;oBAEpD,IAAI,MAAM,KAAK,SAAS,EAAE;wBACxB,IAAI,CAAC,mBAAmB,CAAC,GAAG,CAAC,WAAW,EAAE,MAAM,CAAC,CAAC;qBACnD;yBAAM,IAAI,IAAI,CAAC,mBAAmB,CAAC,GAAG,CAAC,WAAW,CAAC,EAAE;wBACpD,IAAI,CAAC,mBAAmB,CAAC,MAAM,CAAC,WAAW,CAAC,CAAC;qBAC9C;iBACF;gBAEK,OAAO,GAAG,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,mBAAmB,CAAC,MAAM,EAAE,CAAC,CAAC;gBAC9D,sBAAO,qCAA6B,CAAC,OAAO,CAAC,EAAC;;;KAC/C;IACH,4BAAC;AAAD,CAAC,AA/ED,IA+EC;AA/EY,sDAAqB"}
@@ -1,58 +1,66 @@
1
1
  "use strict";
2
+ var __importStar = (this && this.__importStar) || function (mod) {
3
+ if (mod && mod.__esModule) return mod;
4
+ var result = {};
5
+ if (mod != null) for (var k in mod) if (Object.hasOwnProperty.call(mod, k)) result[k] = mod[k];
6
+ result["default"] = mod;
7
+ return result;
8
+ };
2
9
  Object.defineProperty(exports, "__esModule", { value: true });
3
- const crypto = require("crypto");
4
- const fs = require("fs");
5
- const os = require("os");
6
- const path = require("path");
7
- const FsHelper_1 = require("./FsHelper");
8
- class CancellationToken {
9
- constructor(typescript, cancellationFileName, isCancelled) {
10
+ var crypto = __importStar(require("crypto"));
11
+ var fs = __importStar(require("fs"));
12
+ var os = __importStar(require("os"));
13
+ var path = __importStar(require("path"));
14
+ var FsHelper_1 = require("./FsHelper");
15
+ var CancellationToken = /** @class */ (function () {
16
+ function CancellationToken(typescript, cancellationFileName, isCancelled) {
10
17
  this.typescript = typescript;
11
18
  this.isCancelled = !!isCancelled;
12
19
  this.cancellationFileName =
13
20
  cancellationFileName || crypto.randomBytes(64).toString('hex');
14
21
  this.lastCancellationCheckTime = 0;
15
22
  }
16
- static createFromJSON(typescript, json) {
23
+ CancellationToken.createFromJSON = function (typescript, json) {
17
24
  return new CancellationToken(typescript, json.cancellationFileName, json.isCancelled);
18
- }
19
- toJSON() {
25
+ };
26
+ CancellationToken.prototype.toJSON = function () {
20
27
  return {
21
28
  cancellationFileName: this.cancellationFileName,
22
29
  isCancelled: this.isCancelled
23
30
  };
24
- }
25
- getCancellationFilePath() {
31
+ };
32
+ CancellationToken.prototype.getCancellationFilePath = function () {
26
33
  return path.join(os.tmpdir(), this.cancellationFileName);
27
- }
28
- isCancellationRequested() {
34
+ };
35
+ CancellationToken.prototype.isCancellationRequested = function () {
29
36
  if (this.isCancelled) {
30
37
  return true;
31
38
  }
32
- const time = Date.now();
33
- const duration = Math.abs(time - this.lastCancellationCheckTime);
39
+ var time = Date.now();
40
+ var duration = Math.abs(time - this.lastCancellationCheckTime);
34
41
  if (duration > 10) {
35
42
  // check no more than once every 10ms
36
43
  this.lastCancellationCheckTime = time;
37
44
  this.isCancelled = FsHelper_1.fileExistsSync(this.getCancellationFilePath());
38
45
  }
39
46
  return this.isCancelled;
40
- }
41
- throwIfCancellationRequested() {
47
+ };
48
+ CancellationToken.prototype.throwIfCancellationRequested = function () {
42
49
  if (this.isCancellationRequested()) {
43
50
  throw new this.typescript.OperationCanceledException();
44
51
  }
45
- }
46
- requestCancellation() {
52
+ };
53
+ CancellationToken.prototype.requestCancellation = function () {
47
54
  fs.writeFileSync(this.getCancellationFilePath(), '');
48
55
  this.isCancelled = true;
49
- }
50
- cleanupCancellation() {
56
+ };
57
+ CancellationToken.prototype.cleanupCancellation = function () {
51
58
  if (this.isCancelled && FsHelper_1.fileExistsSync(this.getCancellationFilePath())) {
52
59
  fs.unlinkSync(this.getCancellationFilePath());
53
60
  this.isCancelled = false;
54
61
  }
55
- }
56
- }
62
+ };
63
+ return CancellationToken;
64
+ }());
57
65
  exports.CancellationToken = CancellationToken;
58
66
  //# sourceMappingURL=CancellationToken.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"CancellationToken.js","sourceRoot":"","sources":["../src/CancellationToken.ts"],"names":[],"mappings":";;AAAA,iCAAiC;AACjC,yBAAyB;AACzB,yBAAyB;AACzB,6BAA6B;AAI7B,yCAA4C;AAO5C,MAAa,iBAAiB;IAI5B,YACU,UAAqB,EAC7B,oBAA6B,EAC7B,WAAqB;QAFb,eAAU,GAAV,UAAU,CAAW;QAI7B,IAAI,CAAC,WAAW,GAAG,CAAC,CAAC,WAAW,CAAC;QACjC,IAAI,CAAC,oBAAoB;YACvB,oBAAoB,IAAI,MAAM,CAAC,WAAW,CAAC,EAAE,CAAC,CAAC,QAAQ,CAAC,KAAK,CAAC,CAAC;QACjE,IAAI,CAAC,yBAAyB,GAAG,CAAC,CAAC;IACrC,CAAC;IAEM,MAAM,CAAC,cAAc,CAC1B,UAAqB,EACrB,IAA2B;QAE3B,OAAO,IAAI,iBAAiB,CAC1B,UAAU,EACV,IAAI,CAAC,oBAAoB,EACzB,IAAI,CAAC,WAAW,CACjB,CAAC;IACJ,CAAC;IAEM,MAAM;QACX,OAAO;YACL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AAI,CAAC,WAAW,GAAG,yBAAc,CAAC,IAAI,CAAC,uBAAuB,EAAE,CAAC,CAAC;SACnE;QAED,OAAO,IAAI,CAAC,WAAW,CAAC;IAC1B,CAAC;IAEM,wDAA4B,GAAnC;QACE,IAAI,IAAI,CAAC,uBAAuB,EAAE,EAAE;YAClC,MAAM,IAAI,IAAI,CAAC,UAAU,CAAC,0BAA0B,EAAE,CAAC;SACxD;IACH,CAAC;IAEM,+CAAmB,GAA1B;QACE,EAAE,CAAC,aAAa,CAAC,IAAI,CAAC,uBAAuB,EAAE,EAAE,EAAE,CAAC,CAAC;QACrD,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC;IAC1B,CAAC;IAEM,+CAAmB,GAA1B;QACE,IAAI,IAAI,CAAC,WAAW,IAAI,yBAAc,CAAC,IAAI,CAAC,uBAAuB,EAAE,CAAC,EAAE;YACtE,EAAE,CAAC,UAAU,CAAC,IAAI,CAAC,uBAAuB,EAAE,CAAC,CAAC;YAC9C,IAAI,CAAC,WAAW,GAAG,KAAK,CAAC;SAC1B;IACH,CAAC;IACH,wBAAC;AAAD,CAAC,AAvED,IAuEC;AAvEY,8CAAiB"}
@@ -25,11 +25,11 @@ export declare class CompilerHost implements ts.WatchCompilerHostOfConfigFile<ts
25
25
  updatedFiles: string[];
26
26
  removedFiles: string[];
27
27
  }>;
28
- setTimeout(callback: (...args: any[]) => void, _ms: number, ...args: any[]): any;
28
+ setTimeout(callback: (...args: any[]) => void, ms: number, ...args: any[]): any;
29
29
  clearTimeout(timeoutId: any): void;
30
- onWatchStatusChange(_diagnostic: ts.Diagnostic, _newLine: string, _options: ts.CompilerOptions): void;
30
+ onWatchStatusChange(): void;
31
31
  watchDirectory(path: string, callback: ts.DirectoryWatcherCallback, recursive?: boolean): ts.FileWatcher;
32
- watchFile(path: string, callback: ts.FileWatcherCallback, _pollingInterval?: number): ts.FileWatcher;
32
+ watchFile(path: string, callback: ts.FileWatcherCallback, pollingInterval?: number): ts.FileWatcher;
33
33
  fileExists(path: string): boolean;
34
34
  readFile(path: string, encoding?: string): string | undefined;
35
35
  directoryExists(path: string): boolean;
@@ -43,9 +43,9 @@ export declare class CompilerHost implements ts.WatchCompilerHostOfConfigFile<ts
43
43
  realpath(path: string): string;
44
44
  trace(s: string): void;
45
45
  useCaseSensitiveFileNames(): boolean;
46
- onUnRecoverableConfigFileDiagnostic(_diag: ts.Diagnostic): void;
46
+ onUnRecoverableConfigFileDiagnostic(): void;
47
47
  afterProgramCreate(program: ts.EmitAndSemanticDiagnosticsBuilderProgram): void;
48
- createDirectory(_path: string): void;
49
- writeFile(_path: string, _data: string, _writeByteOrderMark?: boolean): void;
50
- onCachedDirectoryStructureHostCreate?(_host: any): void;
48
+ createDirectory(): void;
49
+ writeFile(): void;
50
+ onCachedDirectoryStructureHostCreate?(): void;
51
51
  }