fork-ts-checker-webpack-plugin 6.1.1 → 6.2.0

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 CHANGED
@@ -137,13 +137,13 @@ you can place your configuration in the:
137
137
 
138
138
  Options passed to the plugin constructor will overwrite options from the cosmiconfig (using [deepmerge](https://github.com/TehShrike/deepmerge)).
139
139
 
140
- | Name | Type | Default value | Description |
141
- | ----------------- | --------------------- | ------------------------------------------------------------------ | ----------- |
142
- | `async` | `boolean` | `compiler.options.mode === 'development'` | If `true`, reports issues **after** webpack's compilation is done. Thanks to that it doesn't block the compilation. Used only in the `watch` mode. |
143
- | `typescript` | `object` or `boolean` | `true` | If a `boolean`, it enables/disables TypeScript checker. If an `object`, see [TypeScript options](#typescript-options). |
144
- | `eslint` | `object` | `undefined` | If `undefined`, it disables ESLint linter. If an `object`, see [ESLint options](#eslint-options). |
145
- | `issue` | `object` | `{}` | See [Issues options](#issues-options). |
146
- | `formatter` | `string` or `object` | `codeframe` | Available formatters are `basic` and `codeframe`. To [configure](https://babeljs.io/docs/en/babel-code-frame#options) `codeframe` formatter, pass object: `{ type: 'codeframe', options: { <coderame options> } }`. |
140
+ | Name | Type | Default value | Description |
141
+ | ----------------- | ---------------------------------- | ------------------------------------------------------------------ | ----------- |
142
+ | `async` | `boolean` | `compiler.options.mode === 'development'` | If `true`, reports issues **after** webpack's compilation is done. Thanks to that it doesn't block the compilation. Used only in the `watch` mode. |
143
+ | `typescript` | `object` or `boolean` | `true` | If a `boolean`, it enables/disables TypeScript checker. If an `object`, see [TypeScript options](#typescript-options). |
144
+ | `eslint` | `object` | `undefined` | If `undefined`, it disables ESLint linter. If an `object`, see [ESLint options](#eslint-options). |
145
+ | `issue` | `object` | `{}` | See [Issues options](#issues-options). |
146
+ | `formatter` | `string` or `object` or `function` | `codeframe` | Available formatters are `basic`, `codeframe` and a custom `function`. To [configure](https://babeljs.io/docs/en/babel-code-frame#options) `codeframe` formatter, pass object: `{ type: 'codeframe', options: { <coderame options> } }`. |
147
147
  | `logger` | `object` | `{ infrastructure: 'silent', issues: 'console', devServer: true }` | Available loggers are `silent`, `console`, and `webpack-infrastructure`. Infrastructure logger prints additional information, issue logger prints `issues` in the `async` mode. If `devServer` is set to `false`, errors will not be reported to Webpack Dev Server. |
148
148
 
149
149
  ### TypeScript options
@@ -65,7 +65,7 @@ exports.ForkTsCheckerWebpackPlugin = ForkTsCheckerWebpackPlugin;
65
65
  /**
66
66
  * Current version of the plugin
67
67
  */
68
- ForkTsCheckerWebpackPlugin.version = '6.1.1'; // will be replaced by the @semantic-release/exec
68
+ ForkTsCheckerWebpackPlugin.version = '6.2.0'; // will be replaced by the @semantic-release/exec
69
69
  /**
70
70
  * Default pool for the plugin concurrency limit
71
71
  */
@@ -2,6 +2,6 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  const FormatterFactory_1 = require("./FormatterFactory");
4
4
  function createFormatterConfiguration(options) {
5
- return FormatterFactory_1.createFormatter(options ? (typeof options === 'string' ? options : options.type || 'codeframe') : 'codeframe', options && typeof options === 'object' ? options.options || {} : {});
5
+ return FormatterFactory_1.createFormatter(options ? (typeof options === 'object' ? options.type || 'codeframe' : options) : 'codeframe', options && typeof options === 'object' ? options.options || {} : {});
6
6
  }
7
7
  exports.createFormatterConfiguration = createFormatterConfiguration;
@@ -1,6 +1,6 @@
1
1
  import { Formatter } from './Formatter';
2
2
  import { BabelCodeFrameOptions } from './CodeFrameFormatter';
3
- declare type NotConfigurableFormatterType = undefined | 'basic';
3
+ declare type NotConfigurableFormatterType = undefined | 'basic' | Formatter;
4
4
  declare type ConfigurableFormatterType = 'codeframe';
5
5
  declare type FormatterType = NotConfigurableFormatterType | ConfigurableFormatterType;
6
6
  declare type ConfigurableFormatterOptions = {
@@ -4,14 +4,15 @@ const CodeFrameFormatter_1 = require("./CodeFrameFormatter");
4
4
  const BasicFormatter_1 = require("./BasicFormatter");
5
5
  // declare function implementation
6
6
  function createFormatter(type, options) {
7
- switch (type) {
8
- case 'basic':
9
- case undefined:
10
- return BasicFormatter_1.createBasicFormatter();
11
- case 'codeframe':
12
- return CodeFrameFormatter_1.createCodeFrameFormatter(options);
13
- default:
14
- throw new Error(`Unknown "${type}" formatter. Available types are: basic, codeframe.`);
7
+ if (typeof type === 'function') {
8
+ return type;
15
9
  }
10
+ if (typeof type === 'undefined' || type === 'basic') {
11
+ return BasicFormatter_1.createBasicFormatter();
12
+ }
13
+ if (type === 'codeframe') {
14
+ return CodeFrameFormatter_1.createCodeFrameFormatter(options);
15
+ }
16
+ throw new Error(`Unknown "${type}" formatter. Available types are: "basic", "codeframe" or a custom function.`);
16
17
  }
17
18
  exports.createFormatter = createFormatter;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "fork-ts-checker-webpack-plugin",
3
- "version": "6.1.1",
3
+ "version": "6.2.0",
4
4
  "description": "Runs typescript type checker and linter on separate process.",
5
5
  "keywords": [
6
6
  "fast",