From 84d70ced053288c6a204867620fa4c55e4824d10 Mon Sep 17 00:00:00 2001 From: Rodrigo <92694057+rodrii-dp@users.noreply.github.com> Date: Wed, 18 Mar 2026 16:45:03 +0100 Subject: [PATCH] languages: Support more JSON configuration files (#50800) Several widely used configuration files are JSON but have no `.json` extension, such as `.babelrc` or `.eslintrc`. Editors like VS Code detect these as JSON automatically, but Zed currently treats them as plain text. This change adds common JSON config suffixes so they get proper JSON syntax highlighting. Added: - [`.babelrc`](https://babeljs.io/docs/config-files) - [`.eslintrc`](https://archive.eslint.org/docs/user-guide/configuring/configuration-files) - [`.stylelintrc`](https://stylelint.io/user-guide/configure/) - [`.swcrc`](https://github.com/swc-project/swc/pull/4236) Before you mark this PR as ready for review, make sure that you have: - [x] Added a solid test coverage and/or screenshots from doing manual testing - [ ] Done a self-review taking into account security and performance aspects - [ ] Aligned any UI changes with the [UI checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist) Release Notes: - Support more JSON configuration files --- crates/languages/src/jsonc/config.toml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/languages/src/jsonc/config.toml b/crates/languages/src/jsonc/config.toml index 85fb9e26c446ad705d9225422ae4fae29e03b708..95ace4bb4ee29da67450409568ddc2cd3022a28e 100644 --- a/crates/languages/src/jsonc/config.toml +++ b/crates/languages/src/jsonc/config.toml @@ -1,6 +1,6 @@ name = "JSONC" grammar = "jsonc" -path_suffixes = ["jsonc", "bun.lock", "devcontainer.json", "pyrightconfig.json", "tsconfig.json", "luaurc"] +path_suffixes = ["jsonc", "bun.lock", "devcontainer.json", "pyrightconfig.json", "tsconfig.json", "luaurc", "swcrc", "babelrc", "eslintrc", "stylelintrc"] line_comments = ["// "] autoclose_before = ",]}" brackets = [