Browse Source

Add JSCS support.

Backported from Bootstrap, adapted for Ratchet.
pull/436/head
XhmikosR 11 years ago
parent
commit
ea3d80f726
  1. 17
      Gruntfile.js
  2. 23
      js/.jscsrc
  3. 1
      package.json

17
Gruntfile.js

@ -186,6 +186,21 @@ module.exports = function(grunt) {
}
},
jscs: {
options: {
config: 'js/.jscsrc'
},
grunt: {
src: '<%= jshint.grunt.src %>'
},
src: {
src: '<%= jshint.src.src %>'
},
docs: {
src: '<%= jshint.docs.src %>'
}
},
csslint: {
options: {
csslintrc: 'sass/.csslintrc'
@ -243,7 +258,7 @@ module.exports = function(grunt) {
grunt.registerTask('validate-html', ['jekyll', 'validation']);
grunt.registerTask('build', ['dist']);
grunt.registerTask('default', ['dist']);
grunt.registerTask('test', ['dist', 'jshint', 'validate-html']);
grunt.registerTask('test', ['dist', 'jshint', 'jscs', 'validate-html']);
// Version numbering task.
// grunt change-version-number --oldver=A.B.C --newver=X.Y.Z

23
js/.jscsrc

@ -0,0 +1,23 @@
{
"disallowEmptyBlocks": true,
"disallowKeywords": ["with"],
"disallowLeftStickedOperators": ["?", "/", "*", "=", "==", "===", "!=", "!==", ">", ">=", "<", "<="],
"disallowMixedSpacesAndTabs": true,
"disallowMultipleLineStrings": true,
"disallowRightStickedOperators": ["?", "/", "*", ":", "=", "==", "===", "!=", "!==", ">", ">=", "<", "<="],
"disallowSpaceAfterPrefixUnaryOperators": ["++", "--", "+", "-", "~", "!"],
"disallowSpaceBeforePostfixUnaryOperators": ["++", "--"],
"disallowTrailingWhitespace": true,
"requireCamelCaseOrUpperCaseIdentifiers": true,
"requireLeftStickedOperators": [","],
"requireLineFeedAtFileEnd": true,
"requireParenthesesAroundIIFE": true,
"requireRightStickedOperators": ["!"],
"requireSpaceAfterBinaryOperators": ["+", "-", "/", "*", "=", "==", "===", "!=", "!==", ">", "<", ">=", "<="],
"requireSpaceAfterKeywords": ["if", "else", "for", "while", "do", "switch", "return", "try", "catch"],
"requireSpaceBeforeBinaryOperators": ["+", "-", "/", "*", "=", "==", "===", "!=", "!==", ">", "<", ">=", "<="],
"requireSpacesInFunctionExpression": { "beforeOpeningCurlyBrace": true },
"validateIndentation": 2,
"validateLineBreaks": "LF",
"validateQuoteMarks": "'"
}

1
package.json

@ -39,6 +39,7 @@
"grunt-csscomb": "~2.0.1",
"grunt-html-validation": "~0.1.13",
"grunt-jekyll": "~0.4.1",
"grunt-jscs-checker": "~0.4.0",
"grunt-sed": "~0.1.1",
"load-grunt-tasks": "~0.4.0"
}

Loading…
Cancel
Save