diff --git a/.eslintrc b/.eslintrc index 9016ffe..e0e97a7 100644 --- a/.eslintrc +++ b/.eslintrc @@ -9,9 +9,7 @@ }, "env": { "browser": true, - "node": true, - "jasmine": true, - "mocha": true + "node": true }, "rules": { "quotes": [2, "single"], diff --git a/.travis.yml b/.travis.yml new file mode 100644 index 0000000..6e75615 --- /dev/null +++ b/.travis.yml @@ -0,0 +1,14 @@ +language: node_js +node_js: +- '0.12.7' +branches: + only: + - master +cache: + directories: + - node_modules +install: +- npm install +before_script: +- npm run lint +- npm run test diff --git a/README.md b/README.md index bebc326..4403de4 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,7 @@ react-rocket ============ +[![Build Status](https://travis-ci.org/jakemmarsh/react-rocket-boilerplate.svg)](https://travis-ci.org/jakemmarsh/react-rocket-boilerplate) [![devDependency Status](https://david-dm.org/jakemmarsh/react-rocket-boilerplate/dev-status.svg)](https://david-dm.org/jakemmarsh/react-rocket-boilerplate#info=devDependencies) + A boilerplate using ReactJS (along with React Router and RefluxJS), SASS, Gulp, and Browserify that also utilizes Gulp best practices from [this resource](https://github.com/greypants/gulp-starter). diff --git a/__tests__/.eslintrc b/__tests__/.eslintrc index bb953e0..9039b52 100644 --- a/__tests__/.eslintrc +++ b/__tests__/.eslintrc @@ -1,4 +1,8 @@ { + "env": { + "jasmine": true, + "mocha": true + }, "globals": { "sinon": true, "sandbox": true, diff --git a/__tests__/App.test.js b/__tests__/App.test.js index c049210..6a7b185 100644 --- a/__tests__/App.test.js +++ b/__tests__/App.test.js @@ -7,7 +7,7 @@ import App from '../app/js/App'; import CurrentUserStore from '../app/js/stores/CurrentUserStore'; import CurrentUserActions from '../app/js/actions/CurrentUserActions'; import {ListenerMixin} from 'reflux'; -import TestHelpers from '../utils/TestHelpers'; +import TestHelpers from '../utils/testHelpers'; describe('App', function() { diff --git a/__tests__/pages/HomePage.test.js b/__tests__/pages/HomePage.test.js index 40f59dc..54cde5c 100644 --- a/__tests__/pages/HomePage.test.js +++ b/__tests__/pages/HomePage.test.js @@ -3,7 +3,7 @@ import ReactDOM from 'react-dom'; import TestUtils from 'react-addons-test-utils'; -import TestHelpers from '../../utils/TestHelpers'; +import TestHelpers from '../../utils/testHelpers'; import HomePage from '../../app/js/pages/HomePage'; describe('Page: Home', function() { diff --git a/__tests__/pages/NotFoundPage.test.js b/__tests__/pages/NotFoundPage.test.js index b4dc1f6..5b5b520 100644 --- a/__tests__/pages/NotFoundPage.test.js +++ b/__tests__/pages/NotFoundPage.test.js @@ -3,7 +3,7 @@ import ReactDOM from 'react-dom'; import TestUtils from 'react-addons-test-utils'; -import TestHelpers from '../../utils/TestHelpers'; +import TestHelpers from '../../utils/testHelpers'; import NotFoundPage from '../../app/js/pages/NotFoundPage'; describe('Page: Not Found', function() { diff --git a/__tests__/pages/SearchPage.test.js b/__tests__/pages/SearchPage.test.js index ddcbd47..d3a6af0 100644 --- a/__tests__/pages/SearchPage.test.js +++ b/__tests__/pages/SearchPage.test.js @@ -3,7 +3,7 @@ import ReactDOM from 'react-dom'; import TestUtils from 'react-addons-test-utils'; -import TestHelpers from '../../utils/TestHelpers'; +import TestHelpers from '../../utils/testHelpers'; import SearchPage from '../../app/js/pages/SearchPage'; describe('Page: Search', function() { diff --git a/__tests__/stores/CurrentUserStore.test.js b/__tests__/stores/CurrentUserStore.test.js index 41bce2e..4381768 100644 --- a/__tests__/stores/CurrentUserStore.test.js +++ b/__tests__/stores/CurrentUserStore.test.js @@ -2,7 +2,7 @@ import when from 'when'; -import TestHelpers from '../../utils/TestHelpers'; +import TestHelpers from '../../utils/testHelpers'; import CurrentUserStore from '../../app/js/stores/CurrentUserStore'; import CurrentUserActions from '../../app/js/actions/CurrentUserActions'; import AuthAPI from '../../app/js/utils/AuthAPI'; diff --git a/__tests__/utils/APIUtils.test.js b/__tests__/utils/APIUtils.test.js index c971fb7..923e109 100644 --- a/__tests__/utils/APIUtils.test.js +++ b/__tests__/utils/APIUtils.test.js @@ -10,7 +10,7 @@ describe('Util: APIUtils', function() { let testResponse = { status: 200, body: { - camel_case: 'test', + camel_case: 'test', //eslint-disable-line camelcase PascalCase: 'test', camelCase: 'test' } diff --git a/__tests__/utils/AuthAPI.test.js b/__tests__/utils/AuthAPI.test.js index cf47596..3d56252 100644 --- a/__tests__/utils/AuthAPI.test.js +++ b/__tests__/utils/AuthAPI.test.js @@ -2,7 +2,7 @@ import APIUtils from '../../app/js/utils/APIUtils'; import AuthAPI from '../../app/js/utils/AuthAPI'; -import TestHelpers from '../../utils/TestHelpers'; +import TestHelpers from '../../utils/testHelpers'; describe('Util: AuthAPI', function() { diff --git a/gulp/tasks/lint.js b/gulp/tasks/lint.js new file mode 100644 index 0000000..d50a83a --- /dev/null +++ b/gulp/tasks/lint.js @@ -0,0 +1,14 @@ +'use strict'; + +import gulp from 'gulp'; +import eslint from 'gulp-eslint'; +import config from '../config'; + +gulp.task('lint', function() { + + return gulp.src([config.scripts.src, config.testFiles, './*.js']) + .pipe(eslint()) + .pipe(eslint.format()) + .pipe(eslint.failAfterError()); + +}); \ No newline at end of file diff --git a/package.json b/package.json index 597f859..c46dca5 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "react-rocket-boilerplate", - "version": "2.2.0", + "version": "2.3.0", "author": "Jake Marsh ", "description": "Boilerplate using React, Browserify, SASS, and Gulp.", "repository": { @@ -21,14 +21,16 @@ }, "devDependencies": { "babel-core": "^5.8.25", + "babel-eslint": "^5.0.0-beta4", "babelify": "^6.1.x", "browser-sync": "^2.7.13", "browserify": "^10.2.6", "debowerify": "^1.3.1", "del": "^1.2.0", - "eslint-plugin-react": "^3.6.3", + "eslint-plugin-react": "^3.11.3", "gulp": "^3.9.0", "gulp-autoprefixer": "^2.3.1", + "gulp-eslint": "^1.1.1", "gulp-if": "^1.2.5", "gulp-imagemin": "^2.3.0", "gulp-jsx-coverage": "^0.2.6", @@ -40,7 +42,7 @@ "gulp-streamify": "0.0.5", "gulp-uglify": "^1.2.0", "gulp-util": "^3.0.6", - "history": "^1.12.5", + "history": "1.13.0", "humps": "^0.6.0", "istanbul": "^0.4.0", "jsdom": "^3.1.2", @@ -60,5 +62,9 @@ "watchify": "^3.2.x", "when": "^3.7.4", "yargs": "^3.27.0" + }, + "scripts": { + "lint": "./node_modules/.bin/gulp lint", + "test": "./node_modules/.bin/gulp test" } }