0.0.4 • Published 5 years ago

gulp-check-warning v0.0.4

Weekly downloads
1
License
ISC
Repository
-
Last release
5 years ago

gulp-check-warning

Check code by some patterns and warn users in your terminal when some strings are matched.

Usage

Install gulp-check-warning as a development dependency:

npm i gulp-check-warning -D

Then, add it to your gulpfile.js:

var gulp = require('gulp');
var check = require('gulp-check-warning');
var checkOptions = [
    {
        pattern: 'const',
        message: 'Please don\'t use const in your code.'
    },
    {
        pattern: /(?:https?:)?\/\/[\w\-]+(?:\.[\w\-]+)*\.(?:com|org)?/i,
        message: function (matches) {
            if (/(google|google-analytics)\.com$/i.test(matches[0])) {
                return 'Please dont\'t use assets from Google.'
            }
        }
    }
];

gulp.task('check', function () {
    gulp.src(['src/**/*.*'])
        .pipe(check(checkOptions))
        .pipe(gulp.dest('./dst'))
});

API

gulp-check-warning muse be called with a Array

check(array)

0.0.4

5 years ago

0.0.3

5 years ago

0.0.2

5 years ago

0.0.1

5 years ago