如何在vue-cli 3项目中禁用ts-loader(tslint)检查?

问题描述 投票:0回答:1

当我运行yarn test:unit时,进程运行,然后几秒钟后显示Type checking in progress...,然后会出现一长串错误。

我尝试按照建议删除eslint但它没有用。

这是我的tsconfig.json(我没有tslint.json)

{
  "compilerOptions": {
    "target": "esnext",
    "module": "esnext",
    "strict": true, //noImplicitAny, noImplicitThis, alwaysStrict, strictNullChecks, strictFunctionTypes, strictPropertyInitialization
    "allowJs": true,
    "forceConsistentCasingInFileNames": true,
    "noImplicitReturns": true,
    "noUnusedLocals": true,
    "noUnusedParameters": true,
    "jsx": "preserve",
    "importHelpers": true,
    "moduleResolution": "node",
    "esModuleInterop": true,
    "allowSyntheticDefaultImports": true,
    "sourceMap": true,
    "baseUrl": ".",
    "types": ["webpack-env", "mocha", "chai"],
    "paths": {
      "@/*": ["src/*"]
    },
    "lib": ["esnext", "dom", "dom.iterable", "scripthost"]
  },
  "include": [
    "src/**/*.ts",
    "src/**/*.tsx",
    "src/**/*.vue",
    "tests/**/*.ts",
    "tests/**/*.tsx"
  ],
  "exclude": ["node_modules"]
}
typescript vue.js vue-cli-3
1个回答
0
投票

尝试在“tsconfig:json”"strict": false中更改标记“strict”

还要在同一文件夹中创建tslint.json文件,其中包含以下内容:

{
  "defaultSeverity": "warning",
  "extends": [
    "tslint:recommended"
  ],
  "linterOptions": {
    "exclude": [
      "node_modules/**"
    ]
  },
  "rules": {
    "quotemark": [
      true,
      "single"
    ],
    "indent": [
      true,
      "spaces",
      2
    ],
    "interface-name": false,
    "ordered-imports": false,
    "object-literal-sort-keys": false,
    "no-consecutive-blank-lines": false
  }
}
© www.soinside.com 2019 - 2024. All rights reserved.