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

are there plans to support eslint 9? #147

Open
norflin321 opened this issue May 14, 2024 · 10 comments
Open

are there plans to support eslint 9? #147

norflin321 opened this issue May 14, 2024 · 10 comments

Comments

@norflin321
Copy link

No description provided.

@fannheyward
Copy link
Member

coc-eslint already supports ESLint 9, you need to install eslint to your project.

@norflin321
Copy link
Author

i have eslint installed in my project, the problem is that when i use eslint < 9 with local json config file ".eslintrc.json", coc-eslint correctly find the rules specified in the config and take them into account, but when I simply upgrade project to eslint 9 and use its new config (which, as I understand it, must be in the js file), coc-eslint stops taking into account any rules specified in the new config. Perhaps because he does not understand that he needs to use this config file? but with the previous version it found the config file itself (I do not specify it somewhere on my own)

@fannheyward
Copy link
Member

Enable eslint.experimental.useFlatConfig and try again.

@Rom888
Copy link

Rom888 commented Sep 2, 2024

I enabled eslint.experimental.useFlatConfig, but without success.
eslint shows errors from command line:

$ npx eslint ./**/config.service.ts

  24:26  error  Missing semicolon  @stylistic/semi

but no errors in vim.

I see no errors when :CocOpenLogs

2024-09-02T10:12:46.559 INFO (pid:13156) [plugin] - coc.nvim initialized with node: v22.7.0 after �[33m160�[39m
2024-09-02T10:13:01.127 INFO (pid:13156) [services] - LanguageClient ESLint state change: stopped => starting
2024-09-02T10:13:01.193 INFO (pid:13156) [services] - service tsserver started
2024-09-02T10:13:01.197 INFO (pid:13156) [language-client-index] - Language server "eslint" started with 13280
2024-09-02T10:13:01.273 INFO (pid:13156) [services] - LanguageClient ESLint state change: starting => running
2024-09-02T10:13:01.280 INFO (pid:13156) [services] - service eslint started

How can I troubleshoot it?

@Rom888
Copy link

Rom888 commented Sep 3, 2024

@ravicious
Copy link

ravicious commented Dec 13, 2024

One substantial inconvenience of eslint.experimental.useFlatConfig is that at work we have three release branches and a trunk. ESLint 9 is merged to trunk, but if I switch to a release branch, I have to set eslint.experimental.useFlatConfig to false, otherwise coc-eslint throws an error when I try to save a file.

@nashbridges
Copy link

@ravicious one solution is to use :CocLocalConfig. That however would require for you to check .vim/coc-settings.json into git.

@trygveaa
Copy link

That however would require for you to check .vim/coc-settings.json into git.

Instead of checking it it, I've added /.vim/coc-settings.json to .git/info/exclude in the repos I have with eslint 9, so I don't have to bother my other team mates which don't use vim with this file.

@ravicious
Copy link

Right, but in the case that I described this is no different than just adjusting the global config. If you don't commit the local config to git (which I suppose you almost never want to do), then all release branches and trunk use the same coc settings, no matter whether the actual branch you're on has ESLint 9 or not.

@trygveaa
Copy link

Right, if you have branches with different versions it's definitely a problem. I forgot that you wrote about that.

It looks like the current implementation was pulled from an early version of the eslint 9 support in vscode-eslint. That extension now has support for automatically detecting if flat config should be used or not, so one could probably look at what that is doing.

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

6 participants