diff --git a/.eslintrc b/.eslintrc new file mode 100644 index 0000000..0df0de8 --- /dev/null +++ b/.eslintrc @@ -0,0 +1,19 @@ +{ + "rules": { + "linebreak-style": [ 2, "unix" ], + "semi": [ 2, "always" ] + }, + "env": { + "es6": true, + "browser": true, + "jasmine": true + }, + "globals": { + "inject": true, + "module": true + }, + "extends": "eslint:recommended", + "ecmaFeatures": { + "modules" : true + } +} \ No newline at end of file diff --git a/build/tasks/lint.js b/build/tasks/lint.js new file mode 100644 index 0000000..0c3cd2f --- /dev/null +++ b/build/tasks/lint.js @@ -0,0 +1,9 @@ +import gulp from 'gulp'; +import paths from '../paths'; +import eslint from 'gulp-eslint'; + +gulp.task('lint-js', () => { + return gulp.src(['public/**/*.js']) + .pipe(eslint()) + .pipe(eslint.format()); +}); diff --git a/build/tasks/serve.js b/build/tasks/serve.js index 3d77ed9..8573bdf 100644 --- a/build/tasks/serve.js +++ b/build/tasks/serve.js @@ -24,9 +24,10 @@ function startBrowserSync(directoryBase, files, browser) { }); } -gulp.task('serve', () => { +gulp.task('serve', ['sass'], () => { + startBrowserSync([paths.srcDir, './' ]); - gulp.watch(`${paths.srcDir}/**/*.scss`, ['sass', () => { - browserSync.reload(); - }]); + + gulp.watch(`${paths.srcDir}/**/*.scss`, ['sass', browserSync.reload ]); + }); diff --git a/package.json b/package.json index b729071..9d036d3 100644 --- a/package.json +++ b/package.json @@ -30,6 +30,7 @@ "conventional-changelog": "^0.0.11", "del": "^2.0.2", "gulp": "^3.9.0", + "gulp-eslint": "^1.0.0", "gulp-inject": "^3.0.0", "gulp-minify-css": "^1.2.1", "gulp-ng-annotate": "^1.1.0", diff --git a/public/messages/messages.spec.js b/public/messages/messages.spec.js index 8c230a3..95878e2 100644 --- a/public/messages/messages.spec.js +++ b/public/messages/messages.spec.js @@ -2,7 +2,8 @@ import MessageCtrl from './messages.controller'; import routeConfig from './messages.route'; import template from './messages.html!text'; import messagesModule from './messages'; -import mocks from 'angular-mocks'; + +import 'angular-mocks'; describe("Message Component", () => { @@ -56,7 +57,7 @@ describe("Message Component", () => { let $controller; - beforeEach(module('app.func1')); + beforeEach(module(messagesModule.name)); beforeEach(inject((_$controller_) => $controller = _$controller_ )); it('should have a controller named Func1Ctrl', () => {