[Question] How to set up coc-eslint?
ArtemSmaznov opened this issue · comments
Description
Hi, I am currently trying to set up coc-esling
for my Vim cannot seem to make it work. Not sure if I am missing some steps or if something is wrong with what I am doing. Been at it for a few days now and cannot find any solution.
When I install coc-prettier
, coc-tsserver
or coc-json
they just start working straight away and I immediately see the formatting and errors in my example.js
. But when I install coc-eslint
I am not really getting anything.
My Step-by-Step setup
In order to exclude any conflicts with my config I have set up vim on a new arch linux machine:
- Install
vim
andnpm
from pacman - Create basic
~/.vimrc
- Install
plug.vim
- Install
coc
- Create
CocConfig
- Install
coc-eslint
- Create
.eslintConfig
in the project directory (secondary question: is it possible to set the rules globally?) - Open my
example.js
- Expect to see issues pointed out like missing semicolons, usage of
var
instead oflet
, etc.
My Configs
CocInfo
## versions
vim version: VIM - Vi IMproved 8.2 8022347
node version: v15.6.0
coc.nvim version: 0.0.80-6e5a2aaeb5
coc.nvim directory: /home/izzy/.vim/plugged/coc.nvim
term: dumb
platform: linux
## Log of coc.nvim
2021-02-06T11:34:25.628 INFO (pid:2689) [plugin] - coc.nvim 0.0.80-6e5a2aaeb5 initialized with node: v15.6.0 after 104ms
2021-02-06T11:34:25.635 INFO (pid:2689) [language-client-index] - eslint started with 2700
2021-02-06T11:34:44.307 INFO (pid:2689) [attach] - receive request: commandList [ 'es', 'CocCommand es', 13 ]
2021-02-06T11:34:47.462 INFO (pid:2689) [attach] - receive notification: runCommand [ 'eslint.showOutputChannel' ]
2021-02-06T11:34:47.469 INFO (pid:2689) [attach] - receive request: CocAutocmd [ 'BufReadCmd', 'output', 'output:///eslint' ]
2021-02-06T11:36:47.633 INFO (pid:2689) [attach] - receive notification: showInfo []
Would appreciate any help in what configuration am I missing for it to work.
I have installed eslint via npm separately and now it works within vim. Guess I just expected it to be packaged within the plugin
eslint.config.js
is needed?
Yes.
I created a PR to upgrade the Readme about that, feel free to contribute #102