From 644c281e9cd4adff09223d24650aa4145cd95b9b Mon Sep 17 00:00:00 2001 From: Ottavio Hartman Date: Fri, 23 Jun 2017 13:42:34 -0400 Subject: [PATCH] Switch from gulp-eslint to the ESLint CLI. Switch to eslint-config-cesium 2.0. --- .eslintignore | 3 +++ .gitignore | 1 + .travis.yml | 2 +- gulpfile.js | 21 --------------------- lib/obj2gltf.js | 3 +-- package.json | 7 +++---- 6 files changed, 9 insertions(+), 28 deletions(-) create mode 100644 .eslintignore diff --git a/.eslintignore b/.eslintignore new file mode 100644 index 0000000..0c85304 --- /dev/null +++ b/.eslintignore @@ -0,0 +1,3 @@ +node_modules/** +coverage/** +doc/** diff --git a/.gitignore b/.gitignore index 6e76bb2..f7e2d78 100644 --- a/.gitignore +++ b/.gitignore @@ -7,6 +7,7 @@ npm-debug.log .idea/tasks.xml # Generate data +.eslintcache coverage doc output diff --git a/.travis.yml b/.travis.yml index 8e939a3..4264c75 100644 --- a/.travis.yml +++ b/.travis.yml @@ -3,7 +3,7 @@ node_js: - "4" - "6" script: - - npm run eslint -- --failTaskOnError + - npm run eslint - npm run test -- --failTaskOnError --suppressPassed after_success: diff --git a/gulpfile.js b/gulpfile.js index 2cfbded..773c8b9 100644 --- a/gulpfile.js +++ b/gulpfile.js @@ -4,7 +4,6 @@ var Cesium = require('cesium'); var child_process = require('child_process'); var fsExtra = require('fs-extra'); var gulp = require('gulp'); -var eslint = require('gulp-eslint'); var Jasmine = require('jasmine'); var JasmineSpecReporter = require('jasmine-spec-reporter').SpecReporter; var open = require('open'); @@ -20,28 +19,8 @@ var environmentSeparator = process.platform === 'win32' ? ';' : ':'; var nodeBinaries = path.join(__dirname, 'node_modules', '.bin'); process.env.PATH += environmentSeparator + nodeBinaries; -var esLintFiles = ['**/*.js', '!node_modules/**', '!coverage/**', '!doc/**']; var specFiles = ['**/*.js', '!node_modules/**', '!coverage/**', '!doc/**', '!bin/**']; -gulp.task('eslint', function () { - var stream = gulp.src(esLintFiles) - .pipe(eslint()) - .pipe(eslint.format()); - if (argv.failTaskOnError) { - stream = stream.pipe(eslint.failAfterError()); - } - - return stream; -}); - -gulp.task('eslint-watch', function() { - gulp.watch(esLintFiles).on('change', function(event) { - gulp.src(event.path) - .pipe(eslint()) - .pipe(eslint.format()); - }); -}); - gulp.task('test', function (done) { var jasmine = new Jasmine(); jasmine.loadConfigFile('specs/jasmine.json'); diff --git a/lib/obj2gltf.js b/lib/obj2gltf.js index 14a1bfd..86cac90 100644 --- a/lib/obj2gltf.js +++ b/lib/obj2gltf.js @@ -121,9 +121,8 @@ function obj2gltf(objPath, gltfPath, options) { .then(function(gltf) { if (bypassPipeline) { return fsExtra.outputJson(gltfPath, gltf); - } else { - return GltfPipeline.processJSONToDisk(gltf, gltfPath, pipelineOptions); } + return GltfPipeline.processJSONToDisk(gltf, gltfPath, pipelineOptions); }) .finally(function() { return cleanup(resourcesDirectory, options); diff --git a/package.json b/package.json index b091061..62487b3 100644 --- a/package.json +++ b/package.json @@ -38,9 +38,9 @@ }, "devDependencies": { "coveralls": "^2.12.0", - "eslint-config-cesium": "^1.0.0", + "eslint": "^4.1.1", + "eslint-config-cesium": "^2.0.0", "gulp": "^3.9.1", - "gulp-eslint": "^4.0.0", "jasmine": "^2.5.3", "jasmine-spec-reporter": "^4.1.0", "jsdoc": "^3.4.3", @@ -50,8 +50,7 @@ }, "scripts": { "jsdoc": "jsdoc ./lib -R ./README.md -d doc", - "eslint": "gulp eslint", - "eslint-watch": "gulp eslint-watch", + "eslint": "eslint \"./**/*.js\" --cache --quiet", "test": "gulp test", "test-watch": "gulp test-watch", "coverage": "gulp coverage",