gpt4 book ai didi

tslint - 在 vue-cli 中禁用 tslint 修复

转载 作者:行者123 更新时间:2023-12-04 12:45:23 26 4
gpt4 key购买 nike

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

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

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

最佳答案

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

关于tslint - 在 vue-cli 中禁用 tslint 修复,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49674448/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com