Browse Source

Add more JSCS checks.

pull/492/head
XhmikosR 11 years ago
parent
commit
b864a88355
  1. 2
      Gruntfile.js
  2. 2
      dist/js/ratchet.js
  3. 2
      docs/assets/js/docs.js
  4. 2
      docs/dist/js/ratchet.js
  5. 7
      js/.jscsrc
  6. 2
      js/sliders.js

2
Gruntfile.js

@ -251,7 +251,7 @@ module.exports = function(grunt) {
}); });
// Load the plugins // Load the plugins
require('load-grunt-tasks')(grunt, {scope: 'devDependencies'}); require('load-grunt-tasks')(grunt, { scope: 'devDependencies' });
require('time-grunt')(grunt); require('time-grunt')(grunt);
// Default task(s). // Default task(s).

2
dist/js/ratchet.js vendored

@ -723,7 +723,7 @@
var setSlideNumber = function (offset) { var setSlideNumber = function (offset) {
var round = offset ? (deltaX < 0 ? 'ceil' : 'floor') : 'round'; var round = offset ? (deltaX < 0 ? 'ceil' : 'floor') : 'round';
slideNumber = Math[round](getScroll() / ( scrollableArea / slider.children.length) ); slideNumber = Math[round](getScroll() / (scrollableArea / slider.children.length));
slideNumber += offset; slideNumber += offset;
slideNumber = Math.min(slideNumber, 0); slideNumber = Math.min(slideNumber, 0);
slideNumber = Math.max(-(slider.children.length - 1), slideNumber); slideNumber = Math.max(-(slider.children.length - 1), slideNumber);

2
docs/assets/js/docs.js

@ -136,7 +136,7 @@ $(function() {
if ((device.initialTop - currentTop) <= device.dockingOffset) { if ((device.initialTop - currentTop) <= device.dockingOffset) {
device[0].className = 'device device-fixed'; device[0].className = 'device device-fixed';
device.css({top: device.dockingOffset}); device.css({ top: device.dockingOffset });
} else { } else {
device[0].className = 'device'; device[0].className = 'device';
device[0].setAttribute('style',''); device[0].setAttribute('style','');

2
docs/dist/js/ratchet.js vendored

@ -723,7 +723,7 @@
var setSlideNumber = function (offset) { var setSlideNumber = function (offset) {
var round = offset ? (deltaX < 0 ? 'ceil' : 'floor') : 'round'; var round = offset ? (deltaX < 0 ? 'ceil' : 'floor') : 'round';
slideNumber = Math[round](getScroll() / ( scrollableArea / slider.children.length) ); slideNumber = Math[round](getScroll() / (scrollableArea / slider.children.length));
slideNumber += offset; slideNumber += offset;
slideNumber = Math.min(slideNumber, 0); slideNumber = Math.min(slideNumber, 0);
slideNumber = Math.max(-(slider.children.length - 1), slideNumber); slideNumber = Math.max(-(slider.children.length - 1), slideNumber);

7
js/.jscsrc

@ -8,11 +8,14 @@
"disallowRightStickedOperators": ["?", "/", "*", ":", "=", "==", "===", "!=", "!==", ">", ">=", "<", "<="], "disallowRightStickedOperators": ["?", "/", "*", ":", "=", "==", "===", "!=", "!==", ">", ">=", "<", "<="],
"disallowSpaceAfterPrefixUnaryOperators": ["++", "--", "+", "-", "~", "!"], "disallowSpaceAfterPrefixUnaryOperators": ["++", "--", "+", "-", "~", "!"],
"disallowSpaceBeforePostfixUnaryOperators": ["++", "--"], "disallowSpaceBeforePostfixUnaryOperators": ["++", "--"],
"disallowSpacesInsideArrayBrackets": true,
"disallowSpacesInsideParentheses": true,
"disallowTrailingWhitespace": true, "disallowTrailingWhitespace": true,
"requireCamelCaseOrUpperCaseIdentifiers": true, "requireCamelCaseOrUpperCaseIdentifiers": true,
"requireCapitalizedConstructors": true, "requireCapitalizedConstructors": true,
"requireCommaBeforeLineBreak": true, "requireCommaBeforeLineBreak": true,
"requireCurlyBraces": ["if", "else", "for", "while", "do", "try", "catch", "case", "default"], "requireCurlyBraces": ["if", "else", "for", "while", "do", "try", "catch", "case", "default"],
"requireDotNotation": true,
"requireLeftStickedOperators": [","], "requireLeftStickedOperators": [","],
"requireLineFeedAtFileEnd": true, "requireLineFeedAtFileEnd": true,
"requireParenthesesAroundIIFE": true, "requireParenthesesAroundIIFE": true,
@ -20,7 +23,11 @@
"requireSpaceAfterBinaryOperators": ["+", "-", "/", "*", "=", "==", "===", "!=", "!==", ">", "<", ">=", "<="], "requireSpaceAfterBinaryOperators": ["+", "-", "/", "*", "=", "==", "===", "!=", "!==", ">", "<", ">=", "<="],
"requireSpaceAfterKeywords": ["if", "else", "for", "while", "do", "switch", "return", "try", "catch"], "requireSpaceAfterKeywords": ["if", "else", "for", "while", "do", "switch", "return", "try", "catch"],
"requireSpaceBeforeBinaryOperators": ["+", "-", "/", "*", "=", "==", "===", "!=", "!==", ">", "<", ">=", "<="], "requireSpaceBeforeBinaryOperators": ["+", "-", "/", "*", "=", "==", "===", "!=", "!==", ">", "<", ">=", "<="],
"requireSpacesInAnonymousFunctionExpression": { "beforeOpeningCurlyBrace": true },
"requireSpacesInFunctionDeclaration": { "beforeOpeningCurlyBrace": true },
"requireSpacesInFunctionExpression": { "beforeOpeningCurlyBrace": true }, "requireSpacesInFunctionExpression": { "beforeOpeningCurlyBrace": true },
"requireSpacesInNamedFunctionExpression": { "beforeOpeningCurlyBrace": true },
"requireSpacesInsideObjectBrackets": "allButNested",
"validateIndentation": 2, "validateIndentation": 2,
"validateLineBreaks": "LF", "validateLineBreaks": "LF",
"validateQuoteMarks": "'" "validateQuoteMarks": "'"

2
js/sliders.js

@ -43,7 +43,7 @@
var setSlideNumber = function (offset) { var setSlideNumber = function (offset) {
var round = offset ? (deltaX < 0 ? 'ceil' : 'floor') : 'round'; var round = offset ? (deltaX < 0 ? 'ceil' : 'floor') : 'round';
slideNumber = Math[round](getScroll() / ( scrollableArea / slider.children.length) ); slideNumber = Math[round](getScroll() / (scrollableArea / slider.children.length));
slideNumber += offset; slideNumber += offset;
slideNumber = Math.min(slideNumber, 0); slideNumber = Math.min(slideNumber, 0);
slideNumber = Math.max(-(slider.children.length - 1), slideNumber); slideNumber = Math.max(-(slider.children.length - 1), slideNumber);

Loading…
Cancel
Save