javascript - 我在哪里可以找到 JSHint 数字错误代码的列表?

标签 javascript visual-studio jslint jshint

我正在为 Visual Studio 使用 JSHint。 JSHint 对我知道可以安全忽略的问题发出警告的情况并不少见。我一直在相关行上放置 //ignore jslint,但我看到我们也可以忽略特定的错误代码。来自1.0.0 rc1 release notes :

This version adds a unique numeric code to every warning and error message produced by JSHint. That means that you can now ignore any warning produced by JSHint even when there is no corresponding option for it. You can do that using the special minus (-) operator. For example, here’s how you ignore all messages about trailing decimal points (W047):

/*jshint -W047 */

看起来很酷,但尽我所能,我找不到所有错误代码的列表。 Visual Studio 的警告列表不提供数字错误代码,只提供错误文本。

这个列表肯定在某处,对吧?我真的花了一个小时谷歌搜索这个。但到目前为止还没有成功。

最佳答案

寻找此类内容的最佳地点是源代码(可在 GitHub 上找到)。您要查找的文件是 messages.js(版本:current release (2.9.5, 2017-06-22)master branch2.1.4 (source for the code below)):

var warnings = {
    W001: "'hasOwnProperty' is a really bad name.",
    W002: "Value of '{a}' may be overwritten in IE 8 and earlier.",
    W003: "'{a}' was used before it was defined.",
    W004: "'{a}' is already defined.",
    // ...
};

关于javascript - 我在哪里可以找到 JSHint 数字错误代码的列表?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17535130/

相关文章:

visual-studio - VS2019 : How to disable the error navigator in the scrollbar?

node.js - NodeJS 未使用的变量

javascript - 方法表达式不是函数类型

javascript - 下拉选择表单,转到提交时的 URL

javascript - 读取android扩展文件cordova

visual-studio - Visual Studio 团队套件

jquery - 如何在 Visual Studio 中通过 Nuget 获取最新的 jQuery 1.x?

plugins - 带有 JSLint 和 Violations 插件的 Jenkins

javascript - TypeError : window. 插件在phonegap中未定义

javascript - HTML 书状分页