aboutsummaryrefslogtreecommitdiffstats
path: root/Gruntfile.js
diff options
context:
space:
mode:
authorOleg <markelog@gmail.com>2013-09-13 00:51:59 +0400
committerOleg <markelog@gmail.com>2013-11-07 22:09:32 +0100
commitbcae4270151574d077fb360fd42416587f07c686 (patch)
treee999b6e99751bb2b22735768a2e6a70734ace60a /Gruntfile.js
parent9e3d0f3109756ec8b6166ff60f0d495b8f1d6aca (diff)
downloadjquery-bcae4270151574d077fb360fd42416587f07c686.tar.gz
jquery-bcae4270151574d077fb360fd42416587f07c686.zip
Fix #12757 - use jscs to check the style guide
Cherry picked from ab63e568f50b5b9823490eda9c184e48cc6440c4 commit
Diffstat (limited to 'Gruntfile.js')
-rw-r--r--Gruntfile.js32
1 files changed, 21 insertions, 11 deletions
diff --git a/Gruntfile.js b/Gruntfile.js
index 1f06b4e34..d9e94003b 100644
--- a/Gruntfile.js
+++ b/Gruntfile.js
@@ -2,14 +2,15 @@ module.exports = function( grunt ) {
"use strict";
+ function readOptionalJSON( filepath ) {
+ var data = {};
+ try {
+ data = grunt.file.readJSON( filepath );
+ } catch(e) {}
+ return data;
+ }
+
var gzip = require( "gzip-js" ),
- readOptionalJSON = function( filepath ) {
- var data = {};
- try {
- data = grunt.file.readJSON( filepath );
- } catch(e) {}
- return data;
- },
srcHintOptions = readOptionalJSON( "src/.jshintrc" );
// The concatenated file won't pass onevar
@@ -48,19 +49,24 @@ module.exports = function( grunt ) {
pkg: {
src: [ "package.json" ]
},
+
+ jscs: {
+ src: [ ".jscs.json" ]
+ },
+
bower: {
src: [ "bower.json" ]
}
},
jshint: {
src: {
- src: [ "src/**/*.js" ],
+ src: "src/**/*.js",
options: {
jshintrc: "src/.jshintrc"
}
},
dist: {
- src: [ "dist/jquery.js" ],
+ src: "dist/jquery.js",
options: srcHintOptions
},
grunt: {
@@ -70,12 +76,15 @@ module.exports = function( grunt ) {
}
},
tests: {
- src: [ "test/**/*.js" ],
+ src: "test/**/*.js",
options: {
jshintrc: "test/.jshintrc"
}
}
},
+ jscs: {
+ src: "src/**/*.js"
+ },
testswarm: {
tests: "ajax attributes callbacks core css data deferred dimensions effects event manipulation offset queue selector serialize support traversing Sizzle".split(" ")
},
@@ -135,12 +144,13 @@ module.exports = function( grunt ) {
grunt.loadNpmTasks( "grunt-contrib-jshint" );
grunt.loadNpmTasks( "grunt-contrib-uglify" );
grunt.loadNpmTasks( "grunt-jsonlint" );
+ grunt.loadNpmTasks( "grunt-jscs-checker" );
// Integrate jQuery specific tasks
grunt.loadTasks( "build/tasks" );
// Short list as a high frequency watch task
- grunt.registerTask( "dev", [ "build:*:*", "jshint" ] );
+ grunt.registerTask( "dev", [ "build:*:*", "jshint", "jscs" ] );
// Default grunt
grunt.registerTask( "default", [ "jsonlint", "dev", "pre-uglify", "uglify", "post-uglify", "dist:*", "compare_size" ] );