Giter Club home page Giter Club logo

coc-eslint's Introduction

coc-eslint

Eslint language server extension for coc.nvim.

Forked from vscode-eslint.

Install

In your vim/neovim run the following command:

:CocInstall coc-eslint

Features

  • Lint javascript files using eslint.
  • Provide codeActions for fixing lint issues.
  • Provide eslint commands:
    • eslint.createConfig create eslint config file.
    • eslint.executeAutofix fix all fixable issues of current buffer.

Configuration options

Notice these configuration settings allow you to configure the behaviour of the coc-eslint extension.

  • eslint.enable: enable/disable ESLint. This is enabled by default.
  • eslint.quiet - ignore warnings.
  • eslint.packageManager: controls the package manager to be used to resolve the ESLint library. This has only an influence if the ESLint library is resolved globally. Valid values are "npm" or "yarn".
  • eslint.options: options to configure how ESLint is started using the ESLint CLI Engine API. Defaults to an empty option bag. An example to point to a custom .eslintrc.json file is:
    {
      "eslint.options": {"configFile": "C:/mydirectory/.eslintrc.json"}
    }
  • eslint.run - run the linter onSave or onType. The Default is onType.
  • eslint.autoFixOnSave - enables auto fix on save.
  • eslint.nodePath - use this setting if an installed ESLint package can't be detected. For example /myGlobalNodePackages/node_modules.
  • eslint.filetypes - an array of language identifiers specifying the files to be validated.
  • eslint.codeAction.disableRuleComment - object with properties:
    • enable - show disable lint rule in the quick fix menu. true by default.
    • location - choose to either add the eslint-disable comment on the separateLine or sameLine. separateLine is the default. Example:
    {"enable": true, "location": "sameLine"}
  • eslint.codeAction.showDocumentation - object with properties:
    • enable - show open lint rule documentation web page in the quick fix menu. true by default.

Auto-fixing

The extension supports automatic fixing of warnings to the extent that it is supported by eslint. For warnings which support an auto-fix. You can apply the quick fix by either:

  • Set eslint.autoFixOnSave to true and save your file (recommended).
  • Trigger <Plug>(coc-codeaction) with mapped keys, and select a fix action in the input list.
  • Run command :CocCommand eslint.executeAutofix.
  • Trigger command eslint.executeAutofix from :Denite coc-command.

License

MIT

coc-eslint's People

Contributors

chemzqm avatar ckipp01 avatar

Watchers

 avatar

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.