Closed greenhat616 closed 3 years ago
I cloned the repository and I think this is due to how yarn installs the node modules (e.g. there is no node_modules
folder). And I think they do something special if you later on execute yarn lint
. Can you explain which yarn mode this is.
Installing the packages using npm works as expected.
yes. it used pnp(a yarn 2,called berry also, feature). Before standard v16, it seems work by yarn pnpify --sdk vscode
. But now, it doesn't work as expexted.(however, the eslint can parse it correctly by command)
---Original--- From: "Dirk Bäumer"<notifications@github.com> Date: Tue, Nov 24, 2020 22:40 PM To: "microsoft/vscode-eslint"<vscode-eslint@noreply.github.com>; Cc: "Jonson Petard"<i@a632079.me>;"Author"<author@noreply.github.com>; Subject: Re: [microsoft/vscode-eslint] can't detect eslint-config-standard (#1126)
Installing the packages using npm works as expected.
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.
There was a long discussion about this here https://github.com/microsoft/vscode-eslint/issues/601 and the yarn community addressed this by also wrapping ESLint in that setup. May be something broke on there end. Have you tried what is described here: https://github.com/microsoft/vscode-eslint/issues/601#issuecomment-518743322.
The reason why it works in the terminal is that you run the yarn lint
script which basically first runs yarn
which can detect that it run in a pnp environment and can do the right adjustments. However the ESLint extension doesn't use yarn to start eslint hence that code is not executed. It is simply based on node.
yes, i have tried. vscode eslint can parse plugin&config(prettier) successfully in PnP mode. Just eslint-config-standard
v16 not work currently
Actually I am lost here. If someone from the community knows how to address this, I appreciate any help.
I read a little in the yarn documentation and running yarn pnpify --sdk vscode
in the project made everything work for me.
Will close the issue for now.
OK, the node env is based on WSL 2. VSCode is running at Windows 10 20H2 x86. VSCode Version Details:
![image](https://user-images.githubusercontent.com/41122242/100072977-ddacb000-2e77-11eb-9661-1297d075665e.png)
Some version details:
if used eslint directly, the log is below(with
--debug
flag:In VSC, it reports:
![image](https://user-images.githubusercontent.com/41122242/100072314-0d0eed00-2e77-11eb-9456-dc7dbb34812f.png)
VSC config file:
project settings(
.vscode\settings.json
):