Browse Source

Merge pull request #436 from twbs/jscs

Add JSCS support
pull/437/head
XhmikosR 11 years ago
parent
commit
e9bad869d3
  1. 17
      Gruntfile.js
  2. 1
      dist/js/ratchet.js
  3. 2
      docs/assets/css/docs.min.css
  4. 1
      docs/dist/js/ratchet.js
  5. 26
      js/.jscsrc
  6. 7
      js/.jshintrc
  7. 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: { csslint: {
options: { options: {
csslintrc: 'sass/.csslintrc' csslintrc: 'sass/.csslintrc'
@ -243,7 +258,7 @@ module.exports = function(grunt) {
grunt.registerTask('validate-html', ['jekyll', 'validation']); grunt.registerTask('validate-html', ['jekyll', 'validation']);
grunt.registerTask('build', ['dist']); grunt.registerTask('build', ['dist']);
grunt.registerTask('default', ['dist']); grunt.registerTask('default', ['dist']);
grunt.registerTask('test', ['dist', 'jshint', 'validate-html']); grunt.registerTask('test', ['dist', 'jshint', 'jscs', 'validate-html']);
// Version numbering task. // Version numbering task.
// grunt change-version-number --oldver=A.B.C --newver=X.Y.Z // grunt change-version-number --oldver=A.B.C --newver=X.Y.Z

1
dist/js/ratchet.js vendored

@ -670,6 +670,7 @@
window.addEventListener('click', function (e) { if (getTarget(e.target)) {e.preventDefault();} }); window.addEventListener('click', function (e) { if (getTarget(e.target)) {e.preventDefault();} });
}()); }());
/* ---------------------------------- /* ----------------------------------
* SLIDER v2.0.1 * SLIDER v2.0.1
* Licensed under The MIT License * Licensed under The MIT License

2
docs/assets/css/docs.min.css vendored

File diff suppressed because one or more lines are too long

1
docs/dist/js/ratchet.js vendored

@ -670,6 +670,7 @@
window.addEventListener('click', function (e) { if (getTarget(e.target)) {e.preventDefault();} }); window.addEventListener('click', function (e) { if (getTarget(e.target)) {e.preventDefault();} });
}()); }());
/* ---------------------------------- /* ----------------------------------
* SLIDER v2.0.1 * SLIDER v2.0.1
* Licensed under The MIT License * Licensed under The MIT License

26
js/.jscsrc

@ -0,0 +1,26 @@
{
"disallowEmptyBlocks": true,
"disallowKeywords": ["with"],
"disallowLeftStickedOperators": ["?", "/", "*", "=", "==", "===", "!=", "!==", ">", ">=", "<", "<="],
"disallowMixedSpacesAndTabs": true,
"disallowMultipleLineStrings": true,
"disallowRightStickedOperators": ["?", "/", "*", ":", "=", "==", "===", "!=", "!==", ">", ">=", "<", "<="],
"disallowSpaceAfterPrefixUnaryOperators": ["++", "--", "+", "-", "~", "!"],
"disallowSpaceBeforePostfixUnaryOperators": ["++", "--"],
"disallowTrailingWhitespace": true,
"requireCamelCaseOrUpperCaseIdentifiers": true,
"requireCapitalizedConstructors": true,
"requireCommaBeforeLineBreak": true,
"requireCurlyBraces": ["if", "else", "for", "while", "do", "try", "catch", "case", "default"],
"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": "'"
}

7
js/.jshintrc

@ -1,22 +1,15 @@
{ {
"bitwise" : true, "bitwise" : true,
"browser" : true, "browser" : true,
"camelcase" : true,
"curly" : true,
"devel" : true, "devel" : true,
"eqeqeq" : true, "eqeqeq" : true,
"eqnull" : true, "eqnull" : true,
"expr" : true, "expr" : true,
"forin" : true, "forin" : true,
"freeze" : true, "freeze" : true,
"immed" : true,
"indent" : 2,
"latedef" : true, "latedef" : true,
"newcap" : true,
"nonbsp" : true, "nonbsp" : true,
"quotmark" : "single",
"strict" : true, "strict" : true,
"trailing" : true,
"undef" : true, "undef" : true,
"unused" : true "unused" : true
} }

1
package.json

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

Loading…
Cancel
Save