ts-checker-rspack-plugin 1.1.7 → 1.2.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/README.md +69 -22
- package/lib/getDependenciesWorker.js +652 -0
- package/lib/getIssuesWorker.js +1095 -0
- package/lib/index.js +972 -4
- package/lib/issue/issue-config.d.ts +2 -0
- package/lib/issue/issue-options.d.ts +2 -0
- package/lib/issue/issue-severity.d.ts +4 -4
- package/lib/plugin-state.d.ts +0 -1
- package/lib/plugin.d.ts +1 -1
- package/lib/rpc/rpc-worker.d.ts +0 -1
- package/lib/rpc/wrap-rpc.d.ts +0 -1
- package/lib/typescript/worker/get-issues-worker.d.ts +2 -2
- package/lib/typescript/worker/lib/config.d.ts +2 -2
- package/lib/typescript/worker/lib/diagnostics.d.ts +3 -3
- package/lib/typescript/worker/lib/file-system/file-system.d.ts +0 -1
- package/lib/utils/async/abort-error.d.ts +0 -1
- package/lib/utils/async/pool.d.ts +0 -1
- package/lib/watch/watch-file-system.d.ts +0 -1
- package/package.json +12 -11
- package/lib/files-change.js +0 -57
- package/lib/files-match.js +0 -2
- package/lib/formatter/basic-formatter.js +0 -13
- package/lib/formatter/code-frame-formatter.js +0 -32
- package/lib/formatter/formatter-config.js +0 -36
- package/lib/formatter/formatter-options.js +0 -2
- package/lib/formatter/formatter.js +0 -2
- package/lib/formatter/index.js +0 -22
- package/lib/formatter/stats-formatter.js +0 -30
- package/lib/formatter/types/babel__code-frame.js +0 -7
- package/lib/formatter/webpack-formatter.js +0 -32
- package/lib/hooks/intercept-done-to-get-dev-server-tap.js +0 -18
- package/lib/hooks/tap-after-compile-to-add-dependencies.js +0 -59
- package/lib/hooks/tap-after-compile-to-get-issues.js +0 -43
- package/lib/hooks/tap-after-environment-to-patch-watching.js +0 -22
- package/lib/hooks/tap-done-to-async-get-issues.js +0 -74
- package/lib/hooks/tap-error-to-log-message.js +0 -32
- package/lib/hooks/tap-start-to-run-workers.js +0 -122
- package/lib/hooks/tap-stop-to-terminate-workers.js +0 -26
- package/lib/infrastructure-logger.js +0 -14
- package/lib/issue/index.js +0 -19
- package/lib/issue/issue-config.js +0 -29
- package/lib/issue/issue-location.js +0 -22
- package/lib/issue/issue-match.js +0 -20
- package/lib/issue/issue-options.js +0 -2
- package/lib/issue/issue-position.js +0 -16
- package/lib/issue/issue-predicate.js +0 -11
- package/lib/issue/issue-severity.js +0 -12
- package/lib/issue/issue-webpack-error.js +0 -31
- package/lib/issue/issue.js +0 -41
- package/lib/logger.js +0 -2
- package/lib/plugin-config.js +0 -26
- package/lib/plugin-hooks.js +0 -45
- package/lib/plugin-options.js +0 -2
- package/lib/plugin-pools.js +0 -32
- package/lib/plugin-state.js +0 -17
- package/lib/plugin.js +0 -74
- package/lib/rpc/expose-rpc.js +0 -69
- package/lib/rpc/index.js +0 -12
- package/lib/rpc/rpc-error.js +0 -12
- package/lib/rpc/rpc-worker.js +0 -86
- package/lib/rpc/types.js +0 -2
- package/lib/rpc/wrap-rpc.js +0 -70
- package/lib/typescript/type-script-config-overwrite.js +0 -2
- package/lib/typescript/type-script-diagnostics-options.js +0 -2
- package/lib/typescript/type-script-support.js +0 -31
- package/lib/typescript/type-script-worker-config.js +0 -36
- package/lib/typescript/type-script-worker-options.js +0 -2
- package/lib/typescript/worker/get-dependencies-worker.js +0 -15
- package/lib/typescript/worker/get-issues-worker.js +0 -70
- package/lib/typescript/worker/lib/artifacts.js +0 -94
- package/lib/typescript/worker/lib/config.js +0 -162
- package/lib/typescript/worker/lib/dependencies.js +0 -84
- package/lib/typescript/worker/lib/diagnostics.js +0 -112
- package/lib/typescript/worker/lib/emit.js +0 -13
- package/lib/typescript/worker/lib/file-system/file-system.js +0 -2
- package/lib/typescript/worker/lib/file-system/mem-file-system.js +0 -81
- package/lib/typescript/worker/lib/file-system/passive-file-system.js +0 -68
- package/lib/typescript/worker/lib/file-system/real-file-system.js +0 -171
- package/lib/typescript/worker/lib/host/compiler-host.js +0 -17
- package/lib/typescript/worker/lib/host/watch-compiler-host.js +0 -32
- package/lib/typescript/worker/lib/host/watch-solution-builder-host.js +0 -53
- package/lib/typescript/worker/lib/performance.js +0 -29
- package/lib/typescript/worker/lib/program/program.js +0 -37
- package/lib/typescript/worker/lib/program/solution-builder.js +0 -39
- package/lib/typescript/worker/lib/program/watch-program.js +0 -51
- package/lib/typescript/worker/lib/system.js +0 -229
- package/lib/typescript/worker/lib/tracing.js +0 -27
- package/lib/typescript/worker/lib/tsbuildinfo.js +0 -96
- package/lib/typescript/worker/lib/typescript.js +0 -6
- package/lib/typescript/worker/lib/worker-config.js +0 -5
- package/lib/utils/async/abort-error.js +0 -15
- package/lib/utils/async/controlled-promise.js +0 -17
- package/lib/utils/async/is-pending.js +0 -10
- package/lib/utils/async/pool.js +0 -36
- package/lib/utils/async/wait.js +0 -7
- package/lib/utils/path/forward-slash.js +0 -15
- package/lib/utils/path/is-inside-another-path.js +0 -22
- package/lib/utils/path/relative-to-context.js +0 -16
- package/lib/watch/inclusive-node-watch-file-system.js +0 -183
- package/lib/watch/watch-file-system.js +0 -2
package/README.md
CHANGED
|
@@ -119,45 +119,72 @@ Options for the TypeScript checker (`typescript` option object).
|
|
|
119
119
|
### Issues options
|
|
120
120
|
|
|
121
121
|
Options for the issues filtering (`issue` option object).
|
|
122
|
-
|
|
122
|
+
|
|
123
|
+
- **Type**:
|
|
123
124
|
|
|
124
125
|
```typescript
|
|
126
|
+
interface IssueOptions {
|
|
127
|
+
include?: IssuePredicateOption;
|
|
128
|
+
exclude?: IssuePredicateOption;
|
|
129
|
+
defaultSeverity?: 'auto' | 'warning' | 'error';
|
|
130
|
+
}
|
|
131
|
+
|
|
125
132
|
interface Issue {
|
|
126
133
|
severity: 'error' | 'warning';
|
|
127
134
|
code: string;
|
|
135
|
+
// file field supports glob matching
|
|
128
136
|
file?: string;
|
|
129
137
|
}
|
|
130
138
|
|
|
131
|
-
type IssueMatch = Partial<Issue>;
|
|
139
|
+
type IssueMatch = Partial<Issue>;
|
|
132
140
|
type IssuePredicate = (issue: Issue) => boolean;
|
|
133
|
-
type
|
|
141
|
+
type IssuePredicateOption = IssuePredicate | IssueMatch | (IssuePredicate | IssueMatch)[];
|
|
134
142
|
```
|
|
135
143
|
|
|
136
|
-
| Name
|
|
137
|
-
|
|
|
138
|
-
| `include`
|
|
139
|
-
| `exclude`
|
|
144
|
+
| Name | Type | Default value | Description |
|
|
145
|
+
| ----------------- | -------------------------------- | ------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
146
|
+
| `include` | `IssueFilter` | `undefined` | If `object`, defines issue properties that should be [matched](src/issue/issue-match.ts). If `function`, acts as a predicate where `issue` is an argument. |
|
|
147
|
+
| `exclude` | `IssueFilter` | `undefined` | Same as `include` but issues that match this predicate will be excluded. |
|
|
148
|
+
| `defaultSeverity` | `'auto' \| 'warning' \| 'error'` | `'auto'` | Controls how the plugin assigns the severity of emitted issues. |
|
|
149
|
+
|
|
150
|
+
`defaultSeverity` behavior:
|
|
151
|
+
|
|
152
|
+
- `auto`: Uses the default mapping based on the TypeScript diagnostic category (`Error` → `error`, `Warning` → `warning`).
|
|
153
|
+
- `warning`: Forces all issues to be emitted as warnings.
|
|
154
|
+
- `error`: Forces all issues to be emitted as errors.
|
|
140
155
|
|
|
141
|
-
|
|
142
|
-
<summary>Expand example</summary>
|
|
156
|
+
- **Example**:
|
|
143
157
|
|
|
144
158
|
Include issues from the `src` directory, exclude issues from `.spec.ts` files:
|
|
145
159
|
|
|
146
160
|
```js
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
exclude: [{ file: '**/*.spec.ts' }],
|
|
154
|
-
},
|
|
155
|
-
}),
|
|
156
|
-
],
|
|
157
|
-
};
|
|
161
|
+
new TsCheckerRspackPlugin({
|
|
162
|
+
issue: {
|
|
163
|
+
include: [{ file: '**/src/**/*' }],
|
|
164
|
+
exclude: [{ file: '**/*.spec.ts' }],
|
|
165
|
+
},
|
|
166
|
+
});
|
|
158
167
|
```
|
|
159
168
|
|
|
160
|
-
|
|
169
|
+
Exclude files under `/node_modules/` using `file:`:
|
|
170
|
+
|
|
171
|
+
```js
|
|
172
|
+
new TsCheckerRspackPlugin({
|
|
173
|
+
issue: {
|
|
174
|
+
exclude: [({ file = '' }) => /[\\/]some-folder[\\/]/.test(file)],
|
|
175
|
+
},
|
|
176
|
+
});
|
|
177
|
+
```
|
|
178
|
+
|
|
179
|
+
Force all issues to be emitted as warnings and do not break the build:
|
|
180
|
+
|
|
181
|
+
```js
|
|
182
|
+
new TsCheckerRspackPlugin({
|
|
183
|
+
issue: {
|
|
184
|
+
defaultSeverity: 'warning',
|
|
185
|
+
},
|
|
186
|
+
});
|
|
187
|
+
```
|
|
161
188
|
|
|
162
189
|
## Plugin hooks
|
|
163
190
|
|
|
@@ -220,7 +247,27 @@ setting "generateTrace" compiler option. This is an instruction from [microsoft/
|
|
|
220
247
|
|
|
221
248
|
## Enabling incremental mode
|
|
222
249
|
|
|
223
|
-
You must both set "incremental": true in your `tsconfig.json`
|
|
250
|
+
You must both set `"compilerOptions.incremental": true` in your `tsconfig.json` and also specify `build: true` in `TsCheckerRspackPlugin` settings.
|
|
251
|
+
|
|
252
|
+
- `tsconfig.json`:
|
|
253
|
+
|
|
254
|
+
```diff
|
|
255
|
+
{
|
|
256
|
+
"compilerOptions": {
|
|
257
|
+
+ "incremental": true,
|
|
258
|
+
}
|
|
259
|
+
}
|
|
260
|
+
```
|
|
261
|
+
|
|
262
|
+
- `TsCheckerRspackPlugin` settings:
|
|
263
|
+
|
|
264
|
+
```js
|
|
265
|
+
new TsCheckerRspackPlugin({
|
|
266
|
+
typescript: {
|
|
267
|
+
build: true,
|
|
268
|
+
},
|
|
269
|
+
});
|
|
270
|
+
```
|
|
224
271
|
|
|
225
272
|
## Vue components
|
|
226
273
|
|