Git Product home page Git Product logo

Comments (8)

andys8 avatar andys8 commented on May 28, 2024 10

How about an option ignoreProjectsWithoutEslintConfig/disableProjectsWithoutEslintConfig? :)

from coc-eslint.

chemzqm avatar chemzqm commented on May 28, 2024 5

eslint doesn't provide an API for resolve configuration file, so you have to use "eslint.enable": false in your .vim/coc-settings.json inside project folder.
Maybe someone can help to implement such functionality.

from coc-eslint.

sethfowler avatar sethfowler commented on May 28, 2024 1

I ran into the same problem. +1 on adding an option to ignore projects without an ESLint configuration file. A global default ESLint configuration really just won't work; like @andys8 said, you need different configurations for TypeScript vs JavaScript and node projects vs browser projects.

from coc-eslint.

chemzqm avatar chemzqm commented on May 28, 2024

Checkout https://github.com/neoclide/coc.nvim/wiki/Using-the-configuration-file or create eslint config file in your $HOME

from coc-eslint.

andys8 avatar andys8 commented on May 28, 2024

Thanks for the reply.

Thought about those solutions:

  • global eslint won't work, because projects are far too different (node/js/ts/frameworks).
  • disabling in project would work, but depends on modifying a project even if it's not owned

from coc-eslint.

chemzqm avatar chemzqm commented on May 28, 2024

No, global eslint config file could work as default configuration file.

from coc-eslint.

andys8 avatar andys8 commented on May 28, 2024

Yeah, I understand. I think it won't work for my case. E.g. it's a minimal eslint config file. Then opening a typescript based project without eslint file will fail, because its content can't be parsed. This eslint would basically have to match any project (ts, js, browser, node, react, vue).

from coc-eslint.

davidosomething avatar davidosomething commented on May 28, 2024

maybe something like

  autocmd BufNewFile,BufReadPre,BufEnter
        \ */myproject/*.{js,jsx,ts,tsx}
        \   call coc#config('eslint.enable', v:false)
  autocmd BufLeave
        \ */myproject/*.{js,jsx,ts,tsx}
        \   call coc#config('eslint.enable', v:true)

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.