Repository navigation
Description
π Search Terms
formatter blank line
β Viability Checklist
- This wouldn't be a breaking change in existing TypeScript/JavaScript code
- This wouldn't change the runtime behavior of existing JavaScript code
- This could be implemented without emitting different JS based on the types of the expressions
- This isn't a runtime feature (e.g. library functionality, non-ECMAScript syntax with JavaScript output, new syntax sugar for JS, etc.)
- This isn't a request to add a new utility type: https://github.com/microsoft/TypeScript/wiki/No-New-Utility-Types
- This feature would agree with the rest of our Design Goals: https://github.com/Microsoft/TypeScript/wiki/TypeScript-Design-Goals
β Suggestion
I'm using the new TypeScript formatter ("tsgo" one). In Zed here are my settings:
"TypeScript": {
"formatter": "language_server",
"format_on_save": "on",
"language_servers": [
"typescript-ls",
"!vtsls",
"!typescript-language-server",
"..."
]
},I'd like the formatter to perform more cleanup for example removing some unnecessary blank lines
interface Foo {
bar: boolean;
}Would be formatted to
interface Foo {
bar: boolean;
}Also when I'm programming in Rust I like the blank_lines_upper_bound settings with default value 1. Meaning
const foo = "foo";
const bar = "bar";would be formatted to
const foo = "foo";
const bar = "bar";There is also another settings with rustfmt called blank_lines_lower_bound but I personally don't change the default 0 value.
If I'm not mistaken, this is currently not possible to configure such behaviors with the default TypeScript formatter.
Would that be possible to implement them?
π Motivating Example
N/A
π» Use Cases
-
What do you want to use this for?
Better auto-formatting when saving my TypeScript files -
What shortcomings exist with current approaches?
We need to manually clean all those unnecessary blank lines -
What workarounds are you using in the meantime?
Using Prettier instead
Activity