An open API service indexing awesome lists of open source software.

https://github.com/becklyn/typescript-error-formatter

Error formatter for typescript errors
https://github.com/becklyn/typescript-error-formatter

Last synced: about 1 month ago
JSON representation

Error formatter for typescript errors

Awesome Lists containing this project

README

        

TypeScript Error Formatter
==========================

Installation
------------

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

Usage
-----

Add the formatter in your `ts-loader` config:

```js
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](docs/screenshot.png)