Prettier C# Plugin
:construction: Work in Progress! :construction:
Prettier C# adds C# support to the Prettier code formatter. Like Prettier, it is opinionated and restricts style options to a minimum. It runs where Prettier runs, including CI and pre-commit hooks.
Please note that this plugin is under active development, and might not be ready to run on production code yet. It will break your code.
Preview the result with this diff example.
yarn add --dev --exact prettier prettier-plugin-csharp
prettier --write "**/*.cs"
Use your favorite Node package manager:
The grammar supports C# 6 as a baseline, and tries to catch up with recent additions. Contributions are welcome. To update the grammar:
The project is developed against a single grammar-complete regression test. There are no unit tests for the moment.
Run the test with:
To test it out on an actual C# file:
yarn prettier Your/File.csto check the output.