Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[feature] eslint-config-alloy@3 中建议将parser由babel-eslint升级为@babel/eslint-parser #240

Open
eyea opened this issue Mar 7, 2023 · 2 comments

Comments

@eyea
Copy link

eyea commented Mar 7, 2023

使用的是vue2.x

package.json文件依赖如下:

  "devDependencies": {
    "@babel/core": "^7.21.0",
    "@babel/eslint-parser": "^7.19.1",
    "@vue/cli-plugin-babel": "^3.3.0",
    "@vue/cli-plugin-eslint": "^3.3.0",
    "@vue/cli-service": "^3.3.0",
    "eslint": "^8.35.0",
    "eslint-config-alloy": "^3.10.0",
    "eslint-plugin-vue": "^9.9.0",
    "qs": "^6.7.0",
    "vue-eslint-parser": "^9.1.0",
    "vue-template-compiler": "^2.5.21"
  }

.eslintrc.js

module.exports = {
  extends: [
    'alloy',
    'alloy/vue'
  ],
  env: {
    // 你的环境变量(包含多个预定义的全局变量)
    //
    // browser: true,
    // node: true,
    // mocha: true,
    // jest: true,
    // jquery: true
  },
  globals: {
    // 你的全局变量(设置为 false 表示它不允许被重新赋值)
    //
    // myGlobal: false
  },
  rules: {
    // 自定义你的规则
  },
};

当运行 __eslint --ext .js,.vue src __

错误如下:

babel-eslint/lib/require-from-eslint.js not supported.

发现可能是是 parser 的版本问题(当我把base.js 和 vue.js的parser改为 @babel/eslint-parser 后,lint正常)

[babel-eslint]自 2020 年 3 月起已被弃用。

image

@eyea eyea changed the title [feature] 建议将parser由babel-eslint升级为@babel/eslint-parser [feature] eslint-config-alloy@3 中建议将parser由babel-eslint升级为@babel/eslint-parser Mar 7, 2023
@meteorlxy
Copy link
Collaborator

meteorlxy commented Jul 13, 2023

Should have been fixed

@meteorlxy
Copy link
Collaborator

😯 噢,没注意说的是 v3 版本

@meteorlxy meteorlxy reopened this Jul 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants