Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Does not work with the latest version of XO #91

Closed
yakov116 opened this issue May 9, 2021 · 26 comments · Fixed by #94
Closed

Does not work with the latest version of XO #91

yakov116 opened this issue May 9, 2021 · 26 comments · Fixed by #94

Comments

@yakov116
Copy link

yakov116 commented May 9, 2021

Issuehunt badges

Failed to load XO library. Make sure XO is installed in your workspace folder using 'npm install xo' and then press Retry.

@luludotdev
Copy link
Contributor

luludotdev commented May 14, 2021

This appears to be caused by XO v0.40 migrating the project to ESM, and with it breaking compatibility with this extension. Upon further inspection, the error is instead some issue with resolving eslint-config-xo when trying to load the XO library.

Error: Cannot find module 'eslint-config-xo'
Require stack:
- C:\Users\Jack\AppData\Local\Programs\Microsoft VS Code\__placeholder__.js
    at Function._resolveFilename (internal/modules/cjs/loader.js:934:15)
    at Function.resolve (internal/modules/cjs/helpers.js:94:19)

@luludotdev
Copy link
Contributor

As far as I can tell, xojs/xo#534 introduced some change to XO's config resolver, which in turn broke the logic that loads the XO library.

@Shuunen
Copy link

Shuunen commented May 17, 2021

@lolPants is right, the version just before 0.39.1 is working well with this extension

@tusbar
Copy link
Contributor

tusbar commented May 24, 2021

Hi @Richienb, this issue is very much related to xojs/xo#543.

xo@0.40.1 is looking for eslint-config-xo within the vscode extension’s context, and not within the extension’s workspace root.

xo is loading using resolveModule(workspaceRoot, 'xo'), see https://github.com/SamVerschueren/vscode-linter-xo/blob/master/server/src/server.ts#L131.

Then it throws when trying to load eslint-config-xo – installing eslint-xo-config within the extension server’s root fixes the issue.

@Richienb
Copy link

ESLint is only able to resolve plugins from the same node_modules folder that it is installed in or the node_modules of the project directory its cwd is set to. I think 0.40.0 just made it do the other thing but I can't be certain.

Could the cwd option in xo be of use for now?

@yakov116
Copy link
Author

It could but makes this plugin useless. Also makes linting so much harder.

@tusbar
Copy link
Contributor

tusbar commented May 24, 2021

Yeah, that is definitly the issue, eslint-config-xo is being searched within the CWD.

The issue is not when linting files, but when loading the package.
The cwd option is actually already set when linting (https://github.com/SamVerschueren/vscode-linter-xo/blob/master/server/src/server.ts#L198)

@andrewdbond
Copy link

andrewdbond commented May 29, 2021

For those seeking a workaround until this is otherwise resolved, you can use xo v0.39.1, the most recent working version:

npm install xo@0.39.1 --save-dev

or the equivalent shorter command:

npm i xo@0.39.1 -D

If you want to see xo's description of what's in the last few releases: https://github.com/xojs/xo/releases/

@spence-s
Copy link
Collaborator

added this issue here for visibility: xojs/xo#563

@SamVerschueren can we get any confirmation on if this extension is dead or alive? It doesn't look like its had any real activity in 2 years. Should we look for a new solution for vscode integration?

@yakov116
Copy link
Author

yakov116 commented Jul 8, 2021

Is there anyone here that would like to fix this for money? I am willing to pay.

@savearray2
Copy link
Contributor

Willing to monetarily support an update to this, as well.

@IssueHuntBot
Copy link

@yakov116 has funded $20.00 to this issue.


@IssueHuntBot
Copy link

An anonymous user has funded $20.00 to this issue.


@savearray2
Copy link
Contributor

savearray2 commented Jul 19, 2021

An anonymous user has funded $20.00 to this issue.

@yakov116
Er, that wasn't supposed to be anonymous. But in any event, I've matched funding.

@IssueHuntBot
Copy link

@tusbar has funded $20.00 to this issue.


@spence-s
Copy link
Collaborator

I forked and published this package as a new extension - since it seems this is no longer being maintained or accepting PRs. Please try this via the link below, and feel free to file issues in my fork. My extension should work now for all versions of XO. @tusbar @yakov116 @savearray2 -- if you have any problems definitely let me know and I will try to fix right away.

https://marketplace.visualstudio.com/items?itemName=spence-s.linter-xo

@savearray2
Copy link
Contributor

@spence-s
Thank you for the update! It is much appreciated. I'm in the middle of switching laptops. I'll check it out in the next day or so :)

@yakov116
Copy link
Author

I forked and published this package as a new extension - since it seems this is no longer being maintained or accepting PRs. Please try this via the link below, and feel free to file issues in my fork. My extension should work now for all versions of XO. @tusbar @yakov116 @savearray2 -- if you have any problems definitely let me know and I will try to fix right away.

https://marketplace.visualstudio.com/items?itemName=spence-s.linter-xo

@spence-s your extension works perfect ly! @SamVerschueren can you merge the PR?

If it does not get merged in the next week I will credit you the bounty.

@spence-s
Copy link
Collaborator

spence-s commented Aug 1, 2021

closed by #94

@spence-s spence-s closed this as completed Aug 1, 2021
@yakov116
Copy link
Author

yakov116 commented Aug 1, 2021

Can you try to link the pull request? If this does not work I will email them

@spence-s spence-s linked a pull request Aug 1, 2021 that will close this issue
@yakov116
Copy link
Author

yakov116 commented Aug 1, 2021

@SamVerschueren I think you may have to reward it since your the repository owner. @spence-s I will send them an email now. If they don't get back to me in a prompt matter, I will send it to u via PayPal etc.

@spence-s
Copy link
Collaborator

spence-s commented Aug 1, 2021

@yakov116 feel free to email me @ sasnyde2@gmail.com if you need anything else from my end. Will try to stop spamming these threads here 😄 - but thanks for your support on this.

@SamVerschueren
Copy link
Collaborator

Not entirely sure how this works. I'll check tomorrow on my computer. I tried linking the PR, not sure if that did it...

@yakov116
Copy link
Author

yakov116 commented Aug 1, 2021

I think you have to go onto issue hunt and award it there

@IssueHuntBot
Copy link

@samverschueren has rewarded $54.00 to @spence-s. See it on IssueHunt

  • 💰 Total deposit: $60.00
  • 🎉 Repository reward(0%): $0.00
  • 🔧 Service fee(10%): $6.00

@SamVerschueren
Copy link
Collaborator

Yes. I found it :). Great work everyone!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

10 participants