Add working directories for eslint (#9738)
Fix #9648 Release notes: - Added ability to configure ESLint's `workingDirectories` in settings. Example: `{"lsp":{"eslint":{"settings":{"workingDirectories":["./client","./server"]}}}}`. #9648 --------- Co-authored-by: Thorsten Ball <mrnugget@gmail.com>
This commit is contained in:
parent
2f2f236afe
commit
96a1af7b0f
2 changed files with 20 additions and 0 deletions
|
@ -277,6 +277,9 @@ impl LspAdapter for EsLintLspAdapter {
|
|||
let use_flat_config = Self::FLAT_CONFIG_FILE_NAMES
|
||||
.iter()
|
||||
.any(|file| workspace_root.join(file).is_file());
|
||||
let working_directories = eslint_user_settings
|
||||
.get("workingDirectories")
|
||||
.unwrap_or(&Value::Null);
|
||||
|
||||
json!({
|
||||
"": {
|
||||
|
@ -292,6 +295,7 @@ impl LspAdapter for EsLintLspAdapter {
|
|||
},
|
||||
"problems": {},
|
||||
"codeActionOnSave": code_action_on_save,
|
||||
"workingDirectories": working_directories,
|
||||
"experimental": {
|
||||
"useFlatConfig": use_flat_config,
|
||||
},
|
||||
|
|
|
@ -85,3 +85,19 @@ You can configure ESLint's `nodePath` setting (requires Zed `0.127.0`):
|
|||
}
|
||||
}
|
||||
```
|
||||
|
||||
#### Configure ESLint's `workingDirectories`:
|
||||
|
||||
You can configure ESLint's `workingDirectories` setting (requires Zed `0.130.x`):
|
||||
|
||||
```json
|
||||
{
|
||||
"lsp": {
|
||||
"eslint": {
|
||||
"settings": {
|
||||
"workingDirectories": ["./client", "./server"]
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue