A Gulp plugin that formats code using Prettier with support for custom Prettier options, config file resolution, and flexible error/warning reporting. Version 2.1.0 is the latest stable release (last updated 2020). It requires Gulp 3.9+ or 4.0+ and Prettier 1.4+ / 2.x / 3.x. Unlike alternative Gulp Prettier plugins, it offers a clean API with TypeScript types and a choice of reporters (warning, error, none) or a custom reporter callback. It also supports filtering formatted files and respects .prettierrc configuration. The package is minimal and focuses on a single function (format) with consistent options.
npm install gulp-plugin-prettierVerified import paths — ran on the pinned version, not inferred.
Shows how to use format with Error reporter to fail on unformatted files, and pipe to destination.
Use prettier.Reporter.Error instead of 'error'.
Avoid combining filter: true with reporter: Error.
Run npm install --save-dev @types/prettier
Use import { format } from 'gulp-plugin-prettier'npm install --save-dev gulp-plugin-prettier gulp prettier
Use Reporter enum or one of the allowed strings: 'none', 'warning', 'error'