friskfly / gulp-trailing-comma

remove trailing comma

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

[![NPM version][npm-image]][npm-url] [![Build status][travis-img]][travis-url] Coverage Status [![License][license-img]][license-url]

gulp-trailing-comma

gulp-trailing-comma is a Gulp extension to remove extra trailing comma in js sources.

Since IE 6 and IE 7 complains about trailing commas by simply refusing to execute code.

It uses esprima for parsing js source file.

##usage

var removeComma = require('gulp-trailing-comma');

gulp.src('./foo/*.js')
  .pipe(removeComma())
  .pipe(gulp.dest('./dist/'))

before

var object = {
  a : 'a',
  b : 'b',
  c : 'c',
}

after

var object = {
  a : 'a',
  b : 'b',
  c : 'c'
}

License

MIT [npm-image]: https://img.shields.io/npm/v/gulp-trailing-comma.svg?style=flat-square [npm-url]: https://npmjs.org/package/gulp-trailing-comma [travis-img]: https://travis-ci.org/friskfly/gulp-trailing-comma.svg [travis-url]: https://travis-ci.org/friskfly/gulp-trailing-comma [license-img]: http://img.shields.io/badge/license-MIT-green.svg?style=flat-square [license-url]: http://opensource.org/licenses/MIT

About

remove trailing comma


Languages

Language:JavaScript 100.0%