From 0f51af5cad7ab88f80bcbc8e92d4b1f306fc1d8d Mon Sep 17 00:00:00 2001 From: Anton Date: Wed, 27 Apr 2022 14:14:03 +0100 Subject: [PATCH] fix(eslint): add missing root_pattern (#1869) Even though this file name was removed from the official docs https://eslint.org/docs/user-guide/configuring/configuration-files#configuration-file-formats Eslint still supports the older `.eslintrc` and it is used in tests https://github.com/eslint/eslint/blob/9ecd42f36462331a0d697e74323a4d24f0cf02fc/tests/fixtures/.eslintrc The loading is done by the legacy package `@eslint/eslintrc` that is still used by eslint itself ``` ~/Documents/repositories/eslint $ npm instll && rg '".eslintrc"' ./node_modules/@eslint/eslintrc/lib -B 6 ./node_modules/@eslint/eslintrc/lib/config-array-factory.js 66-const configFilenames = [ 67- ".eslintrc.js", 68- ".eslintrc.cjs", 69- ".eslintrc.yaml", 70- ".eslintrc.yml", 71- ".eslintrc.json", 72: ".eslintrc", ``` --- lua/lspconfig/server_configurations/eslint.lua | 1 + 1 file changed, 1 insertion(+) diff --git a/lua/lspconfig/server_configurations/eslint.lua b/lua/lspconfig/server_configurations/eslint.lua index 925cdfeea4..47c6ae2ece 100644 --- a/lua/lspconfig/server_configurations/eslint.lua +++ b/lua/lspconfig/server_configurations/eslint.lua @@ -63,6 +63,7 @@ return { }, -- https://eslint.org/docs/user-guide/configuring/configuration-files#configuration-file-formats root_dir = util.root_pattern( + '.eslintrc', '.eslintrc.js', '.eslintrc.cjs', '.eslintrc.yaml',