Skip to content

Commit 70f3e02

Browse files
committed
Bring grunt check task back / Add jshintrc
- Bring "grunt check" task back - Put the check task into the build task - Add jshintrc and specify global variables for tests - Move the quotmark option, from the jshint task,to the jshintrc file
1 parent 258cb93 commit 70f3e02

3 files changed

Lines changed: 23 additions & 4 deletions

File tree

.jshintrc

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
"quotmark": "single",
3+
"node": true,
4+
"globals": {
5+
"angular": false,
6+
"document": false,
7+
"jasmine": false,
8+
"module": false,
9+
"describe": false,
10+
"beforeEach": false,
11+
"afterEach": false,
12+
"it": false,
13+
"inject": false,
14+
"expect": false,
15+
"spyOn": false
16+
}
17+
}

CONTRIBUTING.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ npm install
1414
**Before coding** <small>Boot the Environment</small>
1515
```sh
1616
grunt dev
17+
grunt check # check the code quality
1718
grunt build # build files
1819
```
1920

Gruntfile.js

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -47,9 +47,9 @@ module.exports = function(grunt) {
4747
}
4848
},
4949
jshint: {
50-
all: ['*.js', 'src/**/*.js'],
50+
all: ['*.js', 'src/**/*.js', 'test/unit/*.js', 'demo/*.js'],
5151
options: {
52-
quotmark: 'single'
52+
jshintrc: true
5353
}
5454
},
5555
browserSync: {
@@ -72,7 +72,7 @@ module.exports = function(grunt) {
7272
},
7373
watch: {
7474
files: ['src/*.js'],
75-
tasks: ['jshint', 'build'],
75+
tasks: ['build'],
7676
options: {
7777
spawn: false,
7878
interrupt: true
@@ -93,6 +93,7 @@ module.exports = function(grunt) {
9393

9494
// Register Task
9595
grunt.registerTask('dev', ['browserSync', 'watch']);
96-
grunt.registerTask('build', ['jshint', 'jsbeautifier', 'clean', 'concat', 'uglify']);
96+
grunt.registerTask('check', ['jshint', 'jsbeautifier']); // use this before commit
97+
grunt.registerTask('build', ['check', 'clean', 'concat', 'uglify']);
9798
grunt.registerTask('test', ['build', 'karma']);
9899
};

0 commit comments

Comments
 (0)