aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorgithub-actions[bot] <github-actions[bot]@users.noreply.github.com>2026-02-27 10:20:55 +0000
committergithub-actions[bot] <github-actions[bot]@users.noreply.github.com>2026-02-27 10:20:55 +0000
commitf2193125da0bff2e4eae8e0a45e343ec9bca4c72 (patch)
tree24d6c7e236670d7ce0a418ec5765b6213f2a92c7
parentfix(eslint): don't implicitly enable `experimental.useFlatConfig` #4329 (diff)
downloadnvim-lspconfig-f2193125da0bff2e4eae8e0a45e343ec9bca4c72.tar
nvim-lspconfig-f2193125da0bff2e4eae8e0a45e343ec9bca4c72.tar.gz
nvim-lspconfig-f2193125da0bff2e4eae8e0a45e343ec9bca4c72.tar.bz2
nvim-lspconfig-f2193125da0bff2e4eae8e0a45e343ec9bca4c72.tar.lz
nvim-lspconfig-f2193125da0bff2e4eae8e0a45e343ec9bca4c72.tar.xz
nvim-lspconfig-f2193125da0bff2e4eae8e0a45e343ec9bca4c72.tar.zst
nvim-lspconfig-f2193125da0bff2e4eae8e0a45e343ec9bca4c72.zip
docs: update configs.md
skip-checks: true
-rw-r--r--doc/configs.md28
-rw-r--r--doc/configs.txt26
2 files changed, 42 insertions, 12 deletions
diff --git a/doc/configs.md b/doc/configs.md
index 6f4f0248..8b35516a 100644
--- a/doc/configs.md
+++ b/doc/configs.md
@@ -4092,13 +4092,31 @@ You can use a different version of ESLint in each package, but it is recommended
/!\ When using flat config files, you need to use them across all your packages in your monorepo, as it's a global setting for the server.
+### Flat config in ESLint versions prior to 10.0
+
+If you're using a ESLint version that supports both flat config and eslintrc (>= 8.21, < 10.0) and want to change
+the [default behavior](https://eslint.org/blog/2023/10/flat-config-rollout-plans/), you'll need to set
+`experimental.useFlatConfig` accordingly:
+```lua
+vim.lsp.config("eslint", {
+ settings = {
+ experimental = {
+ -- If you want to use flat config on >= 8.21, < 9.0
+ useFlatConfig = true,
+ -- Or if you want to use eslintrc on 9.*
+ -- useFlatConfig = false,
+ }
+ }
+})
+```
+
Snippet to enable the language server:
```lua
vim.lsp.enable('eslint')
```
Default config:
-- `before_init`: [../lsp/eslint.lua:61](../lsp/eslint.lua#L61)
+- `before_init`: [../lsp/eslint.lua:79](../lsp/eslint.lua#L79)
- `cmd` :
```lua
{ "vscode-eslint-language-server", "--stdio" }
@@ -4116,8 +4134,8 @@ Default config:
["eslint/probeFailed"] = <function 4>
}
```
-- `on_attach`: [../lsp/eslint.lua:61](../lsp/eslint.lua#L61)
-- `root_dir`: [../lsp/eslint.lua:61](../lsp/eslint.lua#L61)
+- `on_attach`: [../lsp/eslint.lua:79](../lsp/eslint.lua#L79)
+- `root_dir`: [../lsp/eslint.lua:79](../lsp/eslint.lua#L79)
- `settings` :
```lua
{
@@ -4134,9 +4152,7 @@ Default config:
enable = false,
mode = "all"
},
- experimental = {
- useFlatConfig = false
- },
+ experimental = {},
format = true,
nodePath = "",
onIgnoredFiles = "off",
diff --git a/doc/configs.txt b/doc/configs.txt
index 8f204ea9..3402f20e 100644
--- a/doc/configs.txt
+++ b/doc/configs.txt
@@ -2855,12 +2855,28 @@ You can use a different version of ESLint in each package, but it is recommended
/!\ When using flat config files, you need to use them across all your packages in your monorepo, as it's a global setting for the server.
+### Flat config in ESLint versions prior to 10.0
+
+If you're using a ESLint version that supports both flat config and eslintrc (>