3 Eslint language server extension for [coc.nvim](https://github.com/neoclide/coc.nvim).
5 Forked from [vscode-eslint](https://github.com/Microsoft/vscode-eslint).
9 In your vim/neovim run the following command:
12 :CocInstall coc-eslint
17 - Lint `javascript` files using eslint.
18 - Provide `codeActions` for fixing lint issues.
19 - Provide eslint commands:
20 - `eslint.createConfig` create eslint config file.
21 - `eslint.executeAutofix` fix all fixable issues of current buffer.
23 ## Configuration options
25 **Notice** these configuration settings allow you to configure the behaviour of the coc-eslint extension.
27 - `eslint.enable`: enable/disable ESLint. This is enabled by default.
28 - `eslint.quiet` - ignore warnings.
29 - `eslint.runtime` - use this setting to set the path of the node runtime to run ESLint under.
30 - `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"`.
31 - `eslint.options`: options to configure how ESLint is started using the [ESLint CLI Engine API](http://eslint.org/docs/developer-guide/nodejs-api#cliengine). Defaults to an empty option bag.
32 An example to point to a custom `.eslintrc.json` file is:
35 "eslint.options": { "configFile": "C:/mydirectory/.eslintrc.json" }
38 - `eslint.run` - run the linter `onSave` or `onType`. The Default is `onType`.
39 - `eslint.nodeEnv` - use this setting if an ESLint plugin or configuration needs `process.env.NODE_ENV` to be defined.
40 - `eslint.autoFixOnSave` - enables auto fix on save.
41 - `eslint.autoFixSkipRules` - rules that shouldn't be autofixed.
42 - `eslint.nodePath` - use this setting if an installed ESLint package can't be detected. For example `/myGlobalNodePackages/node_modules`.
43 - `eslint.filetypes` - an array of language identifiers specifying the files to be validated.
44 - `eslint.codeAction.disableRuleComment` - object with properties:
45 - `enable` - show disable lint rule in the quick fix menu. `true` by default.
46 - `location` - choose to either add the `eslint-disable` comment on the `separateLine` or `sameLine`. `separateLine` is the default.
49 { "enable": true, "location": "sameLine" }
51 - `eslint.codeAction.showDocumentation` - object with properties:
52 - `enable` - show open lint rule documentation web page in the quick fix menu. `true` by default.
56 The extension supports automatic fixing of warnings to the extent that it is supported by eslint.
57 For warnings which support an auto-fix. You can apply the quick fix by either:
59 - Set `eslint.autoFixOnSave` to `true` and save your file (recommended).
60 - Trigger `<Plug>(coc-codeaction)` with mapped keys, and select a fix action in the input list.
61 - Run command `:CocCommand eslint.executeAutofix`.
62 - Trigger command `eslint.executeAutofix` from `:Denite coc-command`.