zoukankan      html  css  js  c++  java
  • vuecli eslint 语法错误解决办法

    {
      "name": "playvue",
      "version": "0.1.0",
      "private": true,
      "scripts": {
        "serve": "vue-cli-service serve",
        "build": "vue-cli-service build",
        "lint": "vue-cli-service lint"
      },
      "dependencies": {
        "core-js": "^3.6.4",
        "vue": "^2.6.11",
        "vue-router": "^3.1.6"
      },
      "devDependencies": {
        "@vue/cli-plugin-babel": "~4.3.0",
        "@vue/cli-plugin-eslint": "~4.3.0",
        "@vue/cli-plugin-router": "~4.3.0",
        "@vue/cli-service": "~4.3.0",
        "@vue/eslint-config-standard": "^5.1.2",
        "babel-eslint": "^10.1.0",
        "eslint": "^6.7.2",
        "eslint-plugin-import": "^2.20.2",
        "eslint-plugin-node": "^11.1.0",
        "eslint-plugin-promise": "^4.2.1",
        "eslint-plugin-standard": "^4.0.0",
        "eslint-plugin-vue": "^6.2.2",
        "less": "^3.0.4",
        "less-loader": "^5.0.0",
        "vue-template-compiler": "^2.6.11"
      },
      "eslintConfig": {
        "root": true,
        "env": {
          "node": true
        },
        "extends": [
          "plugin:vue/essential",
          "@vue/standard"
        ],
        "parserOptions": {
          "parser": "babel-eslint"
        },
        "rules": {
          "space-before-function-paren": [0, "always"],  //!!!
          "allowIndentationTabs": 0  
    /*
    • "off" or 0 - turn the rule off
    • "warn" or 1 - turn the rule on as a warning (doesn't affect exit code)
    • "error" or 2 - turn the rule on as an error (exit code is 1 when triggered)
      • "off" or 0 - turn the rule off
      • "warn" or 1 - turn the rule on as a warning (doesn't affect exit code)
      • "error" or 2 - turn the rule on as an error (exit code is 1 when triggered)   */
        }
      },
      "browserslist": [
        "> 1%",
        "last 2 versions",
        "not dead"
      ]
    }
    

    https://github.com/eslint/eslint/blob/master/docs/rules/no-tabs.md

    补充:VSCODE 每次FORMAT之后,要重新NPM RUN SERVE

    补充:npx eslint -init 生成 eslintrc.json(js)配置文件,在 rules 下配置后更省事。

        "rules": {
          "space-before-function-paren"0,
          "allowIndentationTabs"0,
          "indent"0
        }

    vscode .editorconfigrc

    [*.{js,jsx,ts,tsx,vue}]
    indent_style = space
    indent_size = 2
    trim_trailing_whitespace = true
    insert_final_newline = true
  • 相关阅读:
    【模拟】HDU 5752 Sqrt Bo
    【数学】HDU 5753 Permutation Bo
    【模拟】Codeforces 706A Beru-taxi
    【二分】Codeforces 706B Interesting drink
    【动态规划】Codeforces 706C Hard problem
    【字典树】【贪心】Codeforces 706D Vasiliy's Multiset
    【中国剩余定理】POJ 1006 & HDU 1370 Biorhythms
    计算机存储单位
    转载_Linux下查看文件和文件夹大小
    反问题_不适定_正则化
  • 原文地址:https://www.cnblogs.com/Jiaojiawang/p/12823940.html
Copyright © 2011-2022 走看看