我有这样的配置。
`module.exports = { "全局":{ "棱角分明":1 }, " env":{ "浏览器":是的, " commonjs":是的, " es6":是的 }, 扩展:['插件:angular / johnpapa',' eslint:recommended'],
"parserOptions": {
"sourceType": "module"
},
"plugins": [
"angular"
],
"rules": {
"no-console": 0,
"angular/ng_controller_name": 0,
"indent": [
"error",
"tab"
],
"linebreak-style": [
"error",
"unix"
],
"quotes": [
"error",
"single"
],
"semi": [
"error",
"always"
]
}
}; `
我在终端
中收到此警告 Filename must be "callsController.js" angular/file-name
答案 0 :(得分:4)
angular插件正在运行文件名规则,我默认猜测,因为我在规则列表中没有看到它。您应该能够在eslintrc中使用"angular/file-name":0
覆盖此内容。
答案 1 :(得分:2)
在规则部分的.eslintrc
添加"angular/file-name": 0
中,如下所示:
{
"extends": "eslint:recommended",
"plugins": ["angular"],
"env": {
...
},
"globals": {
"angular": true,
"module": true,
"inject": true
},
"rules": {
"angular/file-name": 0
}
}