gulp-jscs

GULP: Modify a watched file in place without causing an infinite loop

我只是一个虾纸丫 提交于 2019-12-21 19:59:05
问题 Im trying to use gulp and jscs to prevent code smell. I also want to use watch so that this happens when ever a change is made. The problem I'm running into is jscs is modify the source file that is being watched. This causes gulp to go into an infinite loop of jscs modifying the file and then watch seeing the change and firing off jscs again and again and again ... const gulp = require('gulp'); gulp.task('lint', function() { return gulp.src('/src/**/*.js') .pipe(jscs({ fix: true })) .pipe

Issue with task not executing when using gulp with run-sequence

做~自己de王妃 提交于 2019-12-13 07:40:43
问题 I am new to gulp and so I put a simple script together to 1) learn how gulp works and 2) improve my development workflow. The issue I am having is that if I set the runSequence task list to be in the order of jscs and then lint, the lint task does not get executed. However, if I reverse them, and run lint first, then jscs, both tasks execute successfully. After doing more tests, I'm certain that there is something about the way I am using jscs that is causing the problem, or there is an issue

Gulp Jscs - TypeError: Cannot convert undefined or null to object

落花浮王杯 提交于 2019-12-10 15:55:15
问题 I wanted to use gulp-jscs in my project, so I've installed it according the documentation: npm install --save-dev gulp-jscs But when I try to run the gulp file, I'm getting this error: TypeError: Cannot convert undefined or null to object at Function.keys (native) at copyConfiguration (C:\Users\[User]\Desktop\[Project]\ node_modules\jscs\lib\config\configuration.js:920:12) Also, there are other errors related to this: at NodeConfiguration.Configuration. _processConfig([location-path]\node

gulp-jscs autofix doesn't work

 ̄綄美尐妖づ 提交于 2019-12-10 12:59:13
问题 I have the following code in my gulpfile.js gulp.src(['server.js']) .pipe(jscs({fix: true})) .pipe(gulp.dest('prod-app')); But in prod-app/server.js is the same file as server.js. Without any fixes. How to fix it? 回答1: You can read about base option to modify a lot of scripts together here and use it like this: gulp.task('lint-jscs-fix', function() { return gulp.src(quantumArtScripts, { base: './' }) .pipe(jscs({ fix: true })) .pipe(jscs.reporter()) // log all errors that should be fixed

Getting: SyntaxError: missing ) after argument list but can't find out whats wrong with hulpfile.js

六眼飞鱼酱① 提交于 2019-12-04 06:35:53
问题 Hi I'm getting an error starting 'gulp default' with the following gulp file. I cannot figure out whats wrong with the file. var gulp = require('gulp'); var sass = require('gulp-sass'); var sourcemaps = require('gulp-sourcemaps'); var autoprefixer = require('gulp-autoprefixer'); var browserSync = require('browser-sync').create(); var input = './scss/**/*.scss'; var output = './css'; gulp.task('sass', function() { return gulp.src(input) .pipe(sourcemaps.init()) .pipe(sass(errLogToConsole: true

Getting: SyntaxError: missing ) after argument list but can't find out whats wrong with hulpfile.js

别来无恙 提交于 2019-12-02 08:14:49
Hi I'm getting an error starting 'gulp default' with the following gulp file. I cannot figure out whats wrong with the file. var gulp = require('gulp'); var sass = require('gulp-sass'); var sourcemaps = require('gulp-sourcemaps'); var autoprefixer = require('gulp-autoprefixer'); var browserSync = require('browser-sync').create(); var input = './scss/**/*.scss'; var output = './css'; gulp.task('sass', function() { return gulp.src(input) .pipe(sourcemaps.init()) .pipe(sass(errLogToConsole: true, outputStyle: 'compressed')) .pipe(autoprefixer(browsers: ['last 2 versions', '> 5%', 'Firefox ESR']))