Skip to content

Commit

Permalink
Merge pull request #165 from jakemmarsh/eslint
Browse files Browse the repository at this point in the history
Finish setting up eslint, replace jshint
  • Loading branch information
jakemmarsh committed Mar 1, 2016
2 parents 04395ed + 1403653 commit 7269978
Show file tree
Hide file tree
Showing 14 changed files with 41 additions and 53 deletions.
25 changes: 22 additions & 3 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -1,5 +1,24 @@
{
"env" : {
"es6" : true
"parser": "babel-eslint",
"ecmaFeatures": {
"modules": true
},
"env": {
"browser": true,
"node": true,
"es6": true
},
"rules": {
"quotes": [2, "single"],
"eol-last": 0,
"no-debugger": 1,
"no-mixed-requires": 0,
"no-underscore-dangle": 0,
"no-multi-spaces": 0,
"no-trailing-spaces": 0,
"no-extra-boolean-cast": 0,
"no-unused-vars": 2,
"new-cap": 0,
"camelcase": 2
}
}
}
20 changes: 0 additions & 20 deletions .jshintrc

This file was deleted.

3 changes: 2 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ node_js:
sudo: false

script:
- ./node_modules/.bin/gulp lint test
- ./node_modules/.bin/gulp eslint
- ./node_modules/.bin/gulp test

cache:
directories:
Expand Down
3 changes: 2 additions & 1 deletion gulp/config.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,8 @@ export default {

scripts: {
src: 'app/js/**/*.js',
dest: 'build/js'
dest: 'build/js',
test: 'test/**/*.js'
},

images: {
Expand Down
2 changes: 1 addition & 1 deletion gulp/tasks/eslint.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import eslint from 'gulp-eslint';
gulp.task('eslint', () => {
// Be sure to return the stream from the task;
// Otherwise, the task may end before the stream has finished.
return gulp.src([config.scripts.src, '!app/js/templates.js'])
return gulp.src([config.scripts.src, '!app/js/templates.js', config.scripts.test])
// eslint() attaches the lint output to the "eslint" property
// of the file object so it can be used by other modules.
.pipe(eslint())
Expand Down
11 changes: 0 additions & 11 deletions gulp/tasks/lint.js

This file was deleted.

2 changes: 1 addition & 1 deletion gulp/tasks/watch.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ gulp.task('watch', ['browserSync'], function() {
global.isWatching = true;

// Scripts are automatically watched and rebundled by Watchify inside Browserify task
gulp.watch(config.scripts.src, ['lint']);
gulp.watch(config.scripts.src, ['eslint']);
gulp.watch(config.styles.src, ['styles']);
gulp.watch(config.images.src, ['images']);
gulp.watch(config.fonts.src, ['fonts']);
Expand Down
10 changes: 4 additions & 6 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "angularjs-gulp-browserify-boilerplate",
"version": "1.5.2",
"version": "1.5.3",
"author": "Jake Marsh <[email protected]>",
"description": "Boilerplate using AngularJS, SASS, Gulp, and Browserify while also utilizing best practices.",
"repository": {
Expand All @@ -27,6 +27,7 @@
"angular-mocks": "^1.3.15",
"angular-ui-router": "^0.2.13",
"babel-core": "^6.3.26",
"babel-eslint": "^5.0.0",
"babel-preset-es2015": "^6.3.13",
"babel-register": "^6.5.2",
"babelify": "^7.2.0",
Expand All @@ -39,17 +40,16 @@
"bulkify": "^1.1.1",
"debowerify": "^1.3.1",
"del": "^2.1.0",
"eslint": "^1.10.3",
"eslint": "^2.2.0",
"express": "^4.13.3",
"gulp": "^3.9.0",
"gulp-angular-templatecache": "^1.3.0",
"gulp-autoprefixer": "^3.1.0",
"gulp-changed": "^1.0.0",
"gulp-eslint": "^1.1.1",
"gulp-eslint": "^2.0.0",
"gulp-gzip": "^1.2.0",
"gulp-if": "^2.0.0",
"gulp-imagemin": "^2.4.0",
"gulp-jshint": "^2.0.0",
"gulp-notify": "^2.0.0",
"gulp-protractor": "^2.1.0",
"gulp-rename": "^1.2.0",
Expand All @@ -60,8 +60,6 @@
"gulp-util": "^3.0.1",
"imagemin-pngcrush": "^4.1.0",
"isparta": "^4.0.0",
"jshint": "^2.9.1",
"jshint-stylish": "^2.1.0",
"karma": "^0.13.21",
"karma-browserify": "^5.0.2",
"karma-chrome-launcher": "^0.2.1",
Expand Down
8 changes: 8 additions & 0 deletions test/.eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
{
"env": {
"jasmine": true
},
"globals": {
"angular": true
}
}
2 changes: 0 additions & 2 deletions test/unit/constants_spec.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
/*global angular */

'use strict';

describe('Unit: Constants', function() {
Expand Down
2 changes: 0 additions & 2 deletions test/unit/controllers/example_spec.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
/*global angular */

'use strict';

describe('Unit: ExampleCtrl', function() {
Expand Down
2 changes: 1 addition & 1 deletion test/unit/directives/example_spec.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/*global angular, module, browser*/
/* global module */

'use strict';

Expand Down
2 changes: 0 additions & 2 deletions test/unit/filters/example_spec.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
/*global angular */

'use strict';

describe('Unit: ExampleFilter', function() {
Expand Down
2 changes: 0 additions & 2 deletions test/unit/services/example_spec.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
/*global angular */

'use strict';

describe('Unit: ExampleService', function() {
Expand Down

0 comments on commit 7269978

Please sign in to comment.