neoclide / coc-eslint

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

[Question] How to set up coc-eslint? #102

Closed ArtemSmaznov closed 3 years ago

ArtemSmaznov commented 3 years ago

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:

  1. Install vim and npm from pacman
  2. Create basic ~/.vimrc
  3. Install plug.vim
  4. Install coc
  5. Create CocConfig
  6. Install coc-eslint
  7. Create .eslintConfig in the project directory (secondary question: is it possible to set the rules globally?)
  8. Open my example.js
  9. Expect to see issues pointed out like missing semicolons, usage of var instead of let, etc.

My Configs

2021-02-06_11:29:17

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.

ArtemSmaznov commented 3 years ago

I have installed eslint via npm separately and now it works within vim. Guess I just expected it to be packaged within the plugin

vitaly-zdanevich commented 3 months ago

eslint.config.js is needed?

vitaly-zdanevich commented 3 months ago

Yes.

vitaly-zdanevich commented 3 months ago

I created a PR to upgrade the Readme about that, feel free to contribute https://github.com/neoclide/coc-eslint/issues/102