Skip to content

Commit

Permalink
feat(lint.es): add eslint support
Browse files Browse the repository at this point in the history
  • Loading branch information
davinkevin committed Oct 23, 2015
1 parent 4967d31 commit e1d9d14
Show file tree
Hide file tree
Showing 5 changed files with 37 additions and 6 deletions.
19 changes: 19 additions & 0 deletions .eslintrc
Original file line number Diff line number Diff line change
@@ -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
}
}
9 changes: 9 additions & 0 deletions build/tasks/lint.js
Original file line number Diff line number Diff line change
@@ -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());
});
9 changes: 5 additions & 4 deletions build/tasks/serve.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 ]);

});
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
5 changes: 3 additions & 2 deletions public/messages/messages.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -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", () => {
Expand Down Expand Up @@ -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', () => {
Expand Down

0 comments on commit e1d9d14

Please sign in to comment.