Add JSCS and run as grunt test task

This change only introduces a single rule but more can easily be added
going forwards.
This commit is contained in:
Joe Bandenburg 2015-01-14 17:33:34 +00:00 committed by lilia
parent 6b933455e3
commit ac8584dd85
3 changed files with 11 additions and 2 deletions

3
.jscsrc Normal file
View file

@ -0,0 +1,3 @@
{
"disallowMixedSpacesAndTabs": true
}

View file

@ -84,6 +84,11 @@ module.exports = function(grunt) {
files: ['Gruntfile.js'], // add 'src/**/*.js', 'test/**/*.js' files: ['Gruntfile.js'], // add 'src/**/*.js', 'test/**/*.js'
options: { jshintrc: '.jshintrc' }, options: { jshintrc: '.jshintrc' },
}, },
jscs: {
all: {
src: ['js/**/*.js', '!js/components.js', 'test/**/*.js']
}
},
watch: { watch: {
files: ['<%= jshint.files %>'], files: ['<%= jshint.files %>'],
tasks: ['jshint'] tasks: ['jshint']
@ -149,7 +154,7 @@ module.exports = function(grunt) {
}); });
grunt.registerTask('dev', ['connect', 'watch']); grunt.registerTask('dev', ['connect', 'watch']);
grunt.registerTask('test', ['jshint', 'connect', 'saucelabs-mocha']); grunt.registerTask('test', ['jshint', 'jscs', 'connect', 'saucelabs-mocha']);
grunt.registerTask('default', ['preen', 'concat', 'sass']); grunt.registerTask('default', ['preen', 'concat', 'sass']);
grunt.registerTask('build', ['compile', 'concat:curve25519']); grunt.registerTask('build', ['compile', 'concat:curve25519']);

View file

@ -12,7 +12,8 @@
"grunt-contrib-sass": "^0.8.1", "grunt-contrib-sass": "^0.8.1",
"grunt-contrib-watch": "^0.6.1", "grunt-contrib-watch": "^0.6.1",
"grunt-preen": "^1.0.0", "grunt-preen": "^1.0.0",
"grunt-saucelabs": "^8.3.3" "grunt-saucelabs": "^8.3.3",
"grunt-jscs": "^1.1.0"
}, },
"scripts": { "scripts": {
"test": "grunt test", "test": "grunt test",