gpt4 book ai didi

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

转载 作者:IT王子 更新时间:2023-10-29 03:08:40 24 4
gpt4 key购买 nike

我正在为 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/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com