简体   繁体   中英

Enable --color for eslint-loader

How can i enable color for eslint-loader's console output? When i run eslint --color --quiet --cache --format=node_modules/eslint-formatter-pretty . for example, the output will be colored with nice white/yellow/red/green colors.

I am trying to find a way to enable the same for webpack eslint-loader . Here is my eslint rule:

{
  test: /\.jsx?$/,
  enforce: "pre",
  exclude: /node_modules/,
  loader: "eslint-loader",
  options: {
    formatter: require("eslint-formatter-pretty"),
    failOnWarning: false,
    failOnError: true
  }
},

This is a little bit late but what you can do is simply adding the option in the command line like so :

webpack --color

Cheers

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM