Catrope has submitted this change and it was merged. Change subject: WikiEditor: Linting and conventions ......................................................................
WikiEditor: Linting and conventions * Code clean up in preparation for enabling linting in the future * Update code to use latest code conventions and best practices: - Make use of jQuery.Event (e.g. no need to check both e.keyCode and e.which) - jQuery: .size() -> .length - jQuery: (where appropiate) .attr() -> .prop() Setting properties like 'checked' via attr() has been deprecated in jQuery. - Whitespace - Single quotes instead of double quotes - Use literal keys in object literals instead of strings - Pass mediaWiki to closure, use mw. locally instead of "mediaWiki" global directly. - Fix indentation - Brackets around if, else and for bodies - Strict comparison to 0, null, false, true etc. - Fix missing radix parameter in parseInt - Use local $ instead of global $ - Use `foo || bar` instead of `foo ? foo : bar` - Variable scope hoisting - Double/redundant variable declarations - ['foo'] is better written in dot notation - New line at EOF - Consistency in jQuery construction: Tag name for element creation $( '<div>' ) Valid html for html parsing $( '<div foo="bar"></div>' ) - Fix regex escape warnings per JSLint/JSHint. Do escape ][, don't escape >< - .. * Add .jshintrc / .jshintignore * Updated most files, but not all. Too much at once. Change-Id: I445639b25a9688b3cdf9e5449e3d31cbcfa9c7ae --- A .jshintignore A .jshintrc M modules/ext.wikiEditor.css M modules/ext.wikiEditor.dialogs.js M modules/ext.wikiEditor.templateEditor.js M modules/ext.wikiEditor.templates.js M modules/ext.wikiEditor.tests.toolbar.js M modules/jquery.wikiEditor.dialogs.config.js M modules/jquery.wikiEditor.dialogs.css M modules/jquery.wikiEditor.dialogs.js M modules/jquery.wikiEditor.highlight.js M modules/jquery.wikiEditor.js M modules/jquery.wikiEditor.preview.css M modules/jquery.wikiEditor.preview.js M modules/jquery.wikiEditor.previewDialog.css M modules/jquery.wikiEditor.publish.js M modules/jquery.wikiEditor.toc.css M modules/jquery.wikiEditor.toc.js M modules/jquery.wikiEditor.toolbar.css 19 files changed, 2,106 insertions(+), 1,948 deletions(-) Approvals: Catrope: Verified; Looks good to me, approved -- To view, visit https://gerrit.wikimedia.org/r/14014 To unsubscribe, visit https://gerrit.wikimedia.org/r/settings Gerrit-MessageType: merged Gerrit-Change-Id: I445639b25a9688b3cdf9e5449e3d31cbcfa9c7ae Gerrit-PatchSet: 2 Gerrit-Project: mediawiki/extensions/WikiEditor Gerrit-Branch: master Gerrit-Owner: Krinkle <[email protected]> Gerrit-Reviewer: Catrope <[email protected]> Gerrit-Reviewer: Krinkle <[email protected]> Gerrit-Reviewer: Nikerabbit <[email protected]> Gerrit-Reviewer: Trevor Parscal <[email protected]> _______________________________________________ MediaWiki-commits mailing list [email protected] https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits
