Skip to content

Becklyn/typescript-error-formatter

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

Error formatter for typescript errors

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •