All Projects → warrenseine → Prettier Plugin Csharp

warrenseine / Prettier Plugin Csharp

Licence: mit
Prettier C# Plugin

Programming Languages

javascript
184084 projects - #8 most used programming language
csharp
926 projects
grammar
57 projects

Projects that are alternatives of or similar to Prettier Plugin Csharp

prettier-eslint-atom
DEPRECATED IN FAVOR OF prettier-atom + ESLint integration
Stars: ✭ 64 (-71.43%)
Mutual labels:  formatter, prettier
Plugin Php
Prettier PHP Plugin
Stars: ✭ 1,243 (+454.91%)
Mutual labels:  prettier, formatter
Prettier Eslint
Code ➡️ prettier ➡️ eslint --fix ➡️ Formatted Code ✨
Stars: ✭ 3,435 (+1433.48%)
Mutual labels:  prettier, formatter
pre-commit-hooks
Standardizing our code quality tooling 🛠️
Stars: ✭ 44 (-80.36%)
Mutual labels:  formatter, prettier
Prettier Plugin Apex
Code formatter for the Apex Programming Language
Stars: ✭ 138 (-38.39%)
Mutual labels:  prettier, formatter
csharpier
CSharpier is an opinionated code formatter for c#.
Stars: ✭ 337 (+50.45%)
Mutual labels:  formatter, prettier
Prettier Atom
An atom package for the prettier formatter.
Stars: ✭ 750 (+234.82%)
Mutual labels:  prettier, formatter
Prettier Eslint Cli
CLI for prettier-eslint
Stars: ✭ 451 (+101.34%)
Mutual labels:  prettier, formatter
Javascriptprettier
A Visual Studio extension
Stars: ✭ 118 (-47.32%)
Mutual labels:  prettier, formatter
Prettier
Prettier is an opinionated code formatter.
Stars: ✭ 41,411 (+18387.05%)
Mutual labels:  prettier, formatter
plugin-pug
Prettier Pug Plugin
Stars: ✭ 163 (-27.23%)
Mutual labels:  formatter, prettier
Spotless
Keep your code spotless
Stars: ✭ 2,285 (+920.09%)
Mutual labels:  prettier, formatter
Typescript Express Starter
🚀 TypeScript Express Starter
Stars: ✭ 238 (+6.25%)
Mutual labels:  prettier, formatter
prettier-check
Check that all files match prettier code style.
Stars: ✭ 54 (-75.89%)
Mutual labels:  formatter, prettier
Prettyhtml
💅 The formatter for the modern web https://prettyhtml.netlify.com/
Stars: ✭ 241 (+7.59%)
Mutual labels:  prettier, formatter
Parallel Prettier
Concurrent prettier runner
Stars: ✭ 84 (-62.5%)
Mutual labels:  prettier, formatter
Pettier
Prettier config that randomizes options and arbitrarily switches between spaces and tabs 🙄
Stars: ✭ 149 (-33.48%)
Mutual labels:  prettier, formatter
Poetic
Automatically install and maintain ESLint, Prettier, EditorConfig and Airbnb rules for JavaScript, TypeScript and React.
Stars: ✭ 165 (-26.34%)
Mutual labels:  prettier, formatter
Nixfmt
A formatter for Nix code
Stars: ✭ 201 (-10.27%)
Mutual labels:  formatter
React Luo
React Automatically - 保持最新技术 react17 hooks router5 webpack5 babel7 antd4
Stars: ✭ 211 (-5.8%)
Mutual labels:  prettier

🚧 Work in Progress! 🚧

Prettier C#

Prettier C# Plugin

Gitter Travis npm version code style: prettier Follow+Prettier+on+Twitter

Intro

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.

WORK IN PROGRESS

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.

Install

yarn add --dev --exact prettier prettier-plugin-csharp

Use

prettier --write "**/*.cs"

How it works

The 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. The grammar is precompiled to plain JavaScript and ready to use in the project.

Contributing

Installing dependencies

Use your favorite Node package manager:

yarn

Updating the grammar

The grammar supports C# 6 as a baseline, and tries to catch up with recent additions. Contributions are welcome. To update the grammar:

  • Update src/csharp/*.g4 files.
  • Ensure you have Java 8+ installed on your machine.
  • Fetch a local copy of ANTLR:
yarn fetch-antlr
  • Generate the JavaScript parser:
yarn generate-parser

Testing

The project is developed against a single grammar-complete regression test. There are no unit tests for the moment.

Run the test with:

yarn test

To test it out on an actual C# file:

  • Clone this repository.
  • Run yarn.
  • Run yarn prettier Your/File.cs to check the output.

Maintainers

Warren Seine
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].