Commit graph

18 commits

Author SHA1 Message Date
Nicholas Ray 17a3c4bee0 Remove eslint "valid-jsdoc" rules/fix linting errors
Our eslintrc file extends "wikimedia/client" which already includes all
of the previously listed jsdoc rules [1]. Therefore, we were clobbering
this much more thorough list.

This commit removes this clobbering and enables a much more extensive
list of jsdoc rules. Additionally, downloadPageActions was made to
conform to the rules.

[1] 07320f16ae/common.json (L99-L137)

Bug: T239269
Change-Id: I19c09054ba0bf2746ac78befc1b44426352113ec
2020-02-07 13:59:24 -07:00
Ed Sanders 49dd1fd71a build: Update eslint-config-wikimedia
Change-Id: Ic2148121161b804c3f6f41b9446fcea066f3de0d
2019-10-31 23:08:57 +00:00
jdlrobson ef5003f310 Curtail use of mw.mobileFrontend in Minerva
The MobileFrontend dependency in Minerva is problematic.
Code that Minerva needs should live in core.
MobileFrontend should load code on all skins when they operate on
a mobile domain.
This eslint check reminds developers of this in a hope it encourages
more upstreaming to core when possible.
Of course disabling is also an option, but this check will at least
make us aware of when we are moving further away from the goal.

Change-Id: I62183c9aefc81053e4ad81fb746decef2dd24b44
2019-10-01 14:54:59 +00:00
jdlrobson 72df451bd3 Embrace packageFiles
Help with readability by using module.exports and require rather than the MobileFrontend
provided mw.mobileFrontend module manager (and avoid adopting webpack at this time)

Replace usages of mw.mobileFrontend.require with local require and module.exports
(compatible with RL or Node implementation)

Changes:
* Notifications modules are merged into skins.minerva.scripts and initialised
via a client side check.
* new file overlayManager for exporting an overlayManager singleton
rather than being hidden inside resources/skins.minerva.scripts/init.js
* All M.define/M.requires swapped out for require where possible
The `define` method is now forbidden in the repo.

Bug: T212944
Change-Id: I44790dd3fc6fe42bb502d79c39c4081c223bf2b1
2019-07-16 18:04:10 +00:00
jdlrobson b9862d7d24 skins.minerva.options uses packageFiles
I want to remove the need for M.define in the Minerva repository.
It's no longer necessary with packageFiles and will help tame
a lot of the code we have here!

Change-Id: If6a35a23e84a44adb965fd9c41265ba37eb8368e
2019-07-08 17:22:11 +00:00
Umherirrender 6d957c55e9 Fix indent on json
Bring each key in its own line for better readablity

Change-Id: I4449b976938ded1d6f5c3c05719d8c8d77bd75a7
2019-06-07 21:29:23 +02:00
Stephen Niedzielski 73bfc21977 Hygiene: improve ESLint globals readability
- Drop unused Hogan global.

- Instead of using a confusing and deprecated boolean, specify that
  globals are "readable" / "writable"
  https://eslint.org/docs/user-guide/configuring#specifying-globals

Change-Id: Icbb663d2d9cda5e67e81c38d85b8a75cabb5e52b
2019-02-21 07:54:04 -07:00
Ed Sanders 63ead8075d build: Update eslint-config-wikimedia to 0.10.0
* Add inline exceptions for global selectors
* Exception for $.animate in scrolling code
* Fix $ prefixing in search.js
* Fix repeated selectors in search.js & toc.js
* Disable no-parse-html-literal in tests

Change-Id: Id58fe11d1e09714501a378e4ca7ed9588f02f32d
2019-01-24 17:59:40 +00:00
Ed Sanders 6c53e320bf eslint: Remove exception for computed-property-spacing
Change-Id: Ief22145c02379bdb3d37c96c5e1ef50f0ab519cf
2019-01-24 17:58:36 +00:00
Ed Sanders dc5077dbae build: Update devDependencies
eslint-config-wikimedia   0.8.1  →   0.9.0
 grunt-contrib-watch       1.0.0  →   1.1.0
 grunt-stylelint          0.10.0  →  0.10.1

Change-Id: I3c8ad96f006ab4501e30d0884ae620b30f23fca8
2019-01-24 17:58:36 +00:00
James D. Forrester a44badacc8 eslint: Drop 'dot-notation' rule
Bug: T210552
Change-Id: I23d8923ffe82b766bbfd7505bd05834e3e6d247a
2018-11-28 11:27:23 -08:00
Ed Sanders def03877ce Remove obsolete aliases from closures
Bug: T208951
Change-Id: I7cd5ab010596d964fc0896ed250f40d5b6344f6e
2018-11-16 15:16:25 +00:00
Stephen Niedzielski 27ea969762 Hygiene: limit ESLint inheritance
The project ESLint configuration unintentionally inherited unwanted
configuration from MediaWiki, which allows global jQuery usage. Cap the
project's ESLint hierarchy at the project root.

Change-Id: Iceda39a4eeb492446b952f597af0f153cf345206
2018-10-05 10:22:11 -06:00
jdlrobson 9312f3d1b2 Forbid certain methods with ES6 equivalents
We do this in core and in MobileFrontend. Let's ban some here
too.

Change-Id: I4cc24381ab0b637eb386c93bd0d88fe803db0483
2018-10-01 15:33:46 -07:00
Ed Sanders 04a2b27d7f build: Update linters
This exposes two broken tests:

* #setCount (Eastern Arabic numerals)
* clicking on the product of createBanner() should trigger a custom event

that were previously passing due to buggy assertions.

Change-Id: If18ad1ff9363fff65d3e347c01ce4bc0669b2a0e
2018-09-11 13:42:11 -07:00
jdlrobson af89d945a6 Forbid use of done/always/fail
Bug: T188937
Change-Id: I3279963d9f97a03b49c88f7c549330e3202d727f
2018-08-22 22:59:08 +00:00
jdlrobson 99bc9d8c55 Enforce lowercase jsdoc types
Follow up to I6cbac15940e4501aee7ede8f421b77ffd027170d

Change-Id: I22bcbf1f083451a0f68b692b9a0acc716d11c62c
2018-07-17 08:06:35 -05:00
jdlrobson 2a70a13b69 Add scaffolding for skin
Change-Id: Ie9420dc85f658fa21a1524dca9374cb1e14fcad7
2017-06-01 10:17:24 -07:00