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).
7 **Note** invoke `eslint.showOutputChannel` to invoke command of current eslint statusline.
11 If you like my extension, consider supporting me on Patreon or PayPal:
13 <a href="https://www.patreon.com/chemzqm"><img src="https://c5.patreon.com/external/logo/become_a_patron_button.png" alt="Patreon donate button" /> </a>
14 <a href="https://www.paypal.com/paypalme/chezqm"><img src="https://werwolv.net/assets/paypal_banner.png" alt="PayPal donate button" /> </a>
18 In your vim/neovim run the following command:
21 :CocInstall coc-eslint
26 - Lint `javascript` files using eslint.
27 - Provide `codeActions` for fixing lint issues.
28 - Provide eslint commands:
29 - `eslint.executeAutofix` Fix all auto-fixable Problems.
30 - `eslint.createConfig` Create ESLint configuration.
31 - `eslint.showOutputChannel` Show Output Channel.
32 - `eslint.resetLibraryExecution` Reset Library Execution Decisions.
33 - `eslint.manageLibraryExecution` Manage Library Execution.
34 - `eslint.lintProject` Run eslint for current project, add errors to quickfix list.
36 ## Configuration options
38 **Notice** these configuration settings allow you to configure the behaviour of the coc-eslint extension. They should be set in your `coc-settings.json` file, which can be opened with the `:CocConfig` command.
40 - `eslint.enable`: Controls whether eslint is enabled or not. default: `true`
41 - `eslint.execArgv`: Arguments of node used on language server start. default: `[]`
42 - `eslint.packageManager`: The package manager you use to install node modules. default: `"npm"`
43 Valid options: ["npm","yarn","pnpm"]
44 - `eslint.alwaysShowStatus`: Always show the ESlint status bar item. default: `false`
45 - `eslint.nodeEnv`: The value of `NODE_ENV` to use when running eslint tasks. default: `null`
46 - `eslint.nodePath`: A path added to `NODE_PATH` when resolving the eslint module. default: `null`
47 - `eslint.options`: The eslint options object to provide args normally passed to eslint when executed from a command line (see http://eslint.org/docs/developer-guide/nodejs-api#cliengine). default: `{}`
48 - `eslint.trace.server`: Traces the communication between VSCode and the eslint linter service. default: `"off"`
49 - `eslint.run`: Run the linter on save (onSave) or on type (onType) default: `"onType"`
50 Valid options: ["onSave","onType"]
51 - `eslint.autoFixOnSave`: Turns auto fix on save on or off. default: `false`
52 - `eslint.quiet`: Turns on quiet mode, which ignores warnings. default: `false`
53 - `eslint.onIgnoredFiles`: Whether ESLint should issue a warning on ignored files. default: `"off"`
54 Valid options: ["warn","off"]
55 - `eslint.workingDirectories`: Working directories for files in different folders.
56 - `eslint.validate`: An array of language ids which should be validated by ESLint. If not installed ESLint will show an error.
57 - `eslint.probe`: An array of language ids for which the extension should probe if support is installed. default: `["javascript","javascriptreact","typescript","typescriptreact","html","vue","markdown"]`
58 - `eslint.runtime`: The location of the node binary to run ESLint under. default: `null`
59 - `eslint.debug`: Enables ESLint debug mode (same as --debug on the command line) default: `false`
60 - `eslint.codeAction.disableRuleComment`: default: `{"enable":true,"location":"separateLine"}`
61 - `eslint.codeAction.showDocumentation`: default: `{"enable":true}`
62 - `eslint.codeActionsOnSave.mode`: Specifies the code action mode. Possible values are 'all' and 'problems'. default: `"all"`
63 Valid options: ["all","problems"]
64 - `eslint.format.enable`: Enables ESLint as a formatter. default: `false`
65 - `eslint.lintTask.options`: Command line options applied when running the task for linting the whole workspace (see https://eslint.org/docs/user-guide/command-line-interface). default: `["."]`
69 The extension supports automatic fixing of warnings to the extent that it is supported by eslint.
70 For warnings which support an auto-fix. You can apply the quick fix by either:
72 - Set `eslint.autoFixOnSave` to `true` and save your file (recommended).
73 - Trigger `<Plug>(coc-codeaction)` with mapped keys, and select a fix action in the input list.
74 - Run command `:CocCommand eslint.executeAutofix`.
75 - Trigger command `eslint.executeAutofix` from `:CocCommand`.