我有这个应用程序非常模块化,因此,JSHint 给了我'x' is defined but never used
错误。
我的设置是这样的:
应用程序/资产/脚本/bootstrap.js: var x = 5;
应用程序/资产/脚本/kickstart.js: console.log(x);
这是我从 JSHint 得到的输出:
app/assets/scripts/bootstrap.js
line 1 col 6 'x' is defined but never used.
app/assets/scripts/kickstart.js
line 1 col 13 'x' is not defined.
2 problems
我知道我可以使用类似的东西,/* exported x */
但如果我有很多这样的变量,那就太麻烦了。
无论如何,在不禁用其特定选项的情况下解决这两个问题吗?因为它们可以在其他更重要的情况下派上用场。