{"id":20349,"library":"prettier-plugin-csharp","title":"Prettier C# Plugin","description":"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.","status":"active","version":"0.6.0-development","language":"javascript","source_language":"en","source_url":"https://github.com/warrenseine/prettier-plugin-csharp","tags":["javascript"],"install":[{"cmd":"npm install prettier-plugin-csharp","lang":"bash","label":"npm"},{"cmd":"yarn add prettier-plugin-csharp","lang":"bash","label":"yarn"},{"cmd":"pnpm add prettier-plugin-csharp","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Peer dependency; plugin requires Prettier to function.","package":"prettier","optional":false}],"imports":[{"note":"Plugins are auto-discovered by Prettier when installed in the project's node_modules.","wrong":"Trying to import plugin directly: `import prettierPluginCsharp from 'prettier-plugin-csharp'`","symbol":"default","correct":"No import needed; plugin auto-detected by Prettier when installed."}],"quickstart":{"code":"yarn add --dev --exact prettier prettier-plugin-csharp\nprettier --write \"**/*.cs\"","lang":"typescript","description":"Install the plugin and run Prettier on all C# files in the project."},"warnings":[{"fix":"Do not use on production code; test on a copy first.","message":"Plugin is under active development and may break your code.","severity":"breaking","affected_versions":">=0.0.0"},{"fix":"Review formatted output for correctness, especially with advanced features.","message":"Relies on a fork of an unofficial ANTLR grammar; may not fully support all C# constructs.","severity":"gotcha","affected_versions":">=0.0.0"},{"fix":"Manually test formatting on your codebase.","message":"No unit tests; only a single regression test exists.","severity":"gotcha","affected_versions":">=0.0.0"}],"env_vars":null,"last_verified":"2026-04-25T00:00:00.000Z","next_check":"2026-07-24T00:00:00.000Z","problems":[{"fix":"Ensure prettier-plugin-csharp is installed in the same node_modules as prettier.","cause":"Plugin not installed or Prettier cannot locate it.","error":"Error: Cannot find module 'prettier-plugin-csharp'"},{"fix":"Simplify the code or contribute to the grammar; avoid unsupported features.","cause":"C# syntax not supported by the ANTLR grammar used.","error":"Prettier encountered an error while formatting file.cs: ... unexpected token"},{"fix":"Use exact versions: yarn add --dev --exact prettier prettier-plugin-csharp","cause":"Installed version incompatible with Prettier's plugin API.","error":"prettier-plugin-csharp: not a valid plugin"}],"ecosystem":"npm","meta_description":null,"install_score":null,"install_tag":null,"quickstart_score":null,"quickstart_tag":null}