Switch from gulp-eslint to the ESLint CLI. Switch to eslint-config-cesium 2.0.

This commit is contained in:
Ottavio Hartman 2017-06-23 13:42:34 -04:00
parent 813290af6c
commit 644c281e9c
6 changed files with 9 additions and 28 deletions

3
.eslintignore Normal file
View File

@ -0,0 +1,3 @@
node_modules/**
coverage/**
doc/**

1
.gitignore vendored
View File

@ -7,6 +7,7 @@ npm-debug.log
.idea/tasks.xml
# Generate data
.eslintcache
coverage
doc
output

View File

@ -3,7 +3,7 @@ node_js:
- "4"
- "6"
script:
- npm run eslint -- --failTaskOnError
- npm run eslint
- npm run test -- --failTaskOnError --suppressPassed
after_success:

View File

@ -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');

View File

@ -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);

View File

@ -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",