在vue-cli中禁用tslint修复

时间:2018-04-05 14:08:36

标签: tslint vue-cli

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

我在其vue-cli文档中找到了“--no-fix”参数,但它看起来并没有起作用。 (我正在使用npm run lint,其中{。1}}在package.json中)

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

1 个答案:

答案 0 :(得分:0)

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

{
  "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"
  }
}