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 4250fdf
Show file tree
Hide file tree
Showing 5 changed files with 24 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.3
* @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.3";

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

24 changes: 18 additions & 6 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ var rename = require("gulp-rename");
var sourcemaps = require("gulp-sourcemaps");
var uglify = require("gulp-uglify");



var scripts = [
"./src/core.js",
"./src/privates.js",
Expand All @@ -29,12 +31,22 @@ 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 {
var gutil = require("gulp-util");

return gutil.log(gutil.colors.yellow(
"[skipped linting for node " + process.version + "]"
));
}
}

gulp.task("analysis", function (done) {
Expand Down
2 changes: 1 addition & 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.3",
"devDependencies": {
"coveralls": "^2.11.12",
"gulp": "^3.9.1",
Expand Down

0 comments on commit 4250fdf

Please sign in to comment.