2.1.0 • Published 3 years ago

@k88/typescript-compile-error-formatter v2.1.0

Weekly downloads
965
License
ISC
Repository
github
Last release
3 years ago

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));
      });