diff --git a/.jscsrc b/.jscsrc new file mode 100644 index 00000000..c91d6125 --- /dev/null +++ b/.jscsrc @@ -0,0 +1,3 @@ +{ + "disallowMixedSpacesAndTabs": true +} \ No newline at end of file diff --git a/Gruntfile.js b/Gruntfile.js index d9ea8ba9..a906ec26 100644 --- a/Gruntfile.js +++ b/Gruntfile.js @@ -84,6 +84,11 @@ module.exports = function(grunt) { files: ['Gruntfile.js'], // add 'src/**/*.js', 'test/**/*.js' options: { jshintrc: '.jshintrc' }, }, + jscs: { + all: { + src: ['js/**/*.js', '!js/components.js', 'test/**/*.js'] + } + }, watch: { files: ['<%= jshint.files %>'], tasks: ['jshint'] @@ -149,7 +154,7 @@ module.exports = function(grunt) { }); 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('build', ['compile', 'concat:curve25519']); diff --git a/package.json b/package.json index b2fdd757..0c6e2b80 100644 --- a/package.json +++ b/package.json @@ -12,7 +12,8 @@ "grunt-contrib-sass": "^0.8.1", "grunt-contrib-watch": "^0.6.1", "grunt-preen": "^1.0.0", - "grunt-saucelabs": "^8.3.3" + "grunt-saucelabs": "^8.3.3", + "grunt-jscs": "^1.1.0" }, "scripts": { "test": "grunt test",