{"_id":"@bdchauvette/gulp-prettier","_rev":"4-b6fb7689e0489ae63957f55b208c1140","name":"@bdchauvette/gulp-prettier","description":"Gulp plugin to format code with prettier","dist-tags":{"latest":"2.0.0"},"versions":{"1.0.0":{"name":"@bdchauvette/gulp-prettier","version":"1.0.0","description":"Gulp plugin to format code with prettier","author":{"name":"Ben Chauvette","email":"bdchauvette@gmail.com","url":"http://bdchauvette.net"},"repository":{"type":"git","url":"git+https://github.com/bdchauvette/gulp-prettier.git"},"bugs":{"url":"https://github.com/bdchauvette/gulp-prettier/issues"},"keywords":["gulpplugin"],"homepage":"https://github.com/bdchauvette/gulp-prettier#readme","license":"MIT","main":"index.js","files":["index.js","factory.js"],"scripts":{"test":"tape test/**/*.spec.js","lint":"eslint **/*.js","lint:fix":"eslint **/*.js --fix","commitmsg":"commit-message-validator","prerelease":"npm run lint && npm test","release":"standard-version"},"dependencies":{"plugin-error":"^0.1.2","prettier":"^1.5.2","through2":"^2.0.3"},"devDependencies":{"commit-message-validator":"^0.1.6","eslint":"^3.19.0","eslint-config-airbnb-base":"^11.2.0","eslint-config-prettier":"^2.1.1","eslint-plugin-import":"^2.2.0","eslint-plugin-prettier":"^2.1.1","husky":"^0.14.1","p-event":"^1.3.0","standard-version":"^4.2.0","string-to-stream":"^1.1.0","tape":"^4.7.0","vinyl":"^2.0.2"},"config":{"commit-message-validator":{"pattern":"^((feat|fix|docs|style|refactor|perf|test|build|ci|chore|revert)(\\(.+?\\))?: )?[A-Z0-9].+","errorMessage":"Invalid commit message"}},"gitHead":"de27f4e66808c3f81a83b9f6d0067cd3283f5bf9","_id":"@bdchauvette/gulp-prettier@1.0.0","_npmVersion":"5.0.3","_nodeVersion":"6.9.1","_npmUser":{"name":"bdchauvette","email":"bdchauvette@gmail.com"},"dist":{"integrity":"sha512-Eo6tAUHnQc0TxVBS4PWu2Snau23J63c+8JnOr0N3AeTynZlX2g1BY+KCc+T6g9fhUaklLRWB9HBuoKo1S5n08A==","shasum":"bed13d051da378b77693d20da39268fa702d11a9","tarball":"https://registry.npmjs.org/@bdchauvette/gulp-prettier/-/gulp-prettier-1.0.0.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIQCJkRgEoKJSsJYc5vUv/8KHRvxhRDV34CXJVvnWu8zPSwIgS9ipme0Jy04+wXXj+aL4HLRibQqdJEMh+QQf7isBcps="}]},"maintainers":[{"name":"bdchauvette","email":"bdchauvette@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/gulp-prettier-1.0.0.tgz_1498762979585_0.41706316894851625"}},"1.1.0":{"name":"@bdchauvette/gulp-prettier","version":"1.1.0","description":"Gulp plugin to format code with prettier","author":{"name":"Ben Chauvette","email":"bdchauvette@gmail.com","url":"http://bdchauvette.net"},"repository":{"type":"git","url":"git+https://github.com/bdchauvette/gulp-prettier.git"},"bugs":{"url":"https://github.com/bdchauvette/gulp-prettier/issues"},"keywords":["gulp","prettier","gulp-prettier","gulpplugin"],"homepage":"https://github.com/bdchauvette/gulp-prettier#readme","license":"MIT","main":"index.js","files":["index.js","factory.js"],"scripts":{"test":"nyc --check-coverage --lines 100 tape test/**/*.spec.js","coverage":"nyc report --reporter=text-lcov > coverage.lcov && codecov","lint":"eslint **/*.js","lint:fix":"eslint **/*.js --fix","commitmsg":"commit-message-validator","prerelease":"npm run lint && npm test","release":"standard-version"},"dependencies":{"plugin-error":"^0.1.2","prettier":"^1.5.3","through2":"^2.0.3"},"devDependencies":{"codecov":"^2.2.0","commit-message-validator":"^0.1.6","eslint":"^3.19.0","eslint-config-airbnb-base":"^11.2.0","eslint-config-prettier":"^2.1.1","eslint-plugin-import":"^2.2.0","eslint-plugin-prettier":"^2.1.1","husky":"^0.14.1","nyc":"^11.0.3","p-event":"^1.3.0","standard-version":"^4.2.0","string-to-stream":"^1.1.0","tape":"^4.7.0","vinyl":"^2.0.2"},"config":{"commit-message-validator":{"pattern":"^((feat|fix|docs|style|refactor|perf|test|build|ci|chore|revert)(\\(.+?\\))?: )?[A-Z0-9].+","errorMessage":"Invalid commit message"}},"gitHead":"7ec2023938e8a451c118a1f004e3015ec289680c","_id":"@bdchauvette/gulp-prettier@1.1.0","_npmVersion":"5.3.0","_nodeVersion":"8.1.3","_npmUser":{"name":"bdchauvette","email":"bdchauvette@gmail.com"},"dist":{"integrity":"sha512-ZHmpx3flUTe+o+kn4I3SgHMkLg07Q5TYpTmJa4O08SDAW9EyynQfTOv+eS0iu8cjwxMNcyO/K2ZZhjlqy0GRnw==","shasum":"82a723f12213d025f41ef50d6f828e5847bf893a","tarball":"https://registry.npmjs.org/@bdchauvette/gulp-prettier/-/gulp-prettier-1.1.0.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEYCIQD1iS8uINv3ijcvQ9MyekTFT9yGx+FxnD2zyZfjNXRkCwIhAKCunKd6g1jxQ8dZ3jJRLELc4umgig7Dgfv/R/nVA1LK"}]},"maintainers":[{"name":"bdchauvette","email":"bdchauvette@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/gulp-prettier-1.1.0.tgz_1500297626949_0.7503939243033528"}},"2.0.0":{"name":"@bdchauvette/gulp-prettier","version":"2.0.0","description":"Gulp plugin to format code with prettier","author":{"name":"Ben Chauvette","email":"bdchauvette@gmail.com","url":"http://bdchauvette.net"},"repository":{"type":"git","url":"git+https://github.com/bdchauvette/gulp-prettier.git"},"bugs":{"url":"https://github.com/bdchauvette/gulp-prettier/issues"},"keywords":["gulp","prettier","gulp-prettier","gulpplugin"],"homepage":"https://github.com/bdchauvette/gulp-prettier#readme","license":"MIT","main":"index.js","files":["index.js","factory.js"],"scripts":{"test":"nyc --check-coverage --lines 100 --functions 100 --branches 100 tape test/**/*.spec.js","coverage":"nyc report --reporter=text-lcov > coverage.lcov && codecov","lint":"eslint **/*.js","lint:fix":"eslint **/*.js --fix","commitmsg":"commit-message-validator","prerelease":"npm run lint && npm test","release":"standard-version"},"dependencies":{"plugin-error":"^0.1.2","through2":"^2.0.3"},"peerDependencies":{"prettier":"^1.x"},"devDependencies":{"codecov":"^2.2.0","commit-message-validator":"^0.1.6","eslint":"^3.19.0","eslint-config-airbnb-base":"^11.2.0","eslint-config-prettier":"^2.1.1","eslint-plugin-import":"^2.2.0","eslint-plugin-prettier":"^2.1.1","husky":"^0.14.1","nyc":"^11.1.0","p-event":"^1.3.0","prettier":"^1.5.3","standard-version":"^4.2.0","string-to-stream":"^1.1.0","tape":"^4.7.0","vinyl":"^2.0.2"},"config":{"commit-message-validator":{"pattern":"^((feat|fix|docs|style|refactor|perf|test|build|ci|chore|revert)(\\(.+?\\))?: )?[A-Z0-9].+","errorMessage":"Invalid commit message"}},"_id":"@bdchauvette/gulp-prettier@2.0.0","_npmVersion":"5.1.0","_nodeVersion":"6.9.1","_npmUser":{"name":"bdchauvette","email":"bdchauvette@gmail.com"},"dist":{"integrity":"sha512-UTNf9TfFS8Hp6Ed954QeNYMqtjfx/anNcejcW4nqxb7Lhv1mekMsSuWL9vqUjSxpE30h4uFN3TnYvROUNezhQw==","shasum":"b9a7576461a6d151084c095adeff94a1b2b36f09","tarball":"https://registry.npmjs.org/@bdchauvette/gulp-prettier/-/gulp-prettier-2.0.0.tgz","signatures":[{"keyid":"SHA256:jl3bwswu80PjjokCgh0o2w5c2U4LhQAE57gj9cz1kzA","sig":"MEUCIAOOi02HVL9gEZ7gCVD9Cp7c7VFnxR3RPXb9OkrQfaCLAiEAn1GSLGT3nP7pqHCJUX5r80IxFvnnBD/spY/zbE4OLQo="}]},"maintainers":[{"name":"bdchauvette","email":"bdchauvette@gmail.com"}],"_npmOperationalInternal":{"host":"s3://npm-registry-packages","tmp":"tmp/gulp-prettier-2.0.0.tgz_1500512527658_0.5282258088700473"}}},"readme":"# gulp-prettier\n\n> [Gulp][] plugin to format code with [prettier][]\n>\n> [![styled with prettier](https://img.shields.io/badge/styled_with-prettier-ff69b4.svg)](https://github.com/prettier/prettier)\n> [![codecov](https://codecov.io/gh/bdchauvette/gulp-prettier/branch/master/graph/badge.svg)](https://codecov.io/gh/bdchauvette/gulp-prettier)\n> [![Build Status](https://travis-ci.org/bdchauvette/gulp-prettier.svg?branch=master)](https://travis-ci.org/bdchauvette/gulp-prettier)\n> [![dependencies Status](https://david-dm.org/bdchauvette/gulp-prettier/status.svg)](https://david-dm.org/bdchauvette/gulp-prettier)\n\n[Gulp]: http://gulpjs.com/\n[prettier]: https://github.com/prettier/prettier\n\n## Installation\n\n```\nnpm install --save-dev @bdchauvette/gulp-prettier\n```\n\n`prettier` is a peer dependency, so make sure to install it if it's not already in your `package.json`:\n\n```sh\nnpm install --save-dev prettier\n```\n\n## Usage\n\n```js\nconst gulp = require(\"gulp\");\nconst prettier = require(\"@bdchauvette/gulp-prettier\");\n\ngulp.task(\"prettify\", () =>\n  gulp\n    .src(\"src/**/*.js\")\n    .pipe(\n      prettier({\n        // Normal prettier options, e.g.:\n        singleQuote: true,\n        trailingComma: \"all\"\n      })\n    )\n    .pipe(gulp.dest(file => file.base))\n);\n```\n\nThe plugin adds a boolean `didPrettierFormat` property to the Vinyl file\nobject. You can use this property to only output changed files, or fail CI\nbuilds if any files were not changed (see recipes below).\n\n### Options\n\nFor the available options, see the\n[`prettier` documentation](https://github.com/prettier/prettier#options).\n\nThe only option that is not passed directly through to `prettier` is `filepath`.\nThis plugin overrides the `filepath` property to match the `path` property of\nthe Vinyl File object being formatted. This allows `prettier` to infer which\nparser to use if you do not explicitly set the `parser` option.\n\nFor example, if you use `gulp.src('**/*.css')`, `prettier` will automatically\ninfer that it needs to use the `postcss` parser to format your stylesheets.\n\n### Recipes\n\n#### Only output changed files\n\nIf you only want to write files that have actually been changed, you can use\n[`gulp-filter`][] to filter out files that were already correctly formatted.\n\n```js\nconst gulp = require(\"gulp\");\nconst filter = require(\"gulp-filter\");\nconst prettier = require(\"@bdchauvette/gulp-prettier\");\n\ngulp.task(\"prettify\", () =>\n  gulp\n    .src(\"src/**/*.js\")\n    .pipe(prettier())\n    .pipe(filter(file => file.didPrettierFormat))\n    .pipe(gulp.dest(file => file.base))\n);\n```\n\n[`gulp-filter`]: https://www.npmjs.com/package/gulp-filter\n\n\n#### Fail CI builds on unformatted files\n\nIn a CI environment, you might want to fail the build if you detect any files\nthat haven't been formatted by prettier. You can do this by using [`gulp-if`][] to pipe to [`gulp-error`][] if any files are freshly formatted (i.e. they have the `didPrettierFormat` property).\n\n```js\nconst gulp = require(\"gulp\");\nconst gulpError = require(\"gulp-error\");\nconst gulpIf = require(\"gulp-if\");\nconst isCI = require(\"is-ci\");\nconst prettier = require(\"@bdchauvette/gulp-prettier\");\n\ngulp.task(\"prettify\", () =>\n  gulp\n    .src(\"src/**/*.js\")\n    .pipe(prettier())\n    .pipe(gulpIf(file => isCI && file.didPrettierFormat, gulpError()))\n    .pipe(gulp.dest(file => file.base))\n);\n```\n\n[`gulp-if`]: https://www.npmjs.com/package/gulp-if\n[`gulp-error`]: https://www.npmjs.com/package/gulp-error\n\n#### Custom `prettier` builds\n\nIf you would like to use a custom build of `prettier`, e.g.\n[`prettier-miscellaneous`][], you can require\n`@bdchauvette/gulp-prettier/factory`, then pass it your own version of\n`prettier`:\n\n```js\nconst gulp = require(\"gulp\");\nconst customPrettier = require(\"prettier-miscellaneous\");\nconst createGulpPrettier = require(\"@bdchauvette/gulp-prettier/factory\");\n\nconst gulpPrettier = createGulpPrettier(customPrettier);\n\ngulp.task(\"prettify\", () =>\n  gulp\n    .src(\"src/**/*.js\")\n    .pipe(gulpPrettier({ singleQuote: true }))\n    .pipe(gulp.dest(file => file.base))\n);\n```\n\n[`prettier-miscellaneous`]: https://www.npmjs.com/package/prettier-miscellaneous\n\n### Sourcemaps\n\n`prettier` does not currently support sourcemaps, so neither does this\nplugin.\n\nSee [#445][] and [#2073][] for discussion.\n\n[#445]: https://github.com/prettier/prettier/issues/445\n[#2073]: https://github.com/prettier/prettier/issues/2073\n\n---\n\n## Related projects\n\nThere are a few different projects that integrate `prettier` and `gulp`:\n\n- [`gulp-prettier`](https://www.npmjs.com/package/gulp-prettier)\n- [`gulp-nf-prettier`](https://www.npmjs.com/package/gulp-nf-prettier)\n- [`gulp-prettier-plugin`](https://www.npmjs.com/package/gulp-prettier-plugin)\n\n---\n\n## Development\n\n### Testing\n\n```sh\nnpm test\n```\n\n### Linting\n\n```sh\nnpm run lint\n```\n\n```sh\n# With fixes\nnpm run lint:fix\n```\n","maintainers":[{"name":"bdchauvette","email":"bdchauvette@gmail.com"}],"time":{"modified":"2022-04-04T18:03:01.870Z","created":"2017-06-29T19:03:00.597Z","1.0.0":"2017-06-29T19:03:00.597Z","1.1.0":"2017-07-17T13:20:27.991Z","2.0.0":"2017-07-20T01:02:08.548Z"},"homepage":"https://github.com/bdchauvette/gulp-prettier#readme","keywords":["gulp","prettier","gulp-prettier","gulpplugin"],"repository":{"type":"git","url":"git+https://github.com/bdchauvette/gulp-prettier.git"},"author":{"name":"Ben Chauvette","email":"bdchauvette@gmail.com","url":"http://bdchauvette.net"},"bugs":{"url":"https://github.com/bdchauvette/gulp-prettier/issues"},"license":"MIT","readmeFilename":"README.md","users":{"brainmurder":true}}