Skip to content
This repository was archived by the owner on Sep 6, 2021. It is now read-only.

Commit 9dde6a2

Browse files
committed
add JSLint to Grunt
1 parent 1e8ec31 commit 9dde6a2

File tree

2 files changed

+23
-4
lines changed

2 files changed

+23
-4
lines changed

Gruntfile.js

Lines changed: 20 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ module.exports = function (grunt) {
2525
'use strict';
2626

2727
// load dependencies
28-
require('load-grunt-tasks')(grunt, {pattern: ['grunt-contrib-*', 'grunt-targethtml', 'grunt-usemin']});
28+
require('load-grunt-tasks')(grunt, {pattern: ['grunt-contrib-*', 'grunt-targethtml', 'grunt-usemin', 'grunt-jslint']});
2929
grunt.loadTasks('tasks');
3030

3131
var common = require("./tasks/lib/common")(grunt);
@@ -291,6 +291,24 @@ module.exports = function (grunt) {
291291
jshintrc: '.jshintrc'
292292
}
293293
},
294+
jslint: {
295+
client: {
296+
src: ['src/**/*.js'],
297+
exclude: ['src/thirdparty/**/*.js', 'src/widgets/**/*.js'],
298+
directives: {
299+
"vars": true,
300+
"plusplus": true,
301+
"devel": true,
302+
"nomen": true,
303+
"white": true,
304+
"maxerr": 50
305+
},
306+
options: {
307+
errorsOnly: false, // only display errors
308+
failOnError: true, // defaults to true
309+
}
310+
}
311+
},
294312
shell: {
295313
repo: grunt.option("shell-repo") || "../brackets-shell",
296314
mac: "<%= shell.repo %>/installer/mac/staging/<%= pkg.name %>.app",
@@ -303,7 +321,7 @@ module.exports = function (grunt) {
303321
grunt.registerTask('install', ['write-config', 'less']);
304322

305323
// task: test
306-
grunt.registerTask('test', ['jshint:all', 'jasmine']);
324+
grunt.registerTask('test', ['jslint', 'jshint:all', 'jasmine']);
307325
// grunt.registerTask('test', ['jshint:all', 'jasmine', 'jasmine_node']);
308326

309327
// task: set-sprint

package.json

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,8 @@
3535
"grunt-usemin": "0.1.11",
3636
"load-grunt-tasks": "0.2.0",
3737
"q": "0.9.2",
38-
"jshint": "2.1.4"
38+
"jshint": "2.1.4",
39+
"grunt-jslint": "1.1.8"
3940
},
4041
"scripts": {
4142
"postinstall": "grunt install",
@@ -47,4 +48,4 @@
4748
"url": "https://github.com/adobe/brackets/blob/master/LICENSE"
4849
}
4950
]
50-
}
51+
}

0 commit comments

Comments
 (0)