简体   繁体   English

将 WebStorm TSLint 错误行更改为警告行

[英]Change WebStorm TSLint error lines to warning lines

Is there a way to change in WebStorm the error red lines given by TSLint to a less alarming line (Warning or similar)?有没有办法在 WebStorm 中将 TSLint 给出的错误红线更改为不那么令人担忧的线(警告或类似)?

Below is an example of what I want to avoid:以下是我要避免的示例:

在此处输入图像描述

Integration with all linters (be it for JavaScript/TypeScript or PHP etc.) is done as an Inspection (so the results can be shown as errors/warnings and they can be run (results shown) via Code | Inspect Code ).与所有 linters(无论是用于 JavaScript/TypeScript 还是 PHP 等)的集成都是作为检查完成的(因此结果可以显示为错误/警告,并且可以通过Code | Inspect Code运行(显示结果))。 Therefore:所以:

  1. Settings/Preferences
  2. Editor | Inspections
  3. Find your linter (use local search box and look for tslint )找到你的 linter(使用本地搜索框并查找tslint
  4. Change Severity to a desired levelSeverity更改为所需级别

PS In theory , if linter itself provides a severity (eg it says "ERROR" on "WARNING" in actual error description (like TSLint from v5 does)).. then it may not be possible to override the severity (it depends on implementation from IDE side -- every linter has own integration implementation) . PS理论上,如果 linter 本身提供严重性(例如,它在实际错误描述中的“警告”上显示“错误”(就像 v5 中的 TSLint 那样))..那么可能无法覆盖严重性(这取决于实现从 IDE 方面——每个 linter 都有自己的集成实现) Sorry, cannot verify this moment as I'm not using TSLint.抱歉,现在无法验证,因为我没有使用 TSLint。

UPDATE 2018-05-17: There were some additional changes made in this regard ( WEB-26119 ) for next major 2018.2 version -- try it when it will become available (EAP program will start in nearest future).更新 2018-05-17:下一个主要 2018.2 版本在这方面做了一些额外的更改 ( WEB-26119 )——在它可用时尝试它(EAP 程序将在最近的将来启动)。

LazyOne's solution was already what I had in my setup. LazyOne 的解决方案已经在我的设置中。 But then I found this checkbox that solved the problem for me:但后来我发现这个复选框为我解决了问题:

在此处输入图像描述

Probably not the best way of doing it if you want to have a better granularization, but it might help some people如果您想获得更好的粒度,可能不是最好的方法,但它可能对某些人有所帮助

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

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