{"id":13827705,"url":"https://github.com/warrenseine/prettier-plugin-csharp","last_synced_at":"2025-04-06T02:11:36.766Z","repository":{"id":37789995,"uuid":"125337723","full_name":"warrenseine/prettier-plugin-csharp","owner":"warrenseine","description":"Prettier C# Plugin","archived":false,"fork":false,"pushed_at":"2023-07-11T21:22:39.000Z","size":3346,"stargazers_count":251,"open_issues_count":6,"forks_count":15,"subscribers_count":10,"default_branch":"master","last_synced_at":"2024-04-26T18:22:12.197Z","etag":null,"topics":["antlr","csharp","formatter","grammar","javascript","prettier"],"latest_commit_sha":null,"homepage":null,"language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/warrenseine.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2018-03-15T08:46:16.000Z","updated_at":"2024-04-13T04:14:00.000Z","dependencies_parsed_at":"2024-01-18T04:23:29.154Z","dependency_job_id":null,"html_url":"https://github.com/warrenseine/prettier-plugin-csharp","commit_stats":{"total_commits":137,"total_committers":5,"mean_commits":27.4,"dds":"0.15328467153284675","last_synced_commit":"4c15585f09acf8f91f54ca5dedd79cad8b3b5f5d"},"previous_names":["warrenseine/prettier-csharp"],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/warrenseine%2Fprettier-plugin-csharp","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/warrenseine%2Fprettier-plugin-csharp/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/warrenseine%2Fprettier-plugin-csharp/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/warrenseine%2Fprettier-plugin-csharp/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/warrenseine","download_url":"https://codeload.github.com/warrenseine/prettier-plugin-csharp/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247423515,"owners_count":20936626,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["antlr","csharp","formatter","grammar","javascript","prettier"],"created_at":"2024-08-04T09:02:05.700Z","updated_at":"2025-04-06T02:11:36.747Z","avatar_url":"https://github.com/warrenseine.png","language":"JavaScript","readme":"\u003cp align=\"center\"\u003e\n    ❌ This repository is unmaintained and the project is incomplete, don't expect anything else than a toy C# project to reformat correctly! ❌\n\u003c/p\u003e\n\u003cp align=\"center\"\u003e\n    Have a look at \u003ca href=\"https://github.com/belav/csharpier\"\u003eCSharpier\u003c/a\u003e instead.\n\u003c/p\u003e\n\u003chr\u003e\n\n\u003cdiv align=\"center\"\u003e\n\u003cimg alt=\"Prettier\"\n  src=\"https://cdn.rawgit.com/prettier/prettier-logo/master/images/prettier-icon-light.svg\"\u003e\n\u003cimg alt=\"C#\"\n  hspace=\"25\"\n  height=\"210\"\n  src=\"https://upload.wikimedia.org/wikipedia/commons/4/4f/Csharp_Logo.png\"\u003e\n\u003c/div\u003e\n\n\u003ch2 align=\"center\"\u003ePrettier C# Plugin\u003c/h2\u003e\n\n\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://gitter.im/jlongster/prettier\"\u003e\n    \u003cimg alt=\"Gitter\" src=\"https://img.shields.io/gitter/room/jlongster/prettier.svg?style=flat-square\"\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://travis-ci.org/warrenseine/prettier-plugin-csharp\"\u003e\n    \u003cimg alt=\"Travis\" src=\"https://img.shields.io/travis/warrenseine/prettier-plugin-csharp/master.svg?style=flat-square\"\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://www.npmjs.com/package/prettier-plugin-csharp\"\u003e\n    \u003cimg alt=\"npm version\" src=\"https://img.shields.io/npm/v/prettier-plugin-csharp.svg?style=flat-square\"\u003e\n  \u003c/a\u003e\n  \u003ca href=\"#badge\"\u003e\n    \u003cimg alt=\"code style: prettier\" src=\"https://img.shields.io/badge/code_style-prettier-ff69b4.svg?style=flat-square\"\u003e\n  \u003c/a\u003e\n  \u003ca href=\"https://twitter.com/PrettierCode\"\u003e\n    \u003cimg alt=\"Follow+Prettier+on+Twitter\" src=\"https://img.shields.io/twitter/follow/prettiercode.svg?label=follow+prettier\u0026style=flat-square\"\u003e\n  \u003c/a\u003e\n\u003c/p\u003e\n\n## Intro\n\nPrettier C# adds C# support to the [Prettier](https://github.com/prettier/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.\n\n## Unmaintained\n\nThis repository is unmaintained and the project is incomplete, don't expect anything else than a toy C# project to reformat correctly! **It will break your code.**\n\nPreview the result with this [diff example](https://github.com/warrenseine/prettier-csharp-demo/pull/1/commits/8652271a499740b726e6342346e97447abd23162).\n\n## Install\n\n```bash\nyarn add --dev --exact prettier prettier-plugin-csharp\n```\n\n## Use\n\n```bash\nprettier --write \"**/*.cs\"\n```\n\n## How it works\n\nThe plugin is written in JavaScript. It depends on the JavaScript port of ANTLR and relies on a fork of an [unofficial C# 6 grammar from ANTLR](https://github.com/antlr/grammars-v4/tree/master/csharp). The grammar is precompiled to plain JavaScript and ready to use in the project.\n\n## Contributing\n\n### Installing dependencies\n\nUse your favorite Node package manager:\n\n```bash\nyarn\n```\n\n### Updating the grammar\n\nThe grammar supports C# 6 as a baseline, and tries to catch up with recent additions. Contributions are welcome. To update the grammar:\n\n- Update `src/csharp/*.g4` files.\n- Ensure you have Java 8+ installed on your machine.\n- Fetch a local copy of ANTLR:\n\n```bash\nyarn fetch-antlr\n```\n\n- Generate the JavaScript parser:\n\n```bash\nyarn generate-parser\n```\n\n### Testing\n\nThe project is developed against a single grammar-complete regression test. There are no unit tests for the moment.\n\nRun the test with:\n\n```bash\nyarn test\n```\n\nTo test it out on an actual C# file:\n\n- Clone this repository.\n- Run `yarn`.\n- Run `yarn prettier Your/File.cs` to check the output.\n\n## Maintainers\n\n\u003ctable\u003e\n  \u003ctbody\u003e\n    \u003ctr\u003e\n      \u003ctd align=\"center\"\u003e\n        \u003ca href=\"https://github.com/warrenseine\"\u003e\n          \u003cimg width=\"150\" height=\"150\" src=\"https://github.com/warrenseine.png?v=3\u0026s=150\"\u003e\n          \u003c/br\u003e\n          Warren Seine\n        \u003c/a\u003e\n      \u003c/td\u003e\n    \u003c/tr\u003e\n  \u003ctbody\u003e\n\u003c/table\u003e\n","funding_links":[],"categories":["JavaScript"],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwarrenseine%2Fprettier-plugin-csharp","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fwarrenseine%2Fprettier-plugin-csharp","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fwarrenseine%2Fprettier-plugin-csharp/lists"}