Skip to content

textlint/gulp-textlint

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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/.