Registry / serialization / prettier-plugin-csharp

prettier-plugin-csharp

JSON →
library0.6.0-developmentjsnpmunverified

A Prettier plugin to format C# code using Prettier's opinionated style. Current version is 0.6.0-development, indicating pre-release status with active development. Released under a permissive license. Differentiator: brings Prettier's zero-config, deterministic formatting to C# projects, unlike other C# formatters that require extensive configuration. However, due to its early stage, it may break code and is not ready for production use.

npm install prettier-plugin-csharp
INSTALL
IMPORT
SIG · PRETTIER-PLUGIN-CS
P
prettier-plugin-csharp
serializationjavascriptv0.6.0-development
Install
Import
Disk
Pass rate
0/ 6
Env Coverage0 / 6
glibc
1822
musl
1822
Install & Compatibility
Where this runs
tested against v? · npm install
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
node 18226 runs
build_error
glibc
node 18226 runs
build_error
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

default
No import needed; plugin auto-detected by Prettier when installed.
Trying to import plugin directly: `import prettierPluginCsharp from 'prettier-plugin-csharp'`
Plugins are auto-discovered by Prettier when installed in the project's node_modules.

Install the plugin and run Prettier on all C# files in the project.

yarn add --dev --exact prettier prettier-plugin-csharp prettier --write "**/*.cs"
prettier --version
Debug
Known issues
breakingPlugin is under active development and may break your code.
fix
Do not use on production code; test on a copy first.
affects: >=0.0.0
gotchaRelies on a fork of an unofficial ANTLR grammar; may not fully support all C# constructs.
fix
Review formatted output for correctness, especially with advanced features.
affects: >=0.0.0
gotchaNo unit tests; only a single regression test exists.
fix
Manually test formatting on your codebase.
affects: >=0.0.0
Errors
Common errors & fixes
Error: Cannot find module 'prettier-plugin-csharp'
Plugin not installed or Prettier cannot locate it.
fix
Ensure prettier-plugin-csharp is installed in the same node_modules as prettier.
Prettier encountered an error while formatting file.cs: ... unexpected token
C# syntax not supported by the ANTLR grammar used.
fix
Simplify the code or contribute to the grammar; avoid unsupported features.
prettier-plugin-csharp: not a valid plugin
Installed version incompatible with Prettier's plugin API.
fix
Use exact versions: yarn add --dev --exact prettier prettier-plugin-csharp
Upgrade
Version history
0.6.0-developmentlatest on npm
Audit
Dependencies
prettierrequiredPeer dependency; plugin requires Prettier to function.
Agent activity
6 hits · last 30 days
node
6
Resources
prettier-plugin-csharp — npm install prettier-plugin-csharp · libregistry