Hen*_*nry 4 typescript eslint tslint visual-studio-code
在我的 settings.json 中,我有:
"eslint.validate": [
"javascript",
"javascriptreact",
"typescript",
"typescriptreact"
]
Run Code Online (Sandbox Code Playgroud)
然而我的打字稿支持不起作用。它在运行时捕获错误,但不显示红色波浪线(下面的示例)。
启用 ESLint 时我也会收到错误,并且当我启用 ESLint 时 Prettier 不起作用:
ESLint: Failed to load parser '@typescript-eslint/parser' declared in 'template/.eslintrc.js': Cannot find module 'typescript' Require stack: - /Users/henryboisdequin/Desktop/MyAwesomeProject/node_modules/@typescript-eslint/typescript-estree/dist/parser.js - /Users/henryboisdequin/Desktop/MyAwesomeProject/node_modules/@typescript-eslint/typescript-estree/dist/index.js - /Users/henryboisdequin/Desktop/MyAwesomeProject/node_modules/@typescript-eslint/parser/dist/parser.js - /Users/henryboisdequin/Desktop/MyAwesomeProject/node_modules/@typescript-eslint/parser/dist/index.js - /Users/henryboisdequin/Desktop/MyAwesomeProject/node_modules/eslint/lib/cli-engine/config-array-factory.js - /Users/henryboisdequin/Desktop/MyAwesomeProject/node_modules/eslint/lib/cli-engine/cascading-config-array-factory.js - /Users/henryboisdequin/Desktop/MyAwesomeProject/node_modules/eslint/lib/cli-engine/cli-engine.js - /Users/henryboisdequin/Desktop/MyAwesomeProject/node_modules/eslint/lib/cli-engine/index.j
Run Code Online (Sandbox Code Playgroud)
我该如何解决这个问题?
解决此问题的方法是按照以下步骤操作:
关闭 VSCode
CD 进入应用程序
/Users/<user>/Library/Application\ Support
Run Code Online (Sandbox Code Playgroud)
ls
Run Code Online (Sandbox Code Playgroud)
rm -rf code/ or .vscode/
Run Code Online (Sandbox Code Playgroud)
打开 VSCode - 那里应该有你所有的扩展,但是像你的主题、扩展设置之类的东西不会被配置 -
现在所有内容(扩展设置、主题等)都将被重置
| 归档时间: |
|
| 查看次数: |
8144 次 |
| 最近记录: |