aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Rebert <[email protected]>2013-12-06 16:51:38 -0800
committerChris Rebert <[email protected]>2013-12-06 17:26:07 -0800
commitc1dae1e13c0dd5c53aa39b6aa6af8e07e4d3037f (patch)
tree365f373ec274f446c7f11a6442ed6995adb98e93
parent351f86e1db6bbb5f37e67323094fc08f4aeceecd (diff)
downloadbootstrap-c1dae1e13c0dd5c53aa39b6aa6af8e07e4d3037f.tar.xz
bootstrap-c1dae1e13c0dd5c53aa39b6aa6af8e07e4d3037f.zip
integrate JSCS
-rw-r--r--Gruntfile.js18
-rw-r--r--js/.jscs.json14
-rw-r--r--package.json1
3 files changed, 32 insertions, 1 deletions
diff --git a/Gruntfile.js b/Gruntfile.js
index 9c8cc854b..4e713d7c8 100644
--- a/Gruntfile.js
+++ b/Gruntfile.js
@@ -40,6 +40,21 @@ module.exports = function (grunt) {
}
},
+ jscs: {
+ options: {
+ config: 'js/.jscs.json',
+ },
+ gruntfile: {
+ src: ['Gruntfile.js']
+ },
+ src: {
+ src: ['js/*.js']
+ },
+ test: {
+ src: ['js/tests/unit/*.js']
+ }
+ },
+
concat: {
options: {
banner: '<%= banner %><%= jqueryCheck %>',
@@ -288,6 +303,7 @@ module.exports = function (grunt) {
grunt.loadNpmTasks('grunt-contrib-watch');
grunt.loadNpmTasks('grunt-html-validation');
grunt.loadNpmTasks('grunt-jekyll');
+ grunt.loadNpmTasks('grunt-jscs-checker');
grunt.loadNpmTasks('grunt-recess');
grunt.loadNpmTasks('grunt-saucelabs');
grunt.loadNpmTasks('grunt-sed');
@@ -296,7 +312,7 @@ module.exports = function (grunt) {
grunt.registerTask('validate-html', ['jekyll', 'validation']);
// Test task.
- var testSubtasks = ['dist-css', 'jshint', 'qunit', 'validate-html'];
+ var testSubtasks = ['dist-css', 'jshint', 'jscs', 'qunit', 'validate-html'];
// Only run Sauce Labs tests if there's a Sauce access key
if (typeof process.env.SAUCE_ACCESS_KEY !== 'undefined') {
testSubtasks.push('connect');
diff --git a/js/.jscs.json b/js/.jscs.json
new file mode 100644
index 000000000..2f04d9cd6
--- /dev/null
+++ b/js/.jscs.json
@@ -0,0 +1,14 @@
+{
+ "requireSpaceAfterKeywords": ["if", "else", "for", "while", "do", "switch", "return"],
+ "requireSpacesInFunctionExpression": { "beforeOpeningCurlyBrace": true },
+ "disallowLeftStickedOperators": ["?", "+", "-", "/", "*", "=", "==", "===", "!=", "!==", ">", ">=", "<", "<="],
+ "requireRightStickedOperators": ["!"],
+ "disallowRightStickedOperators": ["?", "/", "*", ":", "=", "==", "===", "!=", "!==", ">", ">=", "<", "<="],
+ "disallowSpaceAfterPrefixUnaryOperators": ["++", "--", "+", "-", "~", "!"],
+ "disallowSpaceBeforePostfixUnaryOperators": ["++", "--"],
+ "requireSpaceBeforeBinaryOperators": ["+", "-", "/", "*", "=", "==", "===", "!=", "!=="],
+ "requireSpaceAfterBinaryOperators": ["+", "-", "/", "*", "=", "==", "===", "!=", "!=="],
+ "disallowKeywords": ["with"],
+ "validateLineBreaks": "LF",
+ "requireLineFeedAtFileEnd": true
+}
diff --git a/package.json b/package.json
index 813cf1d13..3c9fd7fe6 100644
--- a/package.json
+++ b/package.json
@@ -32,6 +32,7 @@
, "grunt-contrib-watch": "~0.5.3"
, "grunt-html-validation": "~0.1.6"
, "grunt-jekyll": "~0.4.0"
+ , "grunt-jscs-checker": "~0.2.5"
, "grunt-recess": "~0.5.0"
, "grunt-saucelabs": "~4.1.2"
, "grunt-sed": "~0.1.1"