neoclide / coc-eslint

Eslint extension for coc.nvim
MIT License
396 stars 25 forks source link

feat: upgrade from latest vscode-eslint #118

Closed fannheyward closed 2 years ago

fannheyward commented 3 years ago

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
tstirrat15 commented 3 years ago

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

fannheyward commented 3 years ago

@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 commented 3 years ago

Will do. Thanks!

tstirrat15 commented 3 years ago

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

fannheyward commented 3 years ago

Yes, uninstall it and set local coc-eslint.

tstirrat15 commented 3 years ago

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 commented 3 years ago

It doesn't show up under :CocList extensions

How do you set it?

tstirrat15 commented 3 years ago

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 commented 3 years ago

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

tstirrat15 commented 3 years ago

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 commented 3 years ago

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

tstirrat15 commented 3 years ago

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

tstirrat15 commented 3 years ago

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

tstirrat15 commented 3 years ago

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 commented 3 years ago

@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 commented 3 years ago

@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 commented 3 years ago

Seconding - everything worked well. Thank you!

jougene commented 3 years ago

When it can be merged?

Seb-C commented 2 years ago

@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 :bow:

fannheyward commented 2 years ago

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 commented 2 years ago

@fannheyward Thank you so much! It works perfectly here :heart: .

EvgeniyRRU commented 2 years ago

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

fannheyward commented 2 years ago

@EvgeniyRRU yes

dannobytes commented 2 years ago

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

adelin-b commented 2 years ago

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

yaegassy commented 2 years ago

@chemzqm ping

fannheyward commented 2 years ago

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

nuc commented 2 years ago

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