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

ESlint error when using vim-fugitives :Gdiff command #32

Closed
deathmaz opened this issue Aug 1, 2018 · 6 comments
Closed

ESlint error when using vim-fugitives :Gdiff command #32

deathmaz opened this issue Aug 1, 2018 · 6 comments

Comments

@deathmaz
Copy link

deathmaz commented Aug 1, 2018

Describe the bug
I'm using vim-fugitive plugin, so when i use :Gdiff command in a file that was changed, coc.nvim opens vertical split with the following error

[Info  - 18:04:27] ESLint library loaded from: /home/maz/server/www/homestead/voice-mvp/node_modules/eslint/lib/api.js
[Error - 18:04:37] ESLint stack trace:
[Error - 18:04:37] TypeError: Cannot read property 'CLIEngine' of undefined
    at validate (/home/maz/.config/yarn/global/node_modules/eslint-server/lib/index.js:548:40)
    at resolveSettings.then.settings (/home/maz/.config/yarn/global/node_modules/eslint-server/lib/index.js:490:13)
    at <anonymous>

To Reproduce
Steps to reproduce the behavior:

  1. You need to have vim-fugitive plugin;
  2. Open .js file, remove a line;
  3. Save the file;
  4. Run :Gdiff command;

Expected behavior
When :Gdiff command was executed there shouldn't be any errors from coc.nvim.

Screenshots
I recoreded the issue with asciinema - https://asciinema.org/a/AiTGXMXLPdtVjbLZaDqrXlS1p

Desktop (please complete the following information):

  • Terminal: tilda
  • Version: 1.4.1-1
    tmux 2.7-1
    NVIM v0.3.1
    Kernel: 4.14.57-1-MANJARO x86_64 bits: 64 Desktop: Xfce 4.12.4 Distro: Manjaro Linux
@chemzqm
Copy link
Member

chemzqm commented Aug 1, 2018

It's because eslint module is not found, there is

  "eslint.packageManager": "npm",

in settings.json to make it same as VSCode's settings.json, you can either run

npm i -g eslint

or if have installed eslint with yarn, add:

 "eslint.packageManager": "yarn",

to your coc-settings.json

@chemzqm
Copy link
Member

chemzqm commented Aug 1, 2018

The error is confusing, it could be improved.

@deathmaz
Copy link
Author

deathmaz commented Aug 1, 2018

I already have eslint installed globally

@chemzqm
Copy link
Member

chemzqm commented Aug 1, 2018

The eslint server check the folder: npm root -g, not the executable file.

@deathmaz
Copy link
Author

deathmaz commented Aug 1, 2018

ok, i tried your suggestions from #32 (comment), but i still have the error

@chemzqm
Copy link
Member

chemzqm commented Aug 1, 2018

Add

"eslint.enable": false

to disable eslint for now, I will send a fix for this.

@chemzqm chemzqm closed this as completed in c8c3404 Aug 1, 2018
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

2 participants