all posts

My recent contribution to the neovim/nvim-lspconfig repository adds comprehensive eslint language server support using the modern vim.lsp.config api. this pull request addresses issue #3075.

Check out the pull request #3731

nvim-lspconfig is the official Neovim plugin that provides quickstart configurations for Language Server Protocol (LSP) clients. With the release of Neovim 0.11, the project has been transitioning from the legacy require'lspconfig'.setup{} pattern to the new vim.lsp.config API. This modernization effort requires updating all existing configurations to use the new pattern.

The ESLint configuration was one of the remaining configurations that needed to be ported to the new API. Issue #3705 specifically tracked this migration task, and my contribution accomplishes this transition for the eslint language server.

The configuration follows the established patterns in nvim-lspconfig:

return {
	name = "eslint",
	cmd = { "vscode-eslint-language-server", "--stdio" },
	filetypes = {
		"javascript",
		"javascriptreact",
		"javascript.jsx",
		"typescript",
		"typescriptreact",
		"typescript.tsx",
		"vue",
		"svelte",
		"astro",
	},
	root_dir = function(fname)
		return util.root_pattern(
			".eslintrc",
			".eslintrc.js",
			".eslintrc.cjs",
			".eslintrc.yaml",
			".eslintrc.yml",
			".eslintrc.json",
			"eslint.config.js",
			"package.json"
		)(fname) or util.find_git_ancestor(fname)
	end,
	-- ... additional configuration
}