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!
yarn install
. Or npm install
. Or just copy the files to your own project.
const prettierWrapper = require("@eklingen/vinyl-stream-prettier");
stream.pipe(prettierWrapper());
This package assumes a configuration dotfile where prettier can find it.
You have the following options:
This will determine wether to fail or not. Useful in a pre-commit hook, for example.
prettierWrapper({
failAfterError: true,
});
These options are passed verbatim to prettier. See the "prettier" documentation for more details.
prettierWrapper({
prettier: {
fix: false,
},
});
This package requires "prettier".
Copyright (c) 2023 Elco Klingen. MIT License.