plop-prettier
TypeScript icon, indicating that this package has built-in type declarations

3.0.0 • Public • Published

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);
};

Readme

Keywords

Package Sidebar

Install

npm i plop-prettier

Weekly Downloads

146

Version

3.0.0

License

MIT

Unpacked Size

17.7 kB

Total Files

11

Last publish

Collaborators

  • alsiola