tslint+vscode 配置问题

mikechen
  • 694

image.png
在学习 typescript+vue 的时候 编译报错 单双引号
我想要的时候实时出现错误 就是在写代码的时候就有红色的波浪线提示 而非等到编译才告知错误 求大佬解答
附上 tslint.json

{
 "defaultSeverity": "warning",
 "extends": [
   "tslint:recommended"
 ],
 "linterOptions": {
   "exclude": [
     "node_modules/**"
   ]
 },
 "rules": {
   "indent": [true, "spaces", 2],
   "interface-name": false,
   "no-consecutive-blank-lines": false,
   "object-literal-sort-keys": false,
   "ordered-imports": false,
   "quotemark": [true, "single"],
   "no-console": false
 }
}

tsconfig.json

{
"compilerOptions": {
  "target": "esnext",
  "module": "esnext",
  "strict": true,
  "jsx": "preserve",
  "importHelpers": true,
  "moduleResolution": "node",
  "experimentalDecorators": true,
  "emitDecoratorMetadata": true,
  "esModuleInterop": true,
  "allowSyntheticDefaultImports": true,
  "sourceMap": true,
  "baseUrl": ".",
  "types": [
    "webpack-env"
  ],
  "paths": {
    "@/*": [
      "src/*"
    ]
  },
  "lib": [
    "esnext",
    "dom",
    "dom.iterable",
    "scripthost"
  ]
},
"include": [
  "src/**/*.ts",
  "src/**/*.tsx",
  "src/**/*.vue",
  "tests/**/*.ts",
  "tests/**/*.tsx"
],
"exclude": [
  "node_modules"
]
}
回复
阅读 2.1k
1 个回答

vscode安装插件Prettier

撰写回答
你尚未登录,登录后可以
  • 和开发者交流问题的细节
  • 关注并接收问题和回答的更新提醒
  • 参与内容的编辑和改进,让解决方法与时俱进
宣传栏