H5W3
当前位置:H5W3 > 其他技术问题 > 正文

【前端问题精选】tslint+vscode 配置问题

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

回答:

vscode安装插件Prettier

本文地址:H5W3 » 【前端问题精选】tslint+vscode 配置问题

评论 0

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址