Skip to content

Commit

Permalink
Issues oasp#6 / oasp#20 resolved:
Browse files Browse the repository at this point in the history
- eslint integrated (rules specified in .eslintrc file, eslint run during gulp test, use gulp lint to run eslint is separation
 - lint errors in generated tests corrected
 - jshint support removed
  • Loading branch information
Tomasz Szewcow committed Sep 25, 2015
1 parent ba936f5 commit b69861e
Show file tree
Hide file tree
Showing 8 changed files with 39 additions and 48 deletions.
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"],
"linebreak-style": [2, "windows"],
"semi": [2, "always"],
"strict": 2
},
"env": {
"browser": 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.

9 changes: 5 additions & 4 deletions app/templates/gulp/unit-tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@

var gulp = require('gulp');
var $ = require('gulp-load-plugins')();
var eslint = require('gulp-eslint');
var createKarmaTask = function (options) {
/**
* Pass empty array - karma will query for files.
Expand Down Expand Up @@ -40,7 +41,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

0 comments on commit b69861e

Please sign in to comment.