Skip to content
This repository has been archived by the owner on Nov 23, 2021. It is now read-only.

Eslint support #26

Merged
merged 4 commits into from
Oct 9, 2015
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 0 additions & 28 deletions .jshintrc

This file was deleted.

2 changes: 1 addition & 1 deletion app/files.json
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@
"app/main/welcome/welcome.tpl.html",
"bower.json",
"_.bowerrc",
"_.jshintrc",
"_.gitignore",
"_.editorconfig",
".eslintrc",
"config.json",
"gulp/build.js",
"gulp/lib/builder-factory.js",
Expand Down
27 changes: 27 additions & 0 deletions app/templates/.eslintrc
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
{
"rules": {
"quotes": [2, "single"],
"semi": [2, "always"],
"strict": 2
},
"env": {
"browser": true,
"node": true
},
"globals": {
"angular": true,
// Angular Mocks
"inject": false,
// JASMINE
"describe": false,
"it": false,
"before": false,
"beforeEach": false,
"after": false,
"afterEach": false,
"expect": false,
"jasmine": false,
"spyOn": false
},
"extends": "eslint:recommended"
}
37 changes: 0 additions & 37 deletions app/templates/_.jshintrc

This file was deleted.

8 changes: 4 additions & 4 deletions app/templates/gulp/unit-tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ gulp.task('test:tdd:debug', ['ngTemplates'], function () {
});
gulp.task('lint', function () {
return gulp.src(config.scripts.lintSrc())
.pipe($.jshint())
.pipe($.jshint.reporter('jshint-stylish'))
.pipe($.jshint.reporter('fail'));
});
.pipe($.eslint())
.pipe($.eslint.format())
.pipe($.eslint.failOnError());
});
5 changes: 2 additions & 3 deletions app/templates/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -13,14 +13,14 @@
"del": "1.2.0",
"gulp": "3.9.0",
"gulp-concat": "2.6.0",
"gulp-eslint": "1.0.0",
"gulp-filter": "2.0.2",
"gulp-flatten": "0.1.0",
"gulp-git": "1.2.4",
"gulp-if": "1.2.5",
"gulp-imagemin": "2.3.0",
"gulp-inject": "1.3.1",
"gulp-insert": "0.4.0",
"gulp-jshint": "1.11.2",
"gulp-karma": "0.0.4",
"gulp-less": "3.0.3",
"gulp-load-plugins": "0.10.0",
Expand All @@ -45,7 +45,6 @@
"gulp.spritesmith": "3.8.2",
"http-proxy": "1.11.1",
"jasmine-core": "2.3.4",
"jshint-stylish": "2.0.1",
"karma": "0.12.37",
"karma-chrome-launcher": "0.2.0",
"karma-coverage": "0.4.2",
Expand All @@ -70,4 +69,4 @@
"postinstall": "bower install -F",
"test": "gulp test"
}
}
}
2 changes: 1 addition & 1 deletion controller/templates/controller-spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ describe('<%= controllerName %> tests', function () {

beforeEach(module('<%= targetModuleName %>'));
beforeEach(inject(function ($controller) {
$controller('<%= controllerName %>', {});
$controller('<%= controllerName %>', {$scope: {}});
}));

describe('tests', function () {
Expand Down
3 changes: 2 additions & 1 deletion controller/templates/controller.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
angular.module('<%= targetModuleName %>')
.controller('<%= controllerName %>', function ($scope) {

'use strict';
$scope.message = 'Hello!';
});
2 changes: 1 addition & 1 deletion test/generator-app.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ describe('oasp:app', function () {
'bower.json',
'package.json',
'.editorconfig',
'.jshintrc'
'.eslintrc'
]);
});
});
Expand Down