diff options
| author | XhmikosR <[email protected]> | 2014-03-17 09:07:21 +0200 |
|---|---|---|
| committer | XhmikosR <[email protected]> | 2014-06-06 01:23:06 +0300 |
| commit | 5ef9383f5388ba7a701c4377b43ebdbedb0bf748 (patch) | |
| tree | daf1301e743f14e536243baafd00b86f92d86556 /js | |
| parent | a8641b4db779da385782275b49abb796f64a413c (diff) | |
| download | bootstrap-5ef9383f5388ba7a701c4377b43ebdbedb0bf748.tar.xz bootstrap-5ef9383f5388ba7a701c4377b43ebdbedb0bf748.zip | |
Tweak JSHint and JSCS checks.
Be more consistent across the whole codebase.
Also, make use of JSHint's 2.5.1 `extends` and `qunit` options. This way we set our basis options in js/.jshintrc and override the rest.
Diffstat (limited to 'js')
| -rw-r--r-- | js/.jscsrc | 11 | ||||
| -rw-r--r-- | js/.jshintrc | 12 | ||||
| -rw-r--r-- | js/tests/unit/.jshintrc | 5 | ||||
| -rw-r--r-- | js/tests/unit/phantom.js | 1 |
4 files changed, 21 insertions, 8 deletions
diff --git a/js/.jscsrc b/js/.jscsrc index 6725ce89d..fb6cd10c2 100644 --- a/js/.jscsrc +++ b/js/.jscsrc @@ -1,16 +1,22 @@ { "disallowEmptyBlocks": true, "disallowKeywords": ["with"], - "disallowLeftStickedOperators": ["?", "+", "-", "/", "*", "=", "==", "===", "!=", "!==", ">", ">=", "<", "<="], + "disallowLeftStickedOperators": ["?", "/", "*", "=", "==", "===", "!=", "!==", ">", ">=", "<", "<="], "disallowMixedSpacesAndTabs": true, "disallowMultipleLineStrings": true, + "disallowMultipleVarDecl": true, "disallowQuotedKeysInObjects": "allButReserved", "disallowRightStickedOperators": ["?", "/", "*", ":", "=", "==", "===", "!=", "!==", ">", ">=", "<", "<="], "disallowSpaceAfterPrefixUnaryOperators": ["++", "--", "+", "-", "~", "!"], "disallowSpaceBeforePostfixUnaryOperators": ["++", "--"], + "disallowSpacesInNamedFunctionExpression": { "beforeOpeningRoundBrace": true }, + "disallowSpacesInsideArrayBrackets": true, + "disallowSpacesInsideParentheses": true, + "disallowTrailingComma": true, "disallowTrailingWhitespace": true, "requireCamelCaseOrUpperCaseIdentifiers": true, "requireCapitalizedConstructors": true, + "requireCommaBeforeLineBreak": true, "requireDotNotation": true, "requireLeftStickedOperators": [","], "requireLineFeedAtFileEnd": true, @@ -18,10 +24,11 @@ "requireSpaceAfterBinaryOperators": ["+", "-", "/", "*", "=", "==", "===", "!=", "!==", ">", "<", ">=", "<="], "requireSpaceAfterKeywords": ["if", "else", "for", "while", "do", "switch", "return", "try", "catch"], "requireSpaceBeforeBinaryOperators": ["+", "-", "/", "*", "=", "==", "===", "!=", "!==", ">", "<", ">=", "<="], - "requireSpacesInAnonymousFunctionExpression": { "beforeOpeningCurlyBrace": true }, + "requireSpacesInAnonymousFunctionExpression": { "beforeOpeningCurlyBrace": true, "beforeOpeningRoundBrace": true }, "requireSpacesInFunctionDeclaration": { "beforeOpeningCurlyBrace": true }, "requireSpacesInFunctionExpression": { "beforeOpeningCurlyBrace": true }, "requireSpacesInNamedFunctionExpression": { "beforeOpeningCurlyBrace": true }, + "requireSpacesInsideObjectBrackets": "allButNested", "validateIndentation": 2, "validateLineBreaks": "LF", "validateQuoteMarks": "'" diff --git a/js/.jshintrc b/js/.jshintrc index c6104dc93..a59e1d00a 100644 --- a/js/.jshintrc +++ b/js/.jshintrc @@ -1,13 +1,15 @@ { "asi" : true, - "boss" : true, "browser" : true, - "debug" : true, - "devel" : true, "eqeqeq" : false, "eqnull" : true, + "es3" : true, "expr" : true, + "jquery" : true, + "latedef" : true, "laxbreak" : true, - "unused" : true, - "validthis": true + "nonbsp" : true, + "strict" : true, + "undef" : true, + "unused" : true } diff --git a/js/tests/unit/.jshintrc b/js/tests/unit/.jshintrc new file mode 100644 index 000000000..682a49af1 --- /dev/null +++ b/js/tests/unit/.jshintrc @@ -0,0 +1,5 @@ +{ + "extends" : "../../.jshintrc", + "devel" : true, + "qunit" : true +} diff --git a/js/tests/unit/phantom.js b/js/tests/unit/phantom.js index cd184c2f4..b5f0c67a6 100644 --- a/js/tests/unit/phantom.js +++ b/js/tests/unit/phantom.js @@ -6,7 +6,6 @@ * Licensed under the MIT license. */ -/*global QUnit:true, alert:true*/ (function () { 'use strict'; |
