Skip to content

Commit

Permalink
Linting is now disabled on builds made with node < 4 (eslint requirem…
Browse files Browse the repository at this point in the history
…ent)
  • Loading branch information
ascartabelli committed Aug 9, 2016
1 parent be25715 commit d75ae39
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 12 deletions.
4 changes: 2 additions & 2 deletions dist/lamb.js
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
/**
* @overview lamb - A lightweight, and docile, JavaScript library to help embracing functional programming.
* @author Andrea Scartabelli <andrea.scartabelli@gmail.com>
* @version 0.37.0-alpha.2
* @version 0.37.0-alpha.4
* @module lamb
* @license MIT
* @preserve
Expand All @@ -18,7 +18,7 @@
* @category Core
* @type String
*/
lamb._version = "0.37.0-alpha.2";
lamb._version = "0.37.0-alpha.4";

// alias used as a placeholder argument for partial application
var _ = lamb;
Expand Down
4 changes: 2 additions & 2 deletions dist/lamb.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/lamb.min.js.map

Large diffs are not rendered by default.

21 changes: 15 additions & 6 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ var gulp = require("gulp");
var pkg = require("./package.json");
var concat = require("gulp-concat");
var footer = require("gulp-footer");
var gutil = require("gulp-util");
var header = require("gulp-header");
var indent = require("gulp-indent");
var istanbul = require("gulp-istanbul");
Expand All @@ -29,12 +30,20 @@ var scripts = [
];

function lint () {
// isolated because of shelljs, again
var eslint = require("gulp-eslint");
return gulp.src("./dist/lamb.js")
.pipe(eslint())
.pipe(eslint.format())
.pipe(eslint.failAfterError());
// eslint supports node >= 4
if (parseInt(process.versions.node, 10) >= 4) {
// isolated because of shelljs, again
var eslint = require("gulp-eslint");

return gulp.src("./dist/lamb.js")
.pipe(eslint())
.pipe(eslint.format())
.pipe(eslint.failAfterError());
} else {
return gutil.log(gutil.colors.yellow(
"[skipped linting for node " + process.version + "]"
));
}
}

gulp.task("analysis", function (done) {
Expand Down
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@
"coveralls": "gulp coverage && cat ./coverage/lcov.info | ./node_modules/coveralls/bin/coveralls.js && rm -rf ./coverage"
},
"tonicExample": "var _ = require('lamb');",
"version": "0.37.0-alpha.2",
"version": "0.37.0-alpha.4",
"devDependencies": {
"coveralls": "^2.11.12",
"gulp": "^3.9.1",
Expand All @@ -45,6 +45,7 @@
"gulp-rename": "^1.2.2",
"gulp-sourcemaps": "^1.6.0",
"gulp-uglify": "^2.0.0",
"gulp-util": "^3.0.7",
"plato": "^1.6.0",
"sinon": "^1.17.5"
},
Expand Down

0 comments on commit d75ae39

Please sign in to comment.