1
- 'use strict' ;
2
-
3
- module . exports = function ( grunt ) {
1
+ module . exports = function ( grunt ) {
2
+ 'use strict' ;
4
3
5
4
require ( 'matchdep' ) . filterDev ( 'grunt-*' ) . forEach ( grunt . loadNpmTasks ) ;
6
5
7
- function init ( ) {
6
+ function init ( ) {
8
7
9
8
grunt . initConfig ( {
10
9
availabletasks : {
@@ -16,7 +15,7 @@ module.exports = function(grunt) {
16
15
'build' : 'Builds the project (including documentation) into the dist directory. You can specify modules to be built as arguments (' +
17
16
'grunt build:buttons:notification) otherwise all available modules are built.' ,
18
17
'test' : 'Executes the karma testsuite.' ,
19
- 'watch' : 'Whenever js source files (from the src directory) change, the tasks executes jshint and documentation build.' ,
18
+ 'watch' : 'Whenever js source files (from the src directory) change, the tasks executes jslint and documentation build.' ,
20
19
'ngdocs' : 'Builds documentation into dist/docs.' ,
21
20
'ngdocs:view' : 'Builds documentation into dist/docs and runs a web server. The docs can be accessed on http://localhost:8000/'
22
21
} ,
@@ -87,20 +86,14 @@ module.exports = function(grunt) {
87
86
}
88
87
}
89
88
} ,
90
- jshint : {
91
- files : [ 'Gruntfile.js' , 'src/**/*.js' ] ,
89
+ eslint : {
92
90
options : {
93
- jshintrc : '.jshintrc '
91
+ configFile : 'eslint.yaml '
94
92
} ,
95
- beforeconcat : {
96
- options : {
97
- force : true ,
98
- ignores : [ '**.min.js' ]
99
- } ,
100
- files : {
101
- src : 'src/**/*.js'
102
- }
103
- }
93
+ target : [
94
+ 'Gruntfile.js' ,
95
+ 'src/**/*.js'
96
+ ]
104
97
} ,
105
98
karma : {
106
99
unit : {
@@ -177,7 +170,7 @@ module.exports = function(grunt) {
177
170
watch : {
178
171
main : {
179
172
files : [ 'Gruntfile.js' ] ,
180
- tasks : [ 'jshint ' ]
173
+ tasks : [ 'eslint ' ]
181
174
} ,
182
175
js : {
183
176
files : [ 'Gruntfile.js' , 'src/**/*.js' ] ,
@@ -187,11 +180,11 @@ module.exports = function(grunt) {
187
180
} ) ;
188
181
189
182
// You can specify which modules to build as arguments of the build task.
190
- grunt . registerTask ( 'build' , 'Create bootstrap build files' , function ( ) {
183
+ grunt . registerTask ( 'build' , 'Create bootstrap build files' , function ( ) {
191
184
var concatSrc = [ ] ;
192
185
193
186
if ( this . args . length ) {
194
- this . args . forEach ( function ( file ) {
187
+ this . args . forEach ( function ( file ) {
195
188
if ( grunt . file . exists ( './src/' + file ) ) {
196
189
grunt . log . ok ( 'Adding ' + file + ' to the build queue.' ) ;
197
190
concatSrc . push ( 'src/' + file + '/*.js' ) ;
@@ -204,13 +197,14 @@ module.exports = function(grunt) {
204
197
concatSrc = 'src/**/*.js' ;
205
198
}
206
199
207
- grunt . task . run ( [ 'clean' , 'jshint:beforeconcat' , ' lint', 'test' , 'ngtemplates' , 'concat' , 'uglify:build' , 'cssmin' , 'copy' , 'ngdocs' , 'clean:templates' ] ) ;
200
+ grunt . task . run ( [ 'clean' , 'lint' , 'test' , 'ngtemplates' , 'concat' , 'uglify:build' , 'cssmin' , 'copy' , 'ngdocs' , 'clean:templates' ] ) ;
208
201
} ) ;
209
202
210
203
grunt . registerTask ( 'default' , [ 'build' ] ) ;
211
204
grunt . registerTask ( 'ngdocs:view' , [ 'build' , 'connect:docs' , 'watch' ] ) ;
212
- grunt . registerTask ( 'lint' , [ 'jshint ' , 'htmlhint' ] ) ;
205
+ grunt . registerTask ( 'lint' , [ 'eslint ' , 'htmlhint' ] ) ;
213
206
grunt . registerTask ( 'test' , [ 'karma' ] ) ;
207
+ grunt . registerTask ( 'check' , [ 'lint' , 'test' ] ) ;
214
208
grunt . registerTask ( 'help' , [ 'availabletasks' ] ) ;
215
209
216
210
}
0 commit comments