A Gulp plugin to format files with Prettier. Current stable version is 6.0.0, released November 2023. This plugin integrates Prettier into Gulp build pipelines, allowing automatic code formatting during development or as a CI check via `prettier.check()`. Key differentiators: simple API mirroring Prettier's options, supports EditorConfig, and the `check` method for CI validation. Since v6.0.0, it is pure ESM and requires Node 18. Prior v5.0.0 upgraded Prettier to v3.0.0. It is a direct replacement for manually calling Prettier in Gulp tasks.
npm install gulp-prettierVerified import paths — ran on the pinned version, not inferred.
Defines two Gulp tasks: 'format' to format JavaScript files using Prettier with options, and 'check' to validate formatting in CI.
Switch to ESM imports (import prettier from 'gulp-prettier') and ensure Node >=18.
Review Prettier v3 changelog for option changes; update your Prettier options accordingly.
Upgrade Node to >=12 (or later).
Use Node >=10 and update Prettier options for v2 changes.
Wrap in try/catch or use separate CI-only task.
Consult Prettier documentation for valid options; use .prettierrc file to share config.
Switch to import statement: import prettier from 'gulp-prettier'; or use dynamic import().
Run: npm install gulp-prettier --save-dev
Use: import prettier from 'gulp-prettier';
Ensure src pattern is correct and files exist.