我在我的angularjs项目中使用eslint。我的项目有一个Github与Codacy的集成(使用配置文件)。我已经在.eslintrc文件中配置了需要忽略的全局变量,如下所示:
{
"extends": "eslint:recommended",
"plugins": ["angular"],
"env": {
"browser": true,
"jasmine": true,
"node": true,
"es6": true,
"amd": true
},
"globals": {
"angular": true,
"module": true,
"inject": true,
"_": true,
"L": true,
"$": true,
"Highcharts": true,
"numeral": true
},
"rules": {
"angular/on-watch": 0,
"semi": 2
}
}这在IDE中工作得很好,并且我没有得到任何错误。但是Codacy没有提取全局忽略的变量,并一直抱怨没有定义角度、数字、Highcharts等。
'angular' is not defined. (no-undef)
'numeral' is not defined. (no-undef)如何修复此配置?
发布于 2020-01-30 00:17:43
您应该更改项目代码模式ESLint配置,以便在-> code Pattern-> ESLint中使用配置文件

干杯
https://stackoverflow.com/questions/56874207
复制相似问题