Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/MunifTanjim/eslint.nvim

ESLint plugin for Neovim's built-in LSP client.
https://github.com/MunifTanjim/eslint.nvim

eslint neovim neovim-lsp neovim-plugin

Last synced: about 2 months ago
JSON representation

ESLint plugin for Neovim's built-in LSP client.

Awesome Lists containing this project

README

        

# eslint.nvim

ESLint plugin for Neovim's built-in LSP client.

## Requirements

- [Neovim 0.5.0](https://github.com/neovim/neovim/releases/tag/v0.5.0)
- [`neovim/nvim-lspconfig`](https://github.com/neovim/nvim-lspconfig)
- [`jose-elias-alvarez/null-ls`](https://github.com/jose-elias-alvarez/null-ls.nvim)

## Installation

Install the plugins with your preferred plugin manager. For example, with [`vim-plug`](https://github.com/junegunn/vim-plug):

```vim
Plug 'neovim/nvim-lspconfig'
Plug 'jose-elias-alvarez/null-ls.nvim'
Plug 'MunifTanjim/eslint.nvim'
```

## Setup

`eslint.nvim` needs to be initialized with the `require("eslint").setup()` function.

For example:

```lua
local null_ls = require("null-ls")
local eslint = require("eslint")

null_ls.setup()

eslint.setup({
bin = 'eslint', -- or `eslint_d`
code_actions = {
enable = true,
apply_on_save = {
enable = true,
types = { "directive", "problem", "suggestion", "layout" },
},
disable_rule_comment = {
enable = true,
location = "separate_line", -- or `same_line`
},
},
diagnostics = {
enable = true,
report_unused_disable_directives = false,
run_on = "type", -- or `save`
},
})
```

## Acknowledgements

- [`jose-elias-alvarez/nvim-lsp-ts-utils`](https://github.com/jose-elias-alvarez/nvim-lsp-ts-utils)
most of the stuffs are extracted from this plugin.

## License

Licensed under the MIT License. Check the [LICENSE](./LICENSE) file for details.