prettier-plugin-csharp
prettier-plugin-csharp copied to clipboard
Empty braces are not consistently formatted
Empty braces are printed inline for classes & structs, but printed on separate lines for if
statements and method blocks.
e.g.
// inline
class Foo { }
// separate lines
if (true)
{
}
I'd prefer to standardize on inlining empty braces, which is how Prettier proper handles JS.
Javascript handles it as follows:
class foo {}
class bar {
constructor() {}
}
class baz {
constructor() {
if (true) {
}
if (!false) {
try {
} catch (err) {
console.error(err);
} finally {
}
}
}
}
This seems consistent.
This repository is unmaintained and the project is incomplete, don't expect anything else than a toy C# project to reformat correctly. I can accept PRs though.