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

feat: upgrade from latest vscode-eslint #118

Merged
merged 4 commits into from
Dec 23, 2021

Conversation

fannheyward
Copy link
Member

@fannheyward fannheyward commented Oct 15, 2021

closes #117

  1. vscode-eslint 2.0 added settings migration, this is not ported
  2. ConfirmExecution has been removed
  3. rulesCustomizations supports
  4. eslintServer.ts supports ESLint 8+, use the new ESLint https://eslint.org/docs/user-guide/migrating-to-7.0.0#deprecate-cliengine

@fannheyward fannheyward changed the title feat: upgrade eslintServer from vscode-eslint [WIP] feat: upgrade eslintServer from vscode-eslint Oct 15, 2021
@fannheyward fannheyward marked this pull request as draft October 15, 2021 06:56
1. ConfirmExecution has been removed
2. vscode-eslint 2.0+ added a settings migration, not ported to coc-eslint

https://github.com/microsoft/vscode-eslint#settings-migration
@fannheyward fannheyward changed the title [WIP] feat: upgrade eslintServer from vscode-eslint [WIP] feat: upgrade from latest vscode-eslint Oct 15, 2021
@fannheyward fannheyward marked this pull request as ready for review October 15, 2021 10:00
@fannheyward fannheyward changed the title [WIP] feat: upgrade from latest vscode-eslint feat: upgrade from latest vscode-eslint Oct 15, 2021
@tstirrat15
Copy link

Thank you for putting in the work on this! Is there anything I/we can do to help this get through?

@fannheyward
Copy link
Member Author

fannheyward commented Oct 19, 2021

@tstirrat15 you can try this work or not with your project.

  1. :CocUninstall coc-eslint to uninstall the old release
  2. clone the repo and checkout this PR
  3. yarn install && yarn build
  4. set runtimepath^=~/src/coc-eslint in your vimrc

That's all, you're now using this PR coc-eslint.

@tstirrat15
Copy link

Will do. Thanks!

@tstirrat15
Copy link

To clarify: I want to uninstall coc-eslint, right?

@fannheyward
Copy link
Member Author

Yes, uninstall it and set local coc-eslint.

@tstirrat15
Copy link

I got it installed, and it's registered as a service under :CocList services. It doesn't show up under :CocList extensions, though TSServer does. When I run :CocCommand eslint.autoFix, I get an error:

[coc.nvim] Failed to apply ESLint fixes to the document. Please consider opening an issue with steps to reproduce

Is there anything obvious that I should check?

@fannheyward
Copy link
Member Author

It doesn't show up under :CocList extensions

How do you set it?

@tstirrat15
Copy link

Ah, wait, sorry, I got that backwards. coc-eslint shows up in the extensions list and is activated, but does not show up under the services list. Here's what it looks like in the extensions list:

  * coc-tsserver 1.8.6 ~/.config/coc/extensions/node_modules/coc-tsserver                                                                                                                                  
  * coc-eslint [RTP] 1.4.5 ~/clones/coc-eslint
  + coc-solargraph 1.2.2 ~/.config/coc/extensions/node_modules/coc-solargraph

@fannheyward
Copy link
Member Author

Sorry I'm away from work by now and will check the autofix issue later. Thank you for your tests.

@tstirrat15
Copy link

Sure, no worries. The autofix issue is just a part of it - it's also not highlighting anything. There's nothing in :CocInfo that would indicate an error, though. Lemme know if there's other diagnostics I can provide.

@fannheyward
Copy link
Member Author

@tstirrat15 there's no :CocCommand eslint.autoFix command. Do you mean :CocCommand eslint.executeAutofix? In my tests, CocCommand eslint.executeAutofix works as expected.

@tstirrat15
Copy link

Let me check again. I think I just fatfingered the command when I was typing it out in my last comment.

@tstirrat15
Copy link

Aaaand now it's working perfectly. I think it might have been something screwy in my node_modules.

