Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ntucker/gulp-prettiest
https://github.com/ntucker/gulp-prettiest
Last synced: about 1 month ago
JSON representation
- Host: GitHub
- URL: https://github.com/ntucker/gulp-prettiest
- Owner: ntucker
- License: mit
- Fork: true (thomasvantuycom/gulp-prettier)
- Created: 2017-05-04T23:53:28.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2017-05-05T00:06:09.000Z (over 7 years ago)
- Last Synced: 2024-09-26T06:33:17.409Z (about 1 month ago)
- Language: JavaScript
- Size: 8.79 KB
- Stars: 0
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Gulp Prettiest [![Build Status](https://travis-ci.org/ntucker/gulp-prettiest.svg?branch=master)](https://travis-ci.org/ntucker/gulp-prettiest)
A [Gulp](http://gulpjs.com/) plugin which allows the users to use [Prettier](https://github.com/jlongster/prettier).
> Prettier is an opinionated JavaScript formatter inspired by refmt with advanced support for language features from ES2017, JSX, and Flow. It removes all original styling and ensures that all outputted JavaScript conforms to a consistent style. (See this blog post)
## Usage
Simply pipe the input, and pass in arguments that you would to the regular format function.
```js
const gulp = require('gulp'),
prettier = require('gulp-prettiest');gulp.task('default', () => {
gulp.src('*.js')
.pipe(prettier({useFlowParser: true}))
.pipe(gulp.dest('./dist'))
});
```Please consult the [Prettier](https://github.com/jlongster/prettier) README to know the possible optional arguments. At the time of this writing, these are the following optional arguments.
```js
{
// Fit code within this line limit
printWidth: 80,// Number of spaces it should use per tab
tabWidth: 2,// Use the flow parser instead of babylon
useFlowParser: false,// If true, will use single instead of double quotes
singleQuote: false,// Controls the printing of trailing commas wherever possible
trailingComma: false,// Controls the printing of spaces inside array and objects
bracketSpacing: true
}
```## License
[MIT License](https://raw.githubusercontent.com/ntucker/gulp-prettiest/master/LICENSE)