简体   繁体   English

JSHint可以输出有关全局变量的警告吗

[英]Can JSHint output warnings about globals

Is there an option parameter to force JSHint to check for explicitly defined global variables and output a warning? 是否有一个选项参数可以强制JSHint检查明确定义的全局变量并输出警告?

clarification: http://jsbin.com/odUcabUL/6/watch?js 澄清: http//jsbin.com/odUcabUL/6/watch?js

You might want to have a look at ESLint, which is a completely pluggable alternative to JSHint. 您可能想看看ESLint,它是JSHint的完全可插入的替代品。 Has a lot of rules already and if you can't find what you're looking for in there you can always write your own rule. 已经有很多规则,如果您在其中找不到想要的内容,则可以随时编写自己的规则。 There's a grunt task available too. 还有一个艰巨的任务。

  1. https://github.com/sindresorhus/grunt-eslint https://github.com/sindresorhus/grunt-eslint
  2. https://github.com/nzakas/eslint https://github.com/nzakas/eslint

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

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