@becklyn/typescript-error-formatter

Error formatter for typescript errors

Stats

stars 🌟issues ⚠️updated 🛠created 🐣size 🏋️‍♀️
10May 22, 2019Feb 28, 2018Minified + gzip package size for @becklyn/typescript-error-formatter in KB

Readme

TypeScript Error Formatter

Installation

yarn add -D @becklyn/typescript-error-formatter

Usage

Add the formatter in your ts-loader config:

const formatter = require("@becklyn/typescript-error-formatter"); 

const config = {
    module: {
        rules: [
            {
                test: /\.tsx?$/,
                use: [
                    babelLoader,
                    {
                        loader: "ts-loader",
                        options: {
                            // ↓ ↓ ↓
                            errorFormatter: (message, colors) => formatter(message, colors, process.cwd()),
                            // ↑ ↑ ↑
                        },
                    },
                ],
            },
        ],
    },
};

Design

The design is inspired by Flow:

Screenshot of the design

If you find any bugs or have a feature request, please open an issue on github!

The npm package download data comes from npm's download counts api and package details come from npms.io.