小编jsu*_*cks的帖子

Yarn 3.x PNP typescript CRA eslint 不适用于 VSCode

我已经尝试这个9个小时了。我已经浏览了我在互联网上可以找到的每一个 github 问题、博客、链接,并尝试了一百多次。最后我把它发布在这里。

我正在使用yarn berry 3.0.2。我做到了yarn dlx create-react-app ./ --template typescript。到目前为止,一切都很好。然后我安装了yarn vscode sdk以与零安装PNP一起使用。并添加了反应+打字稿+爱彼迎配置。Linting 也可以工作,但只能从命令行进行。我只是无法启用 eslint vscode 扩展。我总是得到

o use ESLint please install eslint by running yarn add eslint in the workspace folder client
or globally using 'yarn global add eslint'. You need to reopen the workspace after installing eslint.

Alternatively you can disable ESLint for the workspace folder client by executing the 'Disable ESLint' command.
Run Code Online (Sandbox Code Playgroud)

现在我已经安装了 eslint 和所有其他东西。我认为问题是由于纱线即插即用而没有node_modules文件夹。我怎样才能以某种方式配置 vscode eslint 扩展来工作。

谢谢。

typescript reactjs visual-studio-code yarnpkg yarn-workspaces

7
推荐指数
2
解决办法
4540
查看次数