[MediaWiki-commits] [Gerrit] data-values/value-view[master]: Use eslint to lint JavaScript instead of jscs and jshint
jenkins-bot has submitted this change and it was merged. ( https://gerrit.wikimedia.org/r/355224 ) Change subject: Use eslint to lint JavaScript instead of jscs and jshint .. Use eslint to lint JavaScript instead of jscs and jshint Bug: T165843 Change-Id: I45354d6849276b21be9d4ae34af7d993846f5351 --- R .eslintignore A .eslintrc.json D .jscsrc D .jshintrc M .travis.yml M Gruntfile.js M lib/jquery.ui/jquery.ui.languagesuggester.js M lib/jquery.ui/jquery.ui.unitsuggester.js M lib/jquery/jquery.AnimationEvent.js M lib/jquery/jquery.inputautoexpand.js M package.json A tests/.eslintrc.json M tests/lib/jquery.event/jquery.event.special.eachchange.tests.js M tests/lib/jquery/jquery.PurposedCallbacks.tests.js M tests/src/ExpertExtender/ExpertExtender.CalendarHint.tests.js M tests/src/jquery.valueview.ExpertStore.tests.js 16 files changed, 62 insertions(+), 178 deletions(-) Approvals: jenkins-bot: Verified Thiemo Mättig (WMDE): Looks good to me, approved diff --git a/.jshintignore b/.eslintignore similarity index 63% rename from .jshintignore rename to .eslintignore index c2658d7..7e5da87 100644 --- a/.jshintignore +++ b/.eslintignore @@ -1 +1,2 @@ node_modules/ +vendor/ diff --git a/.eslintrc.json b/.eslintrc.json new file mode 100644 index 000..8922209 --- /dev/null +++ b/.eslintrc.json @@ -0,0 +1,29 @@ +{ + "extends": "wikimedia", + "env": { + "browser": true, + "jquery": true + }, + "globals": { + "dataValues": false, + "globeCoordinate": false, + "mediaWiki": false, + "util": false, + "valueFormatters": false, + "valueParsers": false + }, + "rules": { + "array-bracket-spacing": "off", + "comma-spacing": "off", + "computed-property-spacing": "off", + "indent": "off", + "no-underscore-dangle": "off", + "no-unused-vars": "off", + "one-var": "off", + "operator-linebreak": "off", + "space-before-function-paren": "off", + "valid-jsdoc": "off", + "vars-on-top": "off", + "wrap-iife": "off" + } +} diff --git a/.jscsrc b/.jscsrc deleted file mode 100644 index fd10385..000 --- a/.jscsrc +++ /dev/null @@ -1,94 +0,0 @@ -{ - // - // This is a copy of the wikimedia preset so we can disable some of the rules - - "requireCurlyBraces": [ - "if", - "else", - "for", - "while", - "do", - "try", - "catch" - ], - "requireSpaceBeforeKeywords": true, - "requireSpaceBeforeBlockStatements": true, - "requireParenthesesAroundIIFE": true, - "requireSpacesInConditionalExpression": true, - "disallowSpacesInNamedFunctionExpression": { - "beforeOpeningRoundBrace": true - }, - "disallowSpacesInFunctionDeclaration": { - "beforeOpeningRoundBrace": true - }, - "disallowSpacesInCallExpression": true, - "requireBlocksOnNewline": 1, - "disallowEmptyBlocks": true, - "requireSpacesInsideObjectBrackets": "all", - "requireSpacesInsideParentheses": "all", - "disallowQuotedKeysInObjects": "allButReserved", - "disallowSpaceAfterObjectKeys": true, - "requireSpaceBeforeObjectValues": true, - "requireCommaBeforeLineBreak": true, - "disallowSpaceAfterPrefixUnaryOperators": true, - "disallowSpaceBeforePostfixUnaryOperators": true, - "disallowSpaceBeforeBinaryOperators": [ - "," - ], - "requireSpaceBeforeBinaryOperators": true, - "requireSpaceAfterBinaryOperators": true, - "disallowImplicitTypeConversion": [ - "binary", - "string" - ], - "requireCamelCaseOrUpperCaseIdentifiers": true, - "disallowKeywords": [ - "with" - ], - "disallowMixedSpacesAndTabs": true, - "disallowMultipleLineBreaks": true, - "disallowOperatorBeforeLineBreak": [ - "." - ], - "disallowTrailingWhitespace": true, - "disallowTrailingComma": true, - "disallowKeywordsOnNewLine": [ - "else", - "catch" - ], - "requireLineBreakAfterVariableAssignment": true, - "requireLineFeedAtFileEnd": true, - "requireCapitalizedConstructors": true, - "requireDotNotation": true, - "disallowYodaConditions": true, - "requireSpaceAfterLineComment": true, - "disallowNewlineBeforeBlockStatements": true, - "validateLineBreaks": "LF", - "validateQuoteMarks": "'", - - // - // Rules from wikimedia preset we don't follow - - // "validateIndentation": "\t", - //
[MediaWiki-commits] [Gerrit] data-values/value-view[master]: Use eslint to lint JavaScript instead of jscs and jshint
WMDE-leszek has uploaded a new change for review. ( https://gerrit.wikimedia.org/r/355224 ) Change subject: Use eslint to lint JavaScript instead of jscs and jshint .. Use eslint to lint JavaScript instead of jscs and jshint Bug: T165843 Change-Id: I45354d6849276b21be9d4ae34af7d993846f5351 --- R .eslintignore A .eslintrc.json D .jscsrc D .jshintrc M .travis.yml M Gruntfile.js M lib/jquery.ui/jquery.ui.languagesuggester.js M lib/jquery.ui/jquery.ui.unitsuggester.js M lib/jquery/jquery.AnimationEvent.js M lib/jquery/jquery.inputautoexpand.js M package.json A tests/.eslintrc.json M tests/lib/jquery.event/jquery.event.special.eachchange.tests.js M tests/lib/jquery/jquery.PurposedCallbacks.tests.js M tests/src/ExpertExtender/ExpertExtender.CalendarHint.tests.js M tests/src/jquery.valueview.ExpertStore.tests.js 16 files changed, 62 insertions(+), 178 deletions(-) git pull ssh://gerrit.wikimedia.org:29418/data-values/value-view refs/changes/24/355224/1 diff --git a/.jshintignore b/.eslintignore similarity index 63% rename from .jshintignore rename to .eslintignore index c2658d7..7e5da87 100644 --- a/.jshintignore +++ b/.eslintignore @@ -1 +1,2 @@ node_modules/ +vendor/ diff --git a/.eslintrc.json b/.eslintrc.json new file mode 100644 index 000..8922209 --- /dev/null +++ b/.eslintrc.json @@ -0,0 +1,29 @@ +{ + "extends": "wikimedia", + "env": { + "browser": true, + "jquery": true + }, + "globals": { + "dataValues": false, + "globeCoordinate": false, + "mediaWiki": false, + "util": false, + "valueFormatters": false, + "valueParsers": false + }, + "rules": { + "array-bracket-spacing": "off", + "comma-spacing": "off", + "computed-property-spacing": "off", + "indent": "off", + "no-underscore-dangle": "off", + "no-unused-vars": "off", + "one-var": "off", + "operator-linebreak": "off", + "space-before-function-paren": "off", + "valid-jsdoc": "off", + "vars-on-top": "off", + "wrap-iife": "off" + } +} diff --git a/.jscsrc b/.jscsrc deleted file mode 100644 index fd10385..000 --- a/.jscsrc +++ /dev/null @@ -1,94 +0,0 @@ -{ - // - // This is a copy of the wikimedia preset so we can disable some of the rules - - "requireCurlyBraces": [ - "if", - "else", - "for", - "while", - "do", - "try", - "catch" - ], - "requireSpaceBeforeKeywords": true, - "requireSpaceBeforeBlockStatements": true, - "requireParenthesesAroundIIFE": true, - "requireSpacesInConditionalExpression": true, - "disallowSpacesInNamedFunctionExpression": { - "beforeOpeningRoundBrace": true - }, - "disallowSpacesInFunctionDeclaration": { - "beforeOpeningRoundBrace": true - }, - "disallowSpacesInCallExpression": true, - "requireBlocksOnNewline": 1, - "disallowEmptyBlocks": true, - "requireSpacesInsideObjectBrackets": "all", - "requireSpacesInsideParentheses": "all", - "disallowQuotedKeysInObjects": "allButReserved", - "disallowSpaceAfterObjectKeys": true, - "requireSpaceBeforeObjectValues": true, - "requireCommaBeforeLineBreak": true, - "disallowSpaceAfterPrefixUnaryOperators": true, - "disallowSpaceBeforePostfixUnaryOperators": true, - "disallowSpaceBeforeBinaryOperators": [ - "," - ], - "requireSpaceBeforeBinaryOperators": true, - "requireSpaceAfterBinaryOperators": true, - "disallowImplicitTypeConversion": [ - "binary", - "string" - ], - "requireCamelCaseOrUpperCaseIdentifiers": true, - "disallowKeywords": [ - "with" - ], - "disallowMixedSpacesAndTabs": true, - "disallowMultipleLineBreaks": true, - "disallowOperatorBeforeLineBreak": [ - "." - ], - "disallowTrailingWhitespace": true, - "disallowTrailingComma": true, - "disallowKeywordsOnNewLine": [ - "else", - "catch" - ], - "requireLineBreakAfterVariableAssignment": true, - "requireLineFeedAtFileEnd": true, - "requireCapitalizedConstructors": true, - "requireDotNotation": true, - "disallowYodaConditions": true, - "requireSpaceAfterLineComment": true, - "disallowNewlineBeforeBlockStatements": true, - "validateLineBreaks": "LF", - "validateQuoteMarks": "'", - - // - // Rules from wikimedia preset we don't follow - - // "validateIndentation": "\t", - //