Where can I find a list of JSHint numeric error codes?

孤者浪人 提交于 2019-12-02 17:26:07
James Allardice

The best place to look for things like that is the source (which is available on GitHub). The file you're looking for is messages.js (versions: current release (2.9.5, 2017-06-22), master branch, 2.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.",
    // ...
};

Not So Final Edit: Looks like a new site has been stood up that covers all the previous functionality: http://linterrors.com/js

I would recommend: http://jslinterrors.com/

This isn't a side-by-side list of all the errors, but it has each error (broken out by JSLint, JSHint, and ESLint) which include the specific error code per item.

For just JSHint, you can scope the view: http://jslinterrors.com/?linter=jshint

Final Edit: Looks like the site has gone under and is up for sale.

Edit: The codes can be found at the bottom of each section, if it relates to a fatal syntax the code cannot be suppressed.

Edit 2: Looks like they've added ESLint as well.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!