ESLint and Prettier Format on Save? #13602
Unanswered
mikecfisher
asked this question in
Q&A
Replies: 1 comment
-
Hmm I think I finally got it with the help of Claude. Here is what seems to be working for me. If anyone has feedback on my config overall let me know. I'm still pretty new to Zed. {
"assistant": {
"version": "1",
"provider": {
"name": "openai",
"default_model": "gpt-4o"
}
},
"telemetry": {
"metrics": true
},
"features": {
"inline_completion_provider": "supermaven"
},
"language_servers": ["vtsls", "typescript-language-server", "eslint"],
"language_server_options": {
"vtsls": {
"language_ids": [
"typescript",
"javascript",
"typescriptreact",
"javascriptreact"
]
},
"typescript-language-server": {
"language_ids": [
"typescript",
"javascript",
"typescriptreact",
"javascriptreact"
],
"initialization_options": {
"preferences": {
"includeInlayParameterNameHints": "all",
"includeInlayParameterNameHintsWhenArgumentMatchesName": true,
"includeInlayFunctionParameterTypeHints": true,
"includeInlayVariableTypeHints": true,
"includeInlayVariableTypeHintsWhenTypeMatchesName": false,
"includeInlayPropertyDeclarationTypeHints": true,
"includeInlayFunctionLikeReturnTypeHints": true,
"includeInlayEnumMemberValueHints": true
}
}
},
"eslint": {
"language_ids": [
"typescript",
"javascript",
"typescriptreact",
"javascriptreact"
],
"initialization_options": {
"run_formatter": true
}
}
},
"languages": {
"TypeScript": {
"formatter": "prettier",
"code_actions_on_format": {
"source.fixAll.eslint": true
},
"format_on_save": {
"external": {
"command": "prettier",
"arguments": ["--stdin-filepath", "{buffer_path}"]
}
}
},
"TSX": {
"formatter": "prettier",
"code_actions_on_format": {
"source.fixAll.eslint": true
},
"format_on_save": "on"
},
"JavaScript": {
"formatter": "prettier",
"code_actions_on_format": {
"source.fixAll.eslint": true
},
"format_on_save": "on"
}
},
"formatter": {
"code_actions": {
"source.fixAll.eslint": true
}
},
"relative_line_numbers": true,
"theme": "Atelier Forest Light",
"buffer_font_size": 15,
"buffer_font_family": "FuraCode NF",
"vim_mode": true,
"format_on_save": "on",
"autosave": {
"after_delay": {
"milliseconds": 1000
}
},
"indent_guides": {
"render": true,
"character": "│",
"skip_first_level": false
},
"project_panel": {
"file_icons": true
},
"vim": {
"use_multiline_registers": true,
"surround": true,
"sneak": true
}
} |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi all I'm loving Zed and trying to switch from VSCode. I'm almost there except for this seemingly trivial tweak. I have some eslint formatting rules like sorting Typescript Imports as well as prettier rules. I want Zed to format both of these every time I hit save. For the life of me I can't seem to get them both working. Any ideas how I fix this?
Here is my config
Beta Was this translation helpful? Give feedback.
All reactions