简体   繁体   English

为eslint-loader启用--color

[英]Enable --color for eslint-loader

How can i enable color for eslint-loader's console output? 如何为eslint-loader's控制台输出启用颜色? When i run eslint --color --quiet --cache --format=node_modules/eslint-formatter-pretty . 当我运行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 . 我正在尝试找到一种方法来为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 干杯

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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