Skip to content

armgit / zed

Public Imported from GitHub
0

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.

Allow users to configure ESLint's `problems` settings (#9981)

William Villeneuve463c16a402b8
diff --git a/crates/languages/src/typescript.rs b/crates/languages/src/typescript.rs
index a05e33641d0..ad4543e4d20 100644
--- a/crates/languages/src/typescript.rs
+++ b/crates/languages/src/typescript.rs
@@ -273,6 +273,11 @@ impl LspAdapter for EsLintLspAdapter {
}
}
+ let problems = eslint_user_settings
+ .get("problems")
+ .cloned()
+ .unwrap_or_else(|| json!({}));
+
let node_path = eslint_user_settings.get("nodePath").unwrap_or(&Value::Null);
let use_flat_config = Self::FLAT_CONFIG_FILE_NAMES
.iter()
@@ -290,7 +295,7 @@ impl LspAdapter for EsLintLspAdapter {
"name": workspace_root.file_name()
.unwrap_or_else(|| workspace_root.as_os_str()),
},
- "problems": {},
+ "problems": problems,
"codeActionOnSave": code_action_on_save,
"experimental": {
"useFlatConfig": use_flat_config,
diff --git a/docs/src/languages/javascript.md b/docs/src/languages/javascript.md
index a5d8fa0971a..45be3c9f053 100644
--- a/docs/src/languages/javascript.md
+++ b/docs/src/languages/javascript.md
@@ -85,3 +85,21 @@ You can configure ESLint's `nodePath` setting (requires Zed `0.127.0`):
}
}
```
+
+#### Configure ESLint's `problems.shortenToSingleLine`:
+
+You can configure ESLint's `problems.shortenToSingleLine` setting (requires Zed `0.130.x`):
+
+```json
+{
+ "lsp": {
+ "eslint": {
+ "settings": {
+ "problems": {
+ "shortenToSingleLine": true
+ }
+ }
+ }
+ }
+}
+```