diff --git a/modules/nixvim/lsp.nix b/modules/nixvim/lsp.nix index 99cdb9a..42425d5 100644 --- a/modules/nixvim/lsp.nix +++ b/modules/nixvim/lsp.nix @@ -51,6 +51,68 @@ "eslint.config.mts" "eslint.config.cts" ]; + settings = { + validate = "on"; + useESLintClass = false; + experimental = { + useFlatConfig = false; + }; + codeActionOnSave = { + enable = false; + mode = "all"; + }; + format = true; + quiet = false; + onIgnoredFiles = "off"; + rulesCustomizations = { }; + run = "onType"; + problems = { + shortenToSingleLine = false; + }; + nodePath = ""; + workingDirectory = { + mode = "auto"; + }; + codeAction = { + disableRuleComment = { + enable = true; + location = "separateLine"; + }; + showDocumentation = { + enable = true; + }; + }; + }; + handlers = { + "eslint/openDoc".__raw = /* lua */ '' + function(_, result) + if result then + vim.ui.open(result.url) + end + return {} + end + ''; + "eslint/confirmESLintExecution" = /* lua */ '' + function(_, result) + if not result then + return + end + return 4 -- approved + end + ''; + "eslint/probeFailed" = /* lua */ '' + function() + vim.notify("[lspconfig] ESLint probe failed.", vim.log.levels.WARN) + return {} + end + ''; + "eslint/noLibrary" = /* lua */ '' + function() + vim.notify("[lspconfig] Unable to find ESLint library.", vim.log.levels.WARN) + return {} + end + ''; + }; before_init.__raw = /* lua */ '' function(_, config) local eslint_config_files = {