Grunt plugin to run Prettier on your files. Integrates the Prettier code formatter into Grunt workflows. Current stable version is 2.2.0, released with support for Prettier v2 and config overrides. Release cadence is irregular. Differentiates from running Prettier via CLI by providing a Grunt task that supports multiple target configurations, file-to-file formatting, concatenation with formatting, and in-place overwriting. Options can be specified in task config or .prettierrc, merged with defaults.
npm install grunt-prettierVerified import paths — ran on the pinned version, not inferred.
Shows minimal Gruntfile config to format JavaScript files with Prettier, including loading the plugin and running the default task.
Review prettier v2 changelog and update your options accordingly.
Specify overrides in a .prettierrc file adjacent to your Gruntfile.
Use 'src' for in-place formatting; use 'files' mapping for file-to-file or concat+format.
Upgrade Node to at least 10.0.0.
Ensure you run npm install grunt-prettier --save-dev and add grunt.loadNpmTasks('grunt-prettier') in Gruntfile.Run: npm install prettier --save-dev
Define either files.src (array of globs) or files mapping (source to dest).