I have just landed a change that helps ESLint to automatically detect globals for loadSubScript <https://bugzilla.mozilla.org/show_bug.cgi?id=1812977> when importing test files.

Previously you may have had to write a line to tell ESLint to import the file, e.g.

/* import-globals-from ../../../gfx/layers/apz/test/mochitest/apz_test_native_event_utils.js */

Services.scriptloader.loadSubScript(
"chrome://mochitests/content/browser/gfx/layers/apz/test/mochitest/apz_test_utils.js",
  this
);

No more! Now you can simply call loadSubScript:

Services.scriptloader.loadSubScript(
"chrome://mochitests/content/browser/gfx/layers/apz/test/mochitest/apz_test_utils.js",
  this
);


For urls starting with chrome://mochitests/content/browser/, our ESLint setup will now automatically find the source file and load the relevant global variables.

The patches I have just landed also clean up all (that I can find) the existing instances of import-globals-from that are now unnecessary.

Mark

--
You received this message because you are subscribed to the Google Groups 
"[email protected]" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/a/mozilla.org/d/msgid/dev-platform/614bef4e-7cb6-1da2-2da5-252cf7f8db71%40mozilla.com.

Reply via email to