3.0.0 • Published 5 years ago

plop-prettier v3.0.0

Weekly downloads
1,787
License
MIT
Repository
github
Last release
5 years ago

plop-prettier

Use prettier to format plop templates with a custom plop action type.

Installation

npm i --save plop-prettier

Usage

In your base plopfile, use plop.load to add the "pretty-add" action::

const aGenerator = require("./path/to/a/generator");

module.exports = function(plop) {
    plop.load("plop-prettier");

    plop.setGenerator("Generator Name", aGenerator);
};

You can now use the "pretty-add" action type within your generators:

const anAction = {
    type: "pretty-add",
    path: "path/to/generated/file",
    template: "path/to/template"
};

Options

Prettier options can be provided - for information on available prettier options see the prettier docs.

const aGenerator = require("./path/to/a/generator");

module.exports = function(plop) {
    plop.load("plop-prettier", {
        tabWidth: 4
    });

    plop.setGenerator("Generator Name", aGenerator);
};
3.0.0

5 years ago

2.0.1

7 years ago

2.0.0

7 years ago

1.0.3

7 years ago

1.0.2

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago