• 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
  • 相关阅读:
    软测试-计算机组成原理、系统和网络安全机构
    POJ 2044 Weather Forecast
    Cocos2d-x 3.x 头像选择,本地相册图片+图片编辑(Android、IOS双平台)
    Spring-----1、Spring一个简短的引论
    捕android程序崩溃日志
    java 正则表达式例子, 查找字符串
    java中Pattern.compile函数的相关解释
    java JdbcTemplate源码
    eclipse 常用快捷键整理
    java 正则表达式去除标点符号
  • 原文地址:https://www.cnblogs.com/Jiaojiawang/p/12823940.html
Copyright © 2020-2023  润新知