Your buddy who knows how to make your code pretty using Prettier.
Easily add, configure, and use Prettier in your project. Extends the functionalities of Angular CLI, but also works without it, even for non-angular projects.
A tool from the Angular Buddies project.
Add Prettier to your project
This buddy will handle everything for you : Prettier dependencies,scripts and default configurations.
with Angular Cli
ng add @angular-buddies/prettier
without Angular CLI
- install the package, locally or globally:
npm i [-g] @angular-buddies/prettier
yarn [global] add @angular-buddies/prettier
- run the prettier-init schematic in your project
This package provide angular-devkit schematics in order to enhance prettier integration in your project.
If you are using Angular, we recommand to use Angular CLI. But if you don't, that ok: this buddy covered it for you too.
See this package's schematics documentation for more informations.
How To run a Schematic
Using Angular CLI
ng generate [@angular-buddies/prettier:]<schematic>
FYI: you can remove this collection (
@angular-buddies/prettier:) from this command if you choose to set this package as your default collection during its initialisation.
Without Angular CLI
You'll need to install @angular-devkit/schematics-cli before anything:
npm i [-g] @angular-dekit/schematics-cli
Scripts are generated by the
prettier-init schematic. You'll need to run it before using this scripts.
Run prettier on all your workspace files.
npm run prettify
Originally, the first idea of this project was ased on the comment added to an associated issue in angular-cli.