简体   繁体   English

ESLint 无法识别根别名 (@)

[英]ESLint does not recognize root alias (@)

I've got a pretty much stock Vue CLI app (Typescript + Airbnb ESLint config) and ESLint cannot resolve my root alias (@), but the compiler and vscode have no trouble resolving it.我有一个非常多的 Vue CLI 应用程序(Typescript + Airbnb ESLint 配置),ESLint 无法解析我的根别名(@),但是编译器和 vscode 可以轻松解决它。 (See below). (见下文)。

在此处输入图片说明

I have another project with a similar setup and using the exact same machine, ESLint has no trouble resolving @.我有另一个具有类似设置并使用完全相同机器的项目,ESLint 在解析 @. What can I do here?我可以在这里做什么?

Solution: This is a bug in VSCode.解决方案:这是 VSCode 中的一个错误。 The folder that you have open in VSCode needs to be the direct parent of the project (Which it was not in my case).您在 VSCode 中打开的文件夹需要是项目的直接父级(在我的情况下不是)。

See: https://github.com/Microsoft/vscode-eslint/issues/405请参阅: https : //github.com/Microsoft/vscode-eslint/issues/405

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM