Krinkle has uploaded a new change for review. https://gerrit.wikimedia.org/r/130862
Change subject: package.json: Update devDependencies (update jshint and jscs config) ...................................................................... package.json: Update devDependencies (update jshint and jscs config) jshint: * Update to grunt-contrib-jshint v0.10.0 (jshint v2.5.0). * Remove coding style option "noempty" (already covered by jscs). * Remove option "regexp". * Enable new option "freeze" (prohibits changing native prototypes). http://www.jshint.com/blog/new-in-jshint-oct-2013/#option-freeze * Re-order to match http://www.jshint.com/docs/options/ jscs: * Update to grunt-contrib-jshint v0.4.2 (jscs v1.4.0). * Format .jscsrc file in a more spaceious way and order the properties less arbitrarily (using the jscs's readme order). * Enforce more details of our coding style: - requireCurlyBraces: Add more keywords that should have their code block wrapped in curly braces. - requireSpaceAfterKeywords: Add more keywords that should have a space after them. - requireMultipleVarDecl: Enable the new "onevar" checker (like jshint's "onevar"). Introduced in jscs v1.4.0. - disallowTrailingComma: Enable. - disallowKeywordsOnNewLine: Enable for "else". - requireSpaceBeforeBlockStatements: Enable. - requireBlocksOnNewline: Enable, but only when more than 1 statement (this still will validate shorthand like the following, which we make use of at the moment): var noop = function () { return true; }; - requireSpacesInFunctionExpression: Remove, this is already covered by requireSpaceAfterKeywords and requireSpaceBeforeBlockStatements, which enforce: x.noop = function () {}; x.Foo = function Foo() {}; - disallowSpacesInNamedFunctionExpression: Enable for the parenthesis. Disallows: x.Foo = function Foo () {}; - disallowSpacesInFunctionDeclaration: Enable for parenthesis. Disallows: function noop () {} - disallowDanglingUnderscores: Enable (like jshint's "nomen"). - disallowSpaceAfterPrefixUnaryOperators: Add "!" back, now that the bug where it conflicts with requireRightStickedOperators is fixed. https://github.com/mdevils/node-jscs/issues/87 - disallowMixedSpacesAndTabs: Enable. - disallowYodaConditions: Enable. qunit: * Update to node-qunit v0.6.2 (does not ship qunitjs itself). (mostly minor changes) Change-Id: If46b94ce18a7084cf6b9a2223d770ea03386815e --- M .jscsrc M .jshintrc M package.json 3 files changed, 98 insertions(+), 19 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/oojs/core refs/changes/62/130862/1 diff --git a/.jscsrc b/.jscsrc index ef8c8a2..2bd1274 100644 --- a/.jscsrc +++ b/.jscsrc @@ -1,31 +1,111 @@ { - "requireCurlyBraces": ["if", "else", "for", "while", "do"], - "requireSpaceAfterKeywords": ["if", "else", "for", "while", "do", "switch", "return", "function"], + "requireCurlyBraces": [ + "if", + "else", + "for", + "while", + "do", + "try", + "catch" + ], + "requireSpaceAfterKeywords": [ + "if", + "else", + "for", + "while", + "do", + "switch", + "return", + "try", + "catch", + "function" + ], + "requireSpaceBeforeBlockStatements": true, "requireParenthesesAroundIIFE": true, - "requireSpacesInFunctionExpression": { - "beforeOpeningCurlyBrace": true + "disallowSpacesInNamedFunctionExpression": { + "beforeOpeningRoundBrace": true }, - "requireMultipleVarDecl": true, - "disallowQuotedKeysInObjects": true, + "disallowSpacesInFunctionDeclaration": { + "beforeOpeningRoundBrace": true + }, + "requireMultipleVarDecl": "onevar", + "requireBlocksOnNewline": 1, + "disallowEmptyBlocks": true, "requireSpacesInsideObjectBrackets": "all", + "disallowQuotedKeysInObjects": true, + "disallowDanglingUnderscores": true, "disallowSpaceAfterObjectKeys": true, "requireCommaBeforeLineBreak": true, - "disallowLeftStickedOperators": ["?", ">", ">=", "<", "<="], - "disallowRightStickedOperators": ["?", "/", "*", ":", "=", "==", "===", "!=", "!==", ">", ">=", "<", "<="], + "disallowLeftStickedOperators": [ + "?", + ">", + ">=", + "<", + "<=" + ], "requireRightStickedOperators": ["!"], + "disallowRightStickedOperators": [ + "?", + "+", + "/", + "*", + ":", + "=", + "==", + "===", + "!=", + "!==", + ">", + ">=", + "<", + "<=" + ], "requireLeftStickedOperators": [","], - "disallowSpaceAfterPrefixUnaryOperators": ["++", "--", "+", "-", "~"], - "disallowSpaceBeforePostfixUnaryOperators": ["++", "--"], - "requireSpaceBeforeBinaryOperators": ["+", "-", "/", "*", "=", "==", "===", "!=", "!=="], - "requireSpaceAfterBinaryOperators": ["+", "-", "/", "*", "=", "==", "===", "!=", "!=="], + "disallowSpaceAfterPrefixUnaryOperators": [ + "++", + "--", + "+", + "-", + "~", + "!" + ], + "disallowSpaceBeforePostfixUnaryOperators": [ + "++", + "--" + ], + "requireSpaceBeforeBinaryOperators": [ + "+", + "-", + "/", + "*", + "=", + "==", + "===", + "!=", + "!==" + ], + "requireSpaceAfterBinaryOperators": [ + "+", + "-", + "/", + "*", + "=", + "==", + "===", + "!=", + "!==" + ], "requireCamelCaseOrUpperCaseIdentifiers": true, "disallowKeywords": [ "with" ], "disallowMultipleLineBreaks": true, "validateLineBreaks": "LF", "validateQuoteMarks": "'", + "disallowMixedSpacesAndTabs": true, "disallowTrailingWhitespace": true, + "disallowTrailingComma": true, + "disallowKeywordsOnNewLine": ["else"], "requireLineFeedAtFileEnd": true, "requireCapitalizedConstructors": true, "requireDotNotation": true, - "disallowEmptyBlocks": true + "disallowYodaConditions": true } diff --git a/.jshintrc b/.jshintrc index d61ae7d..40e5b98 100644 --- a/.jshintrc +++ b/.jshintrc @@ -3,14 +3,13 @@ "bitwise": true, "curly": true, "eqeqeq": true, + "freeze": true, "latedef": true, "noarg": true, - "noempty": true, "nonew": true, - "regexp": true, - "strict": false, "undef": true, "unused": true, + "strict": false, "globals": { "oo": true, diff --git a/package.json b/package.json index 09312e3..8c4c724 100644 --- a/package.json +++ b/package.json @@ -27,11 +27,11 @@ }, "dependencies": {}, "devDependencies": { - "qunit": "0.5.17", + "qunit": "0.6.2", "grunt": "0.4.2", - "grunt-contrib-jshint": "0.9.2", + "grunt-contrib-jshint": "0.10.0", "grunt-contrib-qunit": "0.4.0", "grunt-contrib-watch": "0.6.1", - "grunt-jscs-checker": "0.4.1" + "grunt-jscs-checker": "0.4.2" } } -- To view, visit https://gerrit.wikimedia.org/r/130862 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: newchange Gerrit-Change-Id: If46b94ce18a7084cf6b9a2223d770ea03386815e Gerrit-PatchSet: 1 Gerrit-Project: oojs/core Gerrit-Branch: master Gerrit-Owner: Krinkle <krinklem...@gmail.com> _______________________________________________ MediaWiki-commits mailing list MediaWiki-commits@lists.wikimedia.org https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits