@k88/typescript-compile-error-formatter
v2.1.0
Published
Formats Typescript error messages from Fork TS Checker Webpack Plugin
Downloads
21,183
Maintainers
Readme
Installation
This formatter best works with the output of fork-ts-checker-webpack-plugin and is used as a peer dependency. Install both using:
npm install @k88/typescript-compile-error-formatter fork-ts-checker-webpack-plugin --save-dev
Usage
Use it for a formatted error message form fork-ts-checker-webpack-plugin:
import ForkTsCheckerWebpackPlugin from 'fork-ts-checker-webpack-plugin';
import typescriptFormatter from '@k88/typescript-compile-error-formatter';
forkTsCheckerWebpackPlugin
.getCompilerHooks(compiler)
.receive.tap('afterTypeScriptCheck', (diagnostics, lints) => {
[...diagnostics, ...lints].forEach(msg, => typescriptFormatter(msg, true));
});