简体   繁体   English

Eclipse中的ESLint将警告或信息显示为错误

[英]ESLint in Eclipse display errors as warn or info

I am using ESLint in Eclipse and the hints provided by ESLint are displayed as Errors (But they are only code improvement hints and not errors). 我在Eclipse中使用ESLint,ESLint提供的提示显示为错误(但它们只是代码改进提示,而不是错误)。

Is there a way i can configure ESLint / Eclipse to display those Errors as Warning or Info instead as Errors? 有没有一种方法可以配置ESLint / Eclipse将这些错误显示为警告或信息而不是错误?

ESLint automatically looks for .eslintrc.json files. ESLint自动查找.eslintrc.json文件。 You can run eslint --init to have ESLint create a configuration file for you, or you can create one manually. 您可以运行eslint --init来让ESLint为您创建配置文件,也可以手动创建一个配置文件。 Here's an example modified from the Getting Started guide : 这是《 入门指南》中修改的示例:

{
    "rules": {
        "eqeqeq": "off",
        "quotes": ["warn", "double"],
        "semi": ["error", "always"]
    }
}

In this example, the eqeqeq rule will be disabled, quotes will show warnings, and semi will give you errors. 在此示例中, eqeqeq规则将被禁用, quotes将显示警告,并且semi将给您错误。

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

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