New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

gulp-prettier

Package Overview
Dependencies
Maintainers
2
Versions
10
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

gulp-prettier

Format files with Prettier

  • 6.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
25K
increased by8.08%
Maintainers
2
Weekly downloads
 
Created
Source

gulp-prettier

Format files with Prettier

GitHub Workflow Status npm version semantic-release

Install

npm install gulp-prettier --save-dev

Usage

import gulp from 'gulp';
import prettier from 'gulp-prettier';

function format() {
  return gulp.src('src/*.js')
    .pipe(prettier({ singleQuote: true }))
    .pipe(gulp.dest('dist'));
}

export default format;

To check whether or not your files adhere to Prettier's formatting, use prettier.check. This can be used as a validation step in CI scenarios.

import gulp from 'gulp';
import prettier from 'gulp-prettier';

function validate() {
  return gulp.src('dist/*.js')
    .pipe(prettier.check({ singleQuote: true }));
}

export default validate;

API

prettier([options])

Formats your files using Prettier.

options

Type: Object

Consult the Prettier options.

editorconfig: true can also be passed to enable EditorConfig support.

prettier.check([options])

Checks if your files have been formatted with Prettier and, if not, throws an error with a list of unformatted files. This is useful for running Prettier in CI scenarios.

options

Type: Object

Consult the Prettier options.

editorconfig: true can also be passed to enable EditorConfig support.

License

MIT © Thomas Vantuycom

Keywords

FAQs

Package last updated on 03 Nov 2023

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc