【发布时间】:2018-09-22 04:06:51
【问题描述】:
我已经在我的机器上安装了 eslint,并且我使用了 Visual Studio 代码 我有某些模块和流程要导出 当我尝试使用“模块”或“进程”时,它显示 它以前工作正常。
[eslint] 'module' is not defined. (no-undef)
[eslint] 'process' is not defined. (no-undef)
这是我的 .eslintrc.json
{
"env": {
"browser": true,
"amd": true
},
"parserOptions": {
"ecmaVersion": 6
},
"extends": "eslint:recommended",
"rules": {
"no-console": "off",
"indent": [
"error",
"tab"
],
"linebreak-style": [
"error",
"windows"
],
"quotes": [
"error",
"single"
],
"semi": [
"error",
"always"
]
}
}
我想删除这个错误
【问题讨论】:
-
我找到了,谢谢。我们需要添加“globals”:{“angular”:false,“module”:false,“inject”:false,“document”:false},“env”:{“browser”:true,“amd”:true , "node": true } 在 .eslintrc.json 文件中
-
谢谢 :) 这对我有用。你应该用一个简单的例子来回答这个问题。