Skip to content

Commit

Permalink
Update dependencies, switch to eslint
Browse files Browse the repository at this point in the history
  • Loading branch information
QWp6t authored and retlehs committed Mar 11, 2016
1 parent c9ef232 commit e51e41e
Show file tree
Hide file tree
Showing 6 changed files with 47 additions and 144 deletions.
16 changes: 16 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
{
"root": true,
"extends": "eslint:recommended",
"globals": {
"wp": true,
},
"env": {
"browser": true,
"jquery": true,
"node": true,
"amd": true
},
"rules": {
"no-console": 0
}
}
95 changes: 0 additions & 95 deletions .jscsrc

This file was deleted.

15 changes: 0 additions & 15 deletions .jshintrc

This file was deleted.

5 changes: 2 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ cache:

install:
- npm install -g npm@latest
- npm install -g bower gulp jscs
- npm install -g bower gulp eslint
- npm install
- composer self-update && composer --version
- export PATH="$HOME/.composer/vendor/bin:$PATH"
Expand All @@ -28,7 +28,6 @@ install:

script:
- npm run build
- npm run jshint
- npm run jscs
- npm run lint
- phpcs --standard=ruleset.xml --extensions=php --ignore=node_modules,bower_components,vendor -n -s .
- phpmd src text cleancode,codesize,controversial,design,naming,unusedcode
26 changes: 13 additions & 13 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ var flatten = require('gulp-flatten');
var gulp = require('gulp');
var gulpif = require('gulp-if');
var imagemin = require('gulp-imagemin');
var jshint = require('gulp-jshint');
var eslint = require('gulp-eslint');
var lazypipe = require('lazypipe');
var less = require('gulp-less');
var merge = require('merge-stream');
Expand Down Expand Up @@ -58,8 +58,8 @@ var enabled = {
maps: !argv.production,
// Fail styles task on error when `--production`
failStyleTask: argv.production,
// Fail due to JSHint warnings only when `--production`
failJSHint: argv.production,
// Fail due to ESLint warnings only when `--production`
failESLint: argv.production,
// Strip debug statments from javascript when `--production`
stripJSDebug: argv.production
};
Expand Down Expand Up @@ -184,9 +184,9 @@ gulp.task('styles', ['wiredep'], function() {
});

// ### Scripts
// `gulp scripts` - Runs JSHint then compiles, combines, and optimizes Bower JS
// `gulp scripts` - Runs ESLint then compiles, combines, and optimizes Bower JS
// and project JS.
gulp.task('scripts', ['jshint'], function() {
gulp.task('scripts', ['lint'], function() {
var merged = merge();
manifest.forEachDependency('js', function(dep) {
merged.add(
Expand Down Expand Up @@ -221,15 +221,15 @@ gulp.task('images', function() {
.pipe(browserSync.stream());
});

// ### JSHint
// `gulp jshint` - Lints configuration JSON and project JS.
gulp.task('jshint', function() {
// ### ESLint
// `gulp lint` - Lints configuration JSON and project JS.
gulp.task('lint', function() {
return gulp.src([
'bower.json', 'gulpfile.js'
'gulpfile.js'
].concat(project.js))
.pipe(jshint())
.pipe(jshint.reporter('jshint-stylish'))
.pipe(gulpif(enabled.failJSHint, jshint.reporter('fail')));
.pipe(eslint())
.pipe(eslint.format())
.pipe(gulpif(enabled.failESLint, eslint.failAfterError()));
});

// ### Clean
Expand All @@ -252,7 +252,7 @@ gulp.task('watch', function() {
}
});
gulp.watch([path.source + 'styles/**/*'], ['styles']);
gulp.watch([path.source + 'scripts/**/*'], ['jshint', 'scripts']);
gulp.watch([path.source + 'scripts/**/*'], ['lint', 'scripts']);
gulp.watch([path.source + 'fonts/**/*'], ['fonts']);
gulp.watch([path.source + 'images/**/*'], ['images']);
gulp.watch(['bower.json', 'assets/manifest.json'], ['build']);
Expand Down
34 changes: 16 additions & 18 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,40 +19,38 @@
],
"scripts": {
"build": "bower install && gulp",
"jshint": "gulp jshint",
"jscs": "jscs gulpfile.js assets/scripts/*.js"
"lint": "gulp lint"
},
"engines": {
"node": ">= 0.12.0",
"npm": ">=2.1.5"
},
"devDependencies": {
"asset-builder": "^1.1.0",
"browser-sync": "^2.8.2",
"del": "^1.2.1",
"browser-sync": "^2.10.1",
"del": "^2.2.0",
"gulp": "^3.9.0",
"gulp-autoprefixer": "^2.3.1",
"gulp-autoprefixer": "^3.1.0",
"gulp-changed": "^1.3.0",
"gulp-concat": "^2.6.0",
"gulp-cssnano": "^2.1.0",
"gulp-flatten": "0.1.1",
"gulp-if": "^1.2.5",
"gulp-imagemin": "^2.3.0",
"gulp-jshint": "^1.11.2",
"gulp-less": "^3.0.3",
"gulp-eslint": "^1.1.1",
"gulp-flatten": "0.2.0",
"gulp-if": "^2.0.0",
"gulp-imagemin": "^2.4.0",
"gulp-less": "^3.0.5",
"gulp-plumber": "^1.0.1",
"gulp-rename": "^1.2.2",
"gulp-rev": "^6.0.0",
"gulp-sass": "^2.0.1",
"gulp-sourcemaps": "^1.5.2",
"gulp-uglify": "^1.2.0",
"gulp-rev": "^6.0.1",
"gulp-sass": "^2.1.1",
"gulp-sourcemaps": "^1.6.0",
"gulp-uglify": "^1.5.1",
"imagemin-pngcrush": "^4.1.0",
"jshint-stylish": "^2.0.1",
"lazypipe": "^1.0.1",
"merge-stream": "^1.0.0",
"minimist": "^1.1.3",
"run-sequence": "^1.1.2",
"minimist": "^1.2.0",
"run-sequence": "^1.1.5",
"traverse": "^0.6.6",
"wiredep": "^2.2.2"
"wiredep": "^3.0.0"
}
}

0 comments on commit e51e41e

Please sign in to comment.