Skip to content

Commit

Permalink
Merge pull request #294 from omh1280/eslint_v2
Browse files Browse the repository at this point in the history
Switch from gulp-eslint to using the CLI
  • Loading branch information
pjcozzi committed Jun 28, 2017
2 parents 2da9983 + dbf4367 commit 1db7d71
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 26 deletions.
2 changes: 1 addition & 1 deletion .appveyor.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ install:
test_script:
- node --version
- npm --version
- npm run eslint -- --failTaskOnError
- npm run eslint
- npm run test -- --failTaskOnError --suppressPassed

# Don't actually build.
Expand Down
4 changes: 4 additions & 0 deletions .eslintignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
node_modules/**
coverage/**
doc/**
dist/**
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ npm-debug.log
.idea/tasks.xml

# Generate data
.eslintcache
coverage
dist
output
Expand Down
2 changes: 1 addition & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ node_js:
- "6"

script:
- npm run eslint -- --failTaskOnError
- npm run eslint
- if [[ "$TRAVIS_OS_NAME" == "linux" ]];
then npm run test -- --failTaskOnError --suppressPassed --excludeCompressedTextures;
else npm run test -- --failTaskOnError --suppressPassed;
Expand Down
21 changes: 0 additions & 21 deletions gulpfile.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');
var open = require('open');
Expand All @@ -22,28 +21,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/**', '!dist/**'];
var specFiles = ['**/*.js', '!node_modules/**', '!coverage/**', '!dist/**'];

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());
});
});

function excludeCompressedTextures(jasmine) {
var excludedSpecs = ['compressTexturesSpec.js', 'compressTexturesMultipleFormatsSpec.js'];
var specFiles = jasmine.specFiles;
Expand Down
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -43,9 +43,9 @@
},
"devDependencies": {
"coveralls": "^2.11.15",
"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",
"istanbul": "^0.4.5",
"jasmine": "^2.5.2",
"jasmine-spec-reporter": "^4.1.0",
Expand All @@ -57,7 +57,7 @@
"build-cesium": "gulp build-cesium",
"build-cesium-combine": "gulp build-cesium-combine",
"jsdoc": "jsdoc ./lib -R ./README.md -d doc",
"eslint": "gulp eslint",
"eslint": "eslint \"./**/*.js\" --cache --quiet",
"eslint-watch": "gulp eslint-watch",
"test": "gulp test",
"test-watch": "gulp test-watch",
Expand Down

0 comments on commit 1db7d71

Please sign in to comment.