【问题标题】:Disable tslint fixes in vue-cli在 vue-cli 中禁用 tslint 修复
【发布时间】:2018-09-15 09:34:53
【问题描述】:

我需要不允许 tslint 修复发现的错误。例如,如果它发现逗号丢失,我需要它只告诉我它找到了它,而不是实际修复它。

我在它的 vue-cli 文档中找到了“--no-fix”参数,但它看起来并不工作。 (我使用npm run lint,其中"lint": "vue-cli-service lint --no-fix" 在package.json 中)

还有其他方法可以阻止 tslint 的自动修复吗?

【问题讨论】:

    标签: tslint vue-cli


    【解决方案1】:

    “--no-fix”选项对我有用。以下是我的配置,请检查您的 lint 版本:

    {
      "name": "frontend",
      "version": "0.1.0",
      "private": true,
      "scripts": {
        "serve": "vue-cli-service serve --port 3000",
        "build": "vue-cli-service build",
        "lint": "vue-cli-service lint --no-fix",
        "test:e2e": "vue-cli-service test:e2e",
        "test:unit": "vue-cli-service test:unit"
      },
      "dependencies": {
        "@riophae/vue-treeselect": "0.0.37",
        "axios": "^0.18.0",
        "bootstrap-vue": "^2.0.0-rc.11",
        "izitoast": "^1.4.0",
        "moment": "^2.22.2",
        "v-calendar": "^0.9.7",
        "v-select2-component": "^0.3.1",
        "vue": "^2.5.17",
        "vue-full-calendar": "^2.7.0",
        "vue-izitoast": "^1.1.2",
        "vue-js-modal": "^1.3.27",
        "vue-router": "^3.0.1",
        "vue2-daterange-picker": "^0.1.5",
        "vuejs-datepicker": "^1.5.4",
        "vuex": "^3.0.1"
      },
      "devDependencies": {
        "@vue/cli-plugin-babel": "^3.1.1",
        "@vue/cli-plugin-eslint": "^3.1.5",
        "@vue/cli-plugin-unit-jest": "^3.1.1",
        "@vue/cli-service": "^3.1.4",
        "@vue/eslint-config-standard": "^4.0.0",
        "@vue/test-utils": "^1.0.0-beta.20",
        "ajv": "^6.5.5",
        "babel-core": "7.0.0-bridge.0",
        "babel-eslint": "^10.0.1",
        "babel-jest": "^23.6.0",
        "eslint": "^5.8.0",
        "eslint-plugin-cypress": "^2.1.3",
        "eslint-plugin-vue": "^5.0.0-0",
        "node-sass": "^4.10.0",
        "sass-loader": "^7.1.0",
        "vue-template-compiler": "^2.5.17"
      }
    }
    

    【讨论】:

      猜你喜欢
      • 2019-03-14
      • 2016-12-09
      • 2021-08-20
      • 2018-11-22
      • 2019-03-18
      • 2020-09-03
      • 2020-06-05
      • 2018-08-13
      • 2020-06-19
      相关资源
      最近更新 更多