mediawiki-skins-MinervaNeue/resources/skins.minerva.scripts
Stephen Niedzielski 874d9c9e3b Hygiene: update JSDoc boxed and JQuery types
From TypeScript's do's and don'ts:[0]

  Don’t ever use the types Number, String, Boolean, or Object. These
  types refer to non-primitive boxed objects that are almost never used
  appropriately in JavaScript code.

Although Minerva only uses JSDocs at this time which seemingly doesn't
care about casing[1], we should endeavor to use the proper return types.

This patch lowercases typing to indicate primitive / boxed type as
appropriate.[2] As a special case, function types are uppercased for
compatibility with TypeScript type checking.

Also, JQuery types are of type "JQuery". The global JQuery object's
identifier is "jQuery". This patch uppercases J's where appropriate.

Lastly, replace unsupported type "Integer" with "number" and a comment.

[0] https://www.typescriptlang.org/docs/handbook/declaration-files/do-s-and-don-ts.html#general-types

[1] https://github.com/jsdoc3/jsdoc/issues/1046#issuecomment-126477791

[2] find resources tests -iname \*.js|
    xargs -rd\\n sed -ri '
      s%\{\s*(number|string|boolean|object|null|undefined)%{\L\1%gi;
      s%\{\s*function%{Function%g;
      s%\{\s*jquery%{JQuery%gi;
      s%\{\s*integer\s*\}%{number} An integer.%gi
    '

Change-Id: I6cbac15940e4501aee7ede8f421b77ffd027170d
2018-07-03 11:10:12 -05:00
..
AB.js A/B test bucketing wrapper for page issues AB. 2018-06-13 15:43:08 -07:00
cleanuptemplates.js Hygiene: update JSDoc boxed and JQuery types 2018-07-03 11:10:12 -05:00
DownloadIcon.js Hygiene: update JSDoc boxed and JQuery types 2018-07-03 11:10:12 -05:00
init.js Hygiene: update JSDoc boxed and JQuery types 2018-07-03 11:10:12 -05:00
initLogging.js Hygiene: Cleanup initialisation files 2017-09-07 17:48:58 +00:00
mobileRedirect.js Minerva is its own skin 2017-07-12 08:12:40 -07:00
preInit.js Hygiene: update JSDoc boxed and JQuery types 2018-07-03 11:10:12 -05:00
references.js Hygiene: update JSDoc boxed and JQuery types 2018-07-03 11:10:12 -05:00
search.js Use OverlayManager for SearchOverlay 2018-04-05 15:23:36 +02:00
styles.less Remove minerva.less from global import path 2018-05-29 12:19:00 +00:00
utils.js Hygiene: update JSDoc boxed and JQuery types 2018-07-03 11:10:12 -05:00