vscode无法检测到错误的导入

时间:2019-02-09 12:53:12

标签: visual-studio-code vscode-settings tslint prettier react-tsx

我期望VSCode检测到错误的导入,但不会。

例如import a from './a.svg',其中不存在这样的东西,而不会运行项目以获取编译器错误,则不会引发任何实时错误(带红色下划线的错误)。

vscode settings
----------------
{
  "editor.formatOnSave": true,
  "prettier.tslintIntegration": true,
  "window.zoomLevel": 0,
  "typescript.updateImportsOnFileMove.enabled": "always",
  "workbench.colorTheme": "Oceanic Next Italic",
  "workbench.iconTheme": "vscode-icons",
  "editor.fontFamily": "'Droid Sans Mono', 'monospace', monospace, 'Droid Sans Fallback'",
  "editor.fontSize": 14
}

tslint.json
------------
{
  "defaultSeverity": "error",
  "extends": [
    "tslint:recommended",
    "tslint-react",
    "tslint-plugin-prettier",
    "tslint-config-prettier"
  ],
  "jsRules": {},
  "rules": {
    "prettier": [true, { "singleQuote": true }],
    "indent": [true, "spaces", 4],
    "no-irregular-whitespace": true,
    "no-trailing-whitespace": true
  },
  "rulesDirectory": []
}

我有一个autoimport插件已将其卸载。 可能是什么问题? tslint和相关的设置还是IDE本身?

0 个答案:

没有答案