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
require('load-grunt-tasks')(grunt, {scope: 'devDependencies'});
require('load-grunt-tasks')(grunt, { scope: 'devDependencies' });
require('time-grunt')(grunt);
// Default task(s).

2
dist/js/ratchet.js vendored

@ -723,7 +723,7 @@
var setSlideNumber = function (offset) {
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 = Math.min(slideNumber, 0);
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) {
device[0].className = 'device device-fixed';
device.css({top: device.dockingOffset});
device.css({ top: device.dockingOffset });
} else {
device[0].className = 'device';
device[0].setAttribute('style','');

2
docs/dist/js/ratchet.js vendored

@ -723,7 +723,7 @@
var setSlideNumber = function (offset) {
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 = Math.min(slideNumber, 0);
slideNumber = Math.max(-(slider.children.length - 1), slideNumber);

7
js/.jscsrc

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

2
js/sliders.js

@ -43,7 +43,7 @@
var setSlideNumber = function (offset) {
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 = Math.min(slideNumber, 0);
slideNumber = Math.max(-(slider.children.length - 1), slideNumber);

Loading…
Cancel
Save