Skip to content

eklingen/vinyl-stream-prettier

Repository files navigation

Small vinyl-stream wrapper -aka Gulp plugin- for prettier

Run prettier within your streams. Supports automatic fixing of files. Also has a fast method for more speed, and a slow method for more control.

NOTE: No tests have been written yet!

Installation

yarn install. Or npm install. Or just copy the files to your own project.

Usage

const prettierWrapper = require("@eklingen/vinyl-stream-prettier");
stream.pipe(prettierWrapper());

This package assumes a configuration dotfile where prettier can find it.

Options

You have the following options:

failAfterError

This will determine wether to fail or not. Useful in a pre-commit hook, for example.

prettierWrapper({
  failAfterError: true,
});

prettier

These options are passed verbatim to prettier. See the "prettier" documentation for more details.

prettierWrapper({
  prettier: {
    fix: false,
  },
});

Dependencies

This package requires "prettier".


Copyright (c) 2023 Elco Klingen. MIT License.

About

Small vinyl-stream wrapper -aka Gulp plugin- for prettier.

Resources

License

Stars

Watchers

Forks

Packages

No packages published