@tstirrat15
Copy link

For additional context, the file that I was linting had a react exhaustive deps error, but that plugin hasn't been updated yet. I was able to diagnose it by running yarn run eslint <file> in a separate terminal. Is there a place to find that sort of diagnostic information within nvim/coc?

@fannheyward
Copy link
Member Author

@tstirrat15 try to enable the trace logs by "eslint.trace.server": "verbose" in your coc-settings.json, and checkout :CocCommand workspace.showOutput eslint.

IDK you can find the diagnostics or not in the trace logs, please give it a try.

@skilbjo
Copy link

skilbjo commented Oct 31, 2021

@tstirrat15 you can try this work or not with your project.

  1. :CocUninstall coc-tsserver to uninstall the old release
  2. clone the repo and checkout this PR
  3. yarn install && yarn build
  4. set runtimepath^=~/src/coc-eslint in your vimrc

That's all, you're now using this PR coc-eslint.

One note to these instructions, you need to check out the correct branch (feat/eslint-8). Here are my edits:

- :CocUninstall coc-eslint
- git clone fannheyward/coc-eslint ~/dev/coc-eslint
- cd ~/dev/coc-eslint && git checkout feat/eslint-8
- yarn install && yarn build
- (in `~/.vimrc`) set runtimepath^=~/dev/coc-eslint

Working great for me so far @fannheyward . Any word when you plan to merge?

@tstirrat15
Copy link

Seconding - everything worked well. Thank you!

@jougene
Copy link

jougene commented Nov 10, 2021

When it can be merged?

@Seb-C
Copy link

Seb-C commented Nov 19, 2021

@chemzqm Are you still maintaining this project?
I think we are a lot to wait for this major issue to be fixed, so it would be useful to know if we can expect it to be merged any soon or if someone should take the lead and fork it.
Thank you 🙇

@fannheyward
Copy link
Member Author

Hello guys, I just published https://www.npmjs.com/package/coc-eslint8, with this PR ESLint 8 support. You can :CocUninstall coc-eslint and :CocInstall coc-eslint8.

Note that: after chemzqm came back and merge this PR, the you should use back coc-eslint.

@Seb-C
Copy link

Seb-C commented Nov 19, 2021

@fannheyward Thank you so much! It works perfectly here ❤️ .

@EvgeniyRRU
Copy link

@fannheyward, is https://www.npmjs.com/package/coc-eslint8 supports eslint7?

@fannheyward
Copy link
Member Author

@EvgeniyRRU yes

@dannobytes
Copy link

Thank you so much for fixing this @fannheyward !! 👏🏼

@adelin-b
Copy link

adelin-b commented Dec 2, 2021

Hello guys, I just published https://www.npmjs.com/package/coc-eslint8, with this PR ESLint 8 support. You can :CocUninstall coc-eslint and :CocInstall coc-eslint8.

Note that: after chemzqm came back and merge this PR, the you should use back coc-eslint.

Thank you a lot, could you add the reasons in the Readme of the package ? I was randomly looking through coc marketplace and thought it was a scam package as it state v2.0.0 while the original package is v1.4.5 I think. Almost reported it

UltiRequiem added a commit to UltiRequiem/UltiVim that referenced this pull request Dec 13, 2021
TianboQiu305 pushed a commit to Tianbo-Qiu/Vim that referenced this pull request Dec 16, 2021
The previous version of eslint might not work properly
neoclide/coc-eslint#118
@yaegassy
Copy link

@chemzqm ping

@chemzqm chemzqm merged commit deff067 into neoclide:master Dec 23, 2021
@fannheyward
Copy link
Member Author

To anyone who use coc-eslint8, you should use coc-eslint 1.5.0 now.

@nuc
Copy link

nuc commented Mar 13, 2022

@fannheyward Next time you are in Berlin, the beers are on me 🍻

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 this pull request may close these issues.

Doesn't work with esLint 8.x