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

[bug?] Manually linting with xo produces different results from extension #144

Open
igniscyan opened this issue Jun 22, 2024 · 4 comments
Open

Comments

@igniscyan
Copy link

Apologies if this is a little vague, but I'm running into an issue where it seems as if the extension is skipping my index.ts file located in src, but the xo command itself is not.

Running pnpm lint (xo) shows 27 errors in the file, but the extension is showing 0.

I'm not great at describing issues, but let me know if there's anything I can provide to help find an answer to this.

@spence-s
Copy link
Collaborator

Can you link a reproducible example repo?

Also inspect the xo extension output to ensure their aren't other errors. Sounds like you have a set up issue. I am not sure how pnpm works entirely, but if the extension cannot load xo from a local node_modules folder then it won't work.

@igniscyan
Copy link
Author

igniscyan commented Jun 26, 2024

image

I just find it odd that it'd work in every other file. I don't see any red flags when looking at the XO extension output.

I temporarily made this repo public: https://github.com/0FFWare/rbp_api

Edit: taking a look at this I know you're probably saying "the problems tab also has 4!" But those are all unused variable warnings across other files :P

@spence-s
Copy link
Collaborator

spence-s commented Jun 26, 2024

So I was able to reproduce - and it seems that the eslint ignore line is tripping up the parser in the extension for some reason and I have no idea why -- HOWEVER its a typo anyway and it fixes it for me

change:
// eslint-disable-nextline @typescript-eslint/naming-convention
to
// eslint-disable-next-line @typescript-eslint/naming-convention
which is actually what you meant to do.

Not sure why it works with the CLI and not with the extension though. It is easily reproducible though, if I change the line back and restart the extension then it stops linting the file again. I will leave this open until I have time to take a look at the root cause, but this should clear up your particular problem.

@igniscyan
Copy link
Author

@spence-s can't believe I missed that, but glad that it helped unearth something in the process. Appreciate the assistance!

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

No branches or pull requests

2 participants