1
0
Fork 0
firefox/docs/code-quality/lint/linters/eslint-plugin-mozilla/rules/import-globals-from.rst
Daniel Baumann 5e9a113729
Adding upstream version 140.0.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
2025-06-25 09:37:52 +02:00

18 lines
695 B
ReStructuredText

import-globals-from
===================
Parses a file for globals defined in various unique Mozilla ways.
When a ``/* import-globals-from <path> */`` comment is found in a file, then all
globals from the file at <path> will be imported in the current scope. This will
also operate recursively.
This is useful for scripts that are loaded as <script> tag in a window and rely
on each other's globals.
If <path> is a relative path, then it must be relative to the file being
checked by the rule.
Note: ``import-globals-from`` does not support loading globals from ES modules.
These should be imported as variable definitions directly, or the file where
they are imported should be referenced.