diff options
| author | William Boman <william@redwill.se> | 2021-05-03 00:03:41 +0200 |
|---|---|---|
| committer | William Boman <william@redwill.se> | 2021-05-03 00:03:41 +0200 |
| commit | c0ca69cfbd017d2ec4209278a0b74270f8dbdc18 (patch) | |
| tree | 1425acb07f369a004f44deaf2b248beb9d238d7f /lua | |
| parent | add vuels (#11) (diff) | |
| download | mason-c0ca69cfbd017d2ec4209278a0b74270f8dbdc18.tar mason-c0ca69cfbd017d2ec4209278a0b74270f8dbdc18.tar.gz mason-c0ca69cfbd017d2ec4209278a0b74270f8dbdc18.tar.bz2 mason-c0ca69cfbd017d2ec4209278a0b74270f8dbdc18.tar.lz mason-c0ca69cfbd017d2ec4209278a0b74270f8dbdc18.tar.xz mason-c0ca69cfbd017d2ec4209278a0b74270f8dbdc18.tar.zst mason-c0ca69cfbd017d2ec4209278a0b74270f8dbdc18.zip | |
eslintls: fix issue with accessing non-existent lspconfig
Diffstat (limited to 'lua')
| -rw-r--r-- | lua/nvim-lsp-installer/servers/eslintls.lua | 80 |
1 files changed, 36 insertions, 44 deletions
diff --git a/lua/nvim-lsp-installer/servers/eslintls.lua b/lua/nvim-lsp-installer/servers/eslintls.lua index 6a514fb4..26b5bba6 100644 --- a/lua/nvim-lsp-installer/servers/eslintls.lua +++ b/lua/nvim-lsp-installer/servers/eslintls.lua @@ -3,53 +3,45 @@ local configs = require'lspconfig/configs' local server = require'nvim-lsp-installer.server' -if not lspconfig.eslintls then - configs.eslintls = { - default_config = { - filetypes = {'javascript', 'javascriptreact', 'typescript', 'typescriptreact'}, - root_dir = lspconfig.util.root_pattern(".eslintrc*", "package.json", ".git"), - - -- Refer to https://github.com/Microsoft/vscode-eslint#settings-options for documentation. - settings = { - validate = 'on', - run = 'onType', - - codeAction = { - disableRuleComment = { - enable = true, - -- "sameLine" might not work as expected, see https://github.com/williamboman/nvim-lsp-installer/issues/4 - location = "separateLine", - }, - showDocumentation = { - enable = true - } - }, - - rulesCustomizations = {}, - - -- Automatically determine working directory by locating .eslintrc config files. - -- - -- It's recommended not to change this. - workingDirectory = {mode = "auto"}, - - -- If nodePath is a non-null/undefined value the eslint LSP runs into runtime exceptions. - -- - -- It's recommended not to change this. - nodePath = '', - - -- The "workspaceFolder" is a VSCode concept. We set it to the root - -- directory to not restrict the LPS server when it traverses the - -- file tree when locating a .eslintrc config file. - -- - -- It's recommended not to change this. - workspaceFolder = { - uri = "/", - name = "root", +configs.eslintls = { + default_config = { + filetypes = {"javascript", "javascriptreact", "typescript", "typescriptreact"}, + root_dir = lspconfig.util.root_pattern(".eslintrc*", "package.json", ".git"), + -- Refer to https://github.com/Microsoft/vscode-eslint#settings-options for documentation. + settings = { + validate = "on", + run = "onType", + codeAction = { + disableRuleComment = { + enable = true, + -- "sameLine" might not work as expected, see https://github.com/williamboman/nvim-lsp-installer/issues/4 + location = "separateLine" }, + showDocumentation = { + enable = true + } }, - }, + rulesCustomizations = {}, + -- Automatically determine working directory by locating .eslintrc config files. + -- + -- It's recommended not to change this. + workingDirectory = {mode = "auto"}, + -- If nodePath is a non-null/undefined value the eslint LSP runs into runtime exceptions. + -- + -- It's recommended not to change this. + nodePath = "", + -- The "workspaceFolder" is a VSCode concept. We set it to the root + -- directory to not restrict the LPS server when it traverses the + -- file tree when locating a .eslintrc config file. + -- + -- It's recommended not to change this. + workspaceFolder = { + uri = "/", + name = "root" + } + } } -end +} local ConfirmExecutionResult = { deny = 1, |
