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

[BUG] vue-cli-service lint --fix 报错:缺少平台 undefined 插件 #1622

Closed
ModyQyW opened this issue Apr 29, 2020 · 4 comments
Closed

Comments

@ModyQyW
Copy link

ModyQyW commented Apr 29, 2020

问题描述

执行vue-cli-service lint --fix报错,提示缺少平台undefined插件

复现步骤

  1. 升级所有前缀为@dcloudio的依赖到版本2.0.0-26920200424005
  2. 执行vue-cli-service lint --fix

预期结果

输出 eslint 提示。

实际结果

执行vue-cli-service lint --fix提示缺少平台undefined插件

同时,vscode 的 eslint 也无法使用了。

package.json必要信息

{
  "scripts": {
    ...,
    "lint": "vue-cli-service lint --fix"
  },
  "dependencies": {
    "@dcloudio/uni-app-plus": "2.0.0-26920200424005",
    "@dcloudio/uni-h5": "2.0.0-26920200424005",
    "@dcloudio/uni-helper-json": "^1.0.5",
    "@dcloudio/uni-mp-alipay": "2.0.0-26920200424005",
    "@dcloudio/uni-mp-baidu": "2.0.0-26920200424005",
    "@dcloudio/uni-mp-qq": "2.0.0-26920200424005",
    "@dcloudio/uni-mp-toutiao": "2.0.0-26920200424005",
    "@dcloudio/uni-mp-weixin": "2.0.0-26920200424005",
    "@dcloudio/uni-stat": "2.0.0-26920200424005",
    "@modyqyw/mp-scss": "^1.0.2",
    "core-js": "^3.6.4",
    "dayjs": "^1.8.25",
    "lodash": "^4.17.15",
    "regenerator-runtime": "0.11.1",
    "vue": "^2.6.11",
    "vuex": "^3.3.0"
  },
  "devDependencies": {
    "@commitlint/cli": "^8.3.5",
    "@commitlint/config-angular": "^8.3.4",
    "@dcloudio/uni-cli-shared": "2.0.0-26920200424005",
    "@dcloudio/uni-migration": "2.0.0-26920200424005",
    "@dcloudio/uni-template-compiler": "2.0.0-26920200424005",
    "@dcloudio/vue-cli-plugin-hbuilderx": "2.0.0-26920200424005",
    "@dcloudio/vue-cli-plugin-uni": "2.0.0-26920200424005",
    "@dcloudio/vue-cli-plugin-uni-optimize": "2.0.0-26920200424005",
    "@dcloudio/webpack-uni-mp-loader": "2.0.0-26920200424005",
    "@dcloudio/webpack-uni-pages-loader": "2.0.0-26920200424005",
    "@fullhuman/postcss-purgecss": "^2.1.2",
    "@types/html5plus": "^1.0.0",
    "@types/uni-app": "^1.4.1",
    "@vue/cli-plugin-babel": "^4.3.1",
    "@vue/cli-plugin-eslint": "^4.3.1",
    "@vue/cli-plugin-vuex": "^4.3.1",
    "@vue/cli-service": "^4.3.1",
    "@vue/eslint-config-standard": "^5.1.2",
    "babel-eslint": "^10.1.0",
    "babel-plugin-import": "^1.13.0",
    "cross-env": "^7.0.2",
    "eslint": "^6.8.0",
    "eslint-plugin-import": "^2.20.2",
    "eslint-plugin-node": "^11.1.0",
    "eslint-plugin-promise": "^4.2.1",
    "eslint-plugin-standard": "^4.0.1",
    "eslint-plugin-vue": "^6.2.2",
    "lint-staged": "^10.1.7",
    "mini-types": "^0.1.1",
    "miniprogram-api-typings": "^2.10.4",
    "postcss-comment": "^2.0.0",
    "rimraf": "^3.0.2",
    "sass": "^1.26.5",
    "sass-loader": "^8.0.2",
    "stylelint": "^13.3.3",
    "stylelint-config-twbs-bootstrap": "^2.0.1",
    "stylelint-formatter-pretty": "^2.0.0",
    "stylelint-webpack-plugin": "^1.2.3",
    "vue-template-compiler": "^2.6.11"
  },
  "eslintConfig": {
    "root": true,
    "env": {
      "node": true
    },
    "globals": {
      "uni": "readonly",
      "plus": "readonly"
    },
    "extends": [
      "plugin:vue/essential",
      "@vue/standard"
    ],
    "rules": {
      "camelcase": "warn",
      "no-unused-vars": "warn"
    },
    "parserOptions": {
      "parser": "babel-eslint"
    }
  },
  "browserslist": [
    "last 3 versions",
    "Android >= 4.4",
    "ios >= 8"
  ],
  "gitHooks": {
    "commit-msg": "commitlint -e -V",
    "pre-commit": "lint-staged"
  },
  "lint-staged": {
    "*.{js,jsx,vue}": [
      "vue-cli-service lint --fix"
    ]
  }
  }
}

补充信息

希望dcloudio团队能在发布前自己先测试一下提供的功能,避免类似的情况再次发生。

@ModyQyW ModyQyW changed the title vue-cli-service lint --fix报错:缺少平台 undefined 插件 [BUG] vue-cli-service lint --fix 报错:缺少平台 undefined 插件 Apr 29, 2020
@ModyQyW
Copy link
Author

ModyQyW commented Apr 29, 2020

lint 与平台无关,希望尽快修正这一问题。

@PmcFizz
Copy link

PmcFizz commented May 6, 2020

这个问题解决了吗? 我复现了这个问题

@ModyQyW
Copy link
Author

ModyQyW commented May 6, 2020

这个问题解决了吗? 我复现了这个问题

请参考提供的commit暂时修复,或者回退到2.6.11对应的版本。

@TeddyTsui
Copy link

在package.json的相应 script 加上 cross-env NODE_ENV=development UNI_PLATFORM=h5

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

4 participants
@PmcFizz @TeddyTsui @ModyQyW and others