0.5.0 • Published 6 years ago

@mace/prettier-schematics v0.5.0

Weekly downloads
37
License
MIT
Repository
-
Last release
6 years ago

Prettier-schematics

@angular/devkit Schematics for Prettier.

Motivation

Based on the comment added to an associated issue in angular-cli.

Installation

With Angular CLI v6+

The main goal of this package is to permit to add Prettier dependencies, scripts and default configuration to your Angular CLI workspace in just one command :

ng add @mace/prettier-schematics

Without Angular CLI v6+

You can also install prettier-schematics with npm or yarn, using :

  • npm i [-g] @mace/prettier-schematics
  • or yarn [global] add @mace/prettier-schematics

Schematics

In order to run one of the following schematics, you could either use :

  • Angular CLI

    ng generate <schematic> --collection=@mace/prettier-schematics

  • or the Schematics CLI

    schematics @mace/prettier-schematics:<schematic>

    To do so, you'll have to install it globally, along with prettier-schematics :

    • npm i -g @angular-devkit/schematics-cli
    • or yarn global add @angular-devkit/schematics-cli

For more informations about Schematics, go to Schematics — An Introduction.

prettier-init

Initialize your project to allow the use of prettier.

Alias : ng-add

The following schematics are also run when using this one : prettier-config

This is the schematic Angular CLI will run when using ng add.

Options

+ all prettier-config and prettier-hook options

prettier-config

Generate prettier config files.

Options

prettier-hook

Generate a git pre-commit hook (thanks to husky and lint-staged) which auto-format your staged files with prettier before any commit.

Options

Scripts

Scripts are generated by the prettier-init schematic. You'll need to run it before using this scripts.

Prettify

Run prettier on all your workspace files.

Command : npm run prettify

Misc

See my current TO-DO List for more informations on upcoming features.

0.5.0

6 years ago

0.4.1

6 years ago

0.4.0

6 years ago

0.3.0

6 years ago

0.2.3

6 years ago

0.2.2

6 years ago

0.2.1

6 years ago

0.2.0

6 years ago

0.1.0

6 years ago