在Visual Studio代码中的eslint中未定义模块且未定义过程 [英] module is not defined and process is not defined in eslint in visual studio code

查看:241
本文介绍了在Visual Studio代码中的eslint中未定义模块且未定义过程的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经在机器上安装了eslint,并且使用了Visual Studio代码我有要导出的某些模块和过程当我尝试使用模块"或过程"时,它显示以前工作还不错.

I have installed eslint in my machine and i have used visual studio code i have certain modules and process to be exported When i try to use "module" or "process" it shows it was working fine before.

[eslint] 'module' is not defined. (no-undef)
[eslint] 'process' is not defined. (no-undef)

这是我的.eslintrc.json

and here is my .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"
    ]
}

}

我要删除此错误

推荐答案

您可能正在尝试在节点环境中运行它.

You are probably trying to run this in node environment.

env 部分应如下所示:

"env": {
    "browser": true,
    "amd": true,
    "node": true
},

这篇关于在Visual Studio代码中的eslint中未定义模块且未定义过程的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