idahogurl / vs-code-prettier-eslint

A Visual Studio Code Extension to format JavaScript and TypeScript code using the prettier-eslint package.
MIT License
195 stars 48 forks source link

Error: r is not a constructor #169

Closed tieniu1 closed 1 year ago

tieniu1 commented 1 year ago

Formatting a document results in an error

Expected behavior I hope this error reporting will go away. I have configured 'comma-dangle': [2,'always-multiline'] in .eslintrc, and when I format it, the first time it adds a comma, the second time it removes the comma, the third time it adds the comma, and so on

Screenshots

image

Versions (please complete the following information):

System Specifications (please complete the following information):

.eslintrc.js

module.exports = {
  root: true,
  env: {
    node: true
  },
  extends: ['plugin:vue/essential', 'eslint:recommended', '@vue/prettier'],
  // 'plugin:prettier/recommended'
  parserOptions: {
    parser: 'babel-eslint'
  },
  rules: {
    'prettier/prettier': 'warn',
    'no-console': process.env.ENV === 'production' ? 'warn' : 'off',
    'no-debugger': process.env.ENV === 'production' ? 'warn' : 'off',
    'no-unused-vars': 'off',
    'no-var': 'warn',
    'no-useless-escape': 'off',
    'vue/no-unused-vars': 'warn',
    'no-prototype-builtins': 'off',
    'vue/no-unused-components': 'off',
    'vue/no-side-effects-in-computed-properties': 'warn',
    'vue/script-setup-uses-vars': 'off',
    // 'comma-dangle':  [2,'always-multiline']
  },
  globals: {
    $: true,
    ELEMENT: true,
    BigNumber: true,
    _: true
  },
  ignorePatterns: []
}

package.json

{
  "name": "new-edurp-end",
  "version": "0.1.0",
  "private": true,
  "scripts": {
    "serve": "vue-cli-service serve ",
    "start": "vue-cli-service serve --progress --watch --colors --profile",
    "build-dev": "vue-cli-service build  --mode dev",
    "build-test": "vue-cli-service build --mode test",
    "build": "npm run build-dev && npm run build-test",
    "lint": "eslint --ext .js,.vue src --fix"
  },
  "dependencies": {
    "@vue/babel-helper-vue-jsx-merge-props": "^1.4.0",
    "@vue/babel-preset-jsx": "^1.4.0",
    "axios": "^1.1.2",
    "babel-polyfill": "^6.26.0",
    "core-js": "^3.6.5",
    "dayjs": "^1.10.7",
    "default-passive-events": "^2.0.0",
    "element-ui": "^2.13.2",
    "html2canvas": "^1.4.1",
    "js-cookie": "^2.2.1",
    "nprogress": "^0.2.0",
    "numeral": "^2.0.6",
    "qiniu-js": "^3.4.0",
    "qrcodejs2": "0.0.2",
    "vue": "^2.6.11",
    "vue-router": "^3.2.0",
    "vuedraggable": "^2.24.3",
    "vuex": "^3.4.0"
  },
  "devDependencies": {
    "@babel/plugin-syntax-jsx": "^7.18.6",
    "@vue/cli-plugin-babel": "~4.5.15",
    "@vue/cli-plugin-eslint": "~4.5.15",
    "@vue/cli-plugin-router": "~4.5.15",
    "@vue/cli-plugin-vuex": "~4.5.15",
    "@vue/cli-service": "~4.5.15",
    "@vue/eslint-config-prettier": "^6.0.0",
    "babel-eslint": "^10.1.0",
    "babel-plugin-dynamic-import-node": "^2.3.3",
    "eslint": "^7.32.0",
    "eslint-plugin-prettier": "^3.3.1",
    "eslint-plugin-vue": "^8.7.1",
    "prettier": "^2.2.1",
    "sass": "^1.26.5",
    "sass-loader": "^8.0.2",
    "vue-template-compiler": "^2.6.11",
    "webpack": "^4.46.0"
  }
}
tieniu1 commented 1 year ago

I restarted vscode today and there is no more this error, it works properly.