Git Product home page Git Product logo

Comments (22)

emmtte avatar emmtte commented on May 28, 2024 11

Same issue for me with coc-prettier and coc-eslint
After manually install dependencies on dev folder work like as expected
npm install --save-dev eslint prettier eslint-config-prettier eslint-plugin-prettier
(Node.js 14)

from coc-eslint.

chemzqm avatar chemzqm commented on May 28, 2024 9

Checkout your npm global module folder by npm root -g and make sure your have eslint inside that folder.

from coc-eslint.

chemzqm avatar chemzqm commented on May 28, 2024 3

@kevindashgit Then you need to specify eslint.nodePath

from coc-eslint.

arbitrary-dev avatar arbitrary-dev commented on May 28, 2024 1

For me the problem was that I've installed eslint using Yarn, and so I have to set:

"eslint.nodePath": "/home/user/.config/yarn/global/node_modules"

from coc-eslint.

chemzqm avatar chemzqm commented on May 28, 2024

Make sure eslint can be resolve from your workspaceFolder https://github.com/neoclide/coc.nvim/wiki/Using-workspaceFolders or global npm modules.

You can disable suggest actions from tsserver https://github.com/neoclide/coc-tsserver#configuration-options.

from coc-eslint.

VVoruganti avatar VVoruganti commented on May 28, 2024

I am having the same issue no matter where I open a script file.

Not sure how to see if eslint can resolve.

from coc-eslint.

kevindashgit avatar kevindashgit commented on May 28, 2024

@chemzqm you've spotted a recurring issue with my regular workflow - which is that I regularly switch node versions via nvm and so some versions I've properly installed eslint while others not so much. πŸŽ† πŸ‘

Bonus Points: I'd still prefer not to have to move cursor over "underlined" section to see the warning as reflected by the vim "sign" (marker indicating an issue on this line. Is there a setting to reveal the issue just by moving cursor to the erroneous line?

from coc-eslint.

dzintars avatar dzintars commented on May 28, 2024

Same issue when opening Yarn 2 Berry PnP project.

from coc-eslint.

fannheyward avatar fannheyward commented on May 28, 2024

@dzintars When using coc-eslint with yarn2 project, follow this:

  1. yarn add @yarnpkg/pnpify add to your project
  2. yarn pnpify --sdk

Now coc-eslint will find eslint automatically.

from coc-eslint.

dzintars avatar dzintars commented on May 28, 2024

@fannheyward Tnx. I already did that, but no luck. Will update this issue when will get into something. BTW... which is recommended method today to install plugins? :CocInstall coc-eslint or Plug 'neoclide/coc-eslint', {'do': 'yarn install --frozen-lockfile'}?

from coc-eslint.

fannheyward avatar fannheyward commented on May 28, 2024

:CocInstall coc-eslint, extensions installed with :CocInstall can do auto-updating.

from coc-eslint.

stiofand avatar stiofand commented on May 28, 2024

I have had the same issue with eslint without success, I am unable to get coc working with either eslint or prettier, sadly I have to revert to another method until there is a solution for this.

from coc-eslint.

lauri-codes avatar lauri-codes commented on May 28, 2024

I'm also experiencing the same issue. After installing with :CocInstall coc-eslint, I have eslint installed under the path reported by npm root -g. I only got eslint working after installing it locally for the project as suggested by @emmtte using the command npm install --save-dev eslint. My setup is:

  • coc-eslint 1.2.7
  • coc.nvim version: 0.0.78-42353685a1
  • vim version: NVIM v0.4.3
  • node version: v12.16.3

from coc-eslint.

 avatar commented on May 28, 2024

@chemzqm

Can I skip the error?

If I have a random js file somewhere not in project, then this error always happens.

I think this is supposed to be, but I want to skip the error if there is no eslint configuration.

from coc-eslint.

chemzqm avatar chemzqm commented on May 28, 2024

You can create .vim/coc-setings.json at any parent folder of your file.

from coc-eslint.

 avatar commented on May 28, 2024

Oh.... I see.
So I need to create config file everytime I open random js file.

Um well, it can't be helped.
thanks

from coc-eslint.

chemzqm avatar chemzqm commented on May 28, 2024

Or you can create a global eslint config file.

from coc-eslint.

 avatar commented on May 28, 2024

@chemzqm
I tried that!
In that case even if I'm in some project, coc will look to global eslint.

prettierrc.js behavior is good.
https://prettier.io/docs/en/configuration.html

The configuration file will be resolved starting from the location of the file being formatted, and searching up the file tree until a config file is (or isn’t) found.

from coc-eslint.

chemzqm avatar chemzqm commented on May 28, 2024

You can use "root": true to make eslint not look up.

from coc-eslint.

 avatar commented on May 28, 2024

@chemzqm
Ah, thank you for reply, but no, in that case if there's no config in that workspace it causes the error,,,,,

(It would be great if this error goes to CocInfoLog. Not error in status line. But as you stated there is an way to handle this, so it's not critical. This is still great plugin.οΌ‰

from coc-eslint.

Clev7 avatar Clev7 commented on May 28, 2024

Checkout your npm global module folder by npm root -g and make sure your have eslint inside that folder.

This worked wonders! cd into that folder and do sudo npm install -g eslint and eslint should be where it needs to be

from coc-eslint.

lambdaFun94 avatar lambdaFun94 commented on May 28, 2024

Checkout your npm global module folder by npm root -g and make sure your have eslint inside that folder.

This worked wonders! cd into that folder and do sudo npm install -g eslint and eslint should be where it needs to be

Super helpful!

from coc-eslint.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.