为什么 ESLint 在 Visual Studio 2017 中的此配置不起作用?
Why is this configuration for ESLint in Visual Studio 2017 not working?
我目前想知道,为什么 ESLint 在 Visual Studio 2017 年无法在我的项目中工作。项目根目录中有文件“.eslintrc”:
{
"extends": "defaults/configurations/eslint",
"env": {
"browser": true
},
"globals": {
"xhr": true
},
"rules": {
"eqeqeq": [ "error", "always", { "null": "ignore" } ]
}
}
如果我删除带有 "eqeqeq" 的行,一切正常。但是只要我添加这一行,就不会显示任何错误。
问题 1:有什么方法可以查看关于 ESLint 明显存在的问题的错误消息?
作为回退的问题 2:此行有什么问题?
感谢 btmills,我深入研究了源代码并找到了版本:VS 2017 使用 ESLint 2.0.0(2016 年 2 月 12 日发布)。
正确的配置是:
"eqeqeq": [ 2, "allow-null" ]
文档可在此处获取:
VS 2017 错误列表中的链接指向当前文档,您可以在其中找到许多在 2.0.0 版中不起作用的功能。
我目前想知道,为什么 ESLint 在 Visual Studio 2017 年无法在我的项目中工作。项目根目录中有文件“.eslintrc”:
{
"extends": "defaults/configurations/eslint",
"env": {
"browser": true
},
"globals": {
"xhr": true
},
"rules": {
"eqeqeq": [ "error", "always", { "null": "ignore" } ]
}
}
如果我删除带有 "eqeqeq" 的行,一切正常。但是只要我添加这一行,就不会显示任何错误。
问题 1:有什么方法可以查看关于 ESLint 明显存在的问题的错误消息?
作为回退的问题 2:此行有什么问题?
感谢 btmills,我深入研究了源代码并找到了版本:VS 2017 使用 ESLint 2.0.0(2016 年 2 月 12 日发布)。
正确的配置是:
"eqeqeq": [ 2, "allow-null" ]
文档可在此处获取:
VS 2017 错误列表中的链接指向当前文档,您可以在其中找到许多在 2.0.0 版中不起作用的功能。