Vscode-eslint: Support ESLint module install globally via yarn

Created on 20 Dec 2016  路  14Comments  路  Source: microsoft/vscode-eslint

Need to add yarn's global module install location to the NODE_PATH when resolving the node module. Something comparable to npm config get prefix

feature-request help wanted

Most helpful comment

For those wondering, a workaround on Linux is to set the following:

eslint._legacyModuleResolve: true, 
eslint.nodePath: "/your/home/dir/.config/yarn/global/node_modules/"

All 14 comments

For those wondering, a workaround on Linux is to set the following:

eslint._legacyModuleResolve: true, 
eslint.nodePath: "/your/home/dir/.config/yarn/global/node_modules/"

eslint.nodePath doesn't seem to fix this on Mac

Does anyone know how to determine the global module location for yarn. I tried yarn config get prefix and yarn config listbut nothing contains the global install location.

Under Windows is seems to be ~\AppData\Local\Yarn\config\global\node_modules.

yarn global bin ?

yarn global bin prints the same as npm config get prefix however this is not the location yarn installs global npm modules. I am still a little lost here.

@eduedix thanks for opening the yarn issue.

@dbaeumer I reached out to the FB team and pointed them at this issue. Hoping they'll jump in and help.

@reybango thanks. I retested this today and yarn still doesn't provide me with command to find the global node modules install location.

Released Yarn 1.1.0 with this PR merged.

@BYK Thanks!

Indeed, there is nothing to do with yarn, just add "eslint.packageManager": "yarn" to your vscode settings and it would fix at all :)

Was this page helpful?
0 / 5 - 0 ratings