Commit graph

8 commits

Author SHA1 Message Date
joakin 4ca333e577 Remove jshint/jscs, add eslint and stylelint
...with the wikimedia presets.

For automatically fixing most of the JS lint problems run

      grunt eslint:fix

Some rules of stylelint were disabled given they cause problems with
existing popups code (like no id selectors for example).

Change-Id: I2153047c3ddbea50572dd329989088bb20787515
2016-12-16 13:35:34 +01:00
Sam Smith 9611d3b2db Add LINK_DWELL and LINK_ABANDON actions
Supporting changes:
* Add mw.popups.processLinks.
* Extract the existing unit tests for mw.popups.selectPopupElements and
  mw.popups.getTitle.
* Fix Grunt QUnit timeout.

Change-Id: I325bcb15abc6e0b745d78b7308a346a034ab2988
2016-11-10 11:47:55 +00:00
Sam Smith 19349c0108 Add BOOT action
Changes:
* Make grunt:qunit run all QUnit tests in those modules whose names
  being with "ext.popups".
* Add ext.popups/index.js, which initialises the mw.popups namespace.
* Add ext.popups/userSettings.js, which contains the code that deals
  with interacting with the User Agent's storage.
* Add ext.popups/experiment.js, which contains the code that that
  decides whether or not the user is in the experiment condition.
* Add tests for both units, converting existing tests where appropriate.
* Remove the associated code from ext.popups.core/ext.popups.core.js.
* Finally, dispatch the BOOT action against the store in
  ext.popups/boot.js.

Change-Id: I697207677304bd49c7cfe1d37bb0a4af7810f387
2016-11-09 10:40:59 +00:00
Sam Smith e47fe4d04d Use Redux and Redux Thunk
Changes:
* Create the ext.popups.lib module, which contains redux@3.6.0 and
  redux-thunk@2.1.0.
* Rely on the Resource Loader's minification and mangling (?)
  mechanisms.
* Create an asynchronous bootstrap script, which creates a Redux store
  when the User Agent is idle.

Change-Id: Ib7168217a5673bb2a8378eb30d6aa45043c66e62
2016-11-08 15:33:20 -05:00
jhobs 046d12f51b Update linting and enable command line QUnit
You can use `grunt watch` now!

Changes:
 * Re-enable QUnit (but ignore legacy tests)
 * Add a sample QUnit test
 * Add ability to run QUnit via `grunt watch` or `grunt test`
 * Move linting to `grunt lint` task
 * Add Redux to globals in linter

Change-Id: Ie4a65a8a66773d6472b3d73257267d18027ff3c3
2016-11-08 13:56:17 -05:00
Paladox c8c37b8af4 Update Gruntfile.js
Target all JS files, not just the ones in resources.

Change-Id: I036360365ebbd5e5654b5a74694e2656e63e56e6
2015-10-26 08:49:33 +00:00
Prateek Saxena 6eef4f325b Add jscs and jshint tasks to the Gruntfile
Adds the jscs and jshint packages for development and their tasks in
Grunt. Also fixes all the code convention errors.

Change-Id: If1c9dfdbe22d4912d78b6a51b1292866970a85cc
2015-09-04 13:57:52 +05:30
Kunal Mehta 47d5daf74d build: Configure banana-checker and jsonlint
Change-Id: Id3f1d601f6b99e9646c7a1c6b430b1dd777e952b
2015-06-19 22:09:03 -07:00