Skip to content

Latest commit

 

History

History
65 lines (48 loc) · 1.36 KB

README.md

File metadata and controls

65 lines (48 loc) · 1.36 KB

gulp-textlint

gulp plugin for textlint.

Usage

var gulp = require('gulp');
var textlint = require('gulp-textlint');

gulp.task('textlint', function() {
  return gulp.src('./path/to/src/**/*.md')
    .pipe(textlint());
});

As you can path to config for textlint. Like below.

...
gulp.task('textlint', function() {
  return gulp.src('./path/to/src/**/*.md')
    .pipe(textlint({
      formatterName: "pretty-error"
    });
});

When you would like to change target dynamically you should use yargs.

e.g.

var argv = require('yargs').argv;

gulp.task('textlint', function() {
  var src = argv.t;
  return gulp.src(src)
    .pipe(textlint());
});

gulp.task('watch', function() {
  var src = argv.t;
  if (src) {
    gulp.watch(src, ['textlint']);
  }
});

Then execute watch task with -t option.

gulp watch -t "./path/to/*.md"

Example

Please See example/.