summaryrefslogtreecommitdiffstats
path: root/docs/code-quality/lint/linters/eslint-plugin-mozilla/rules/no-more-globals.rst
diff options
context:
space:
mode:
Diffstat (limited to 'docs/code-quality/lint/linters/eslint-plugin-mozilla/rules/no-more-globals.rst')
-rw-r--r--docs/code-quality/lint/linters/eslint-plugin-mozilla/rules/no-more-globals.rst20
1 files changed, 20 insertions, 0 deletions
diff --git a/docs/code-quality/lint/linters/eslint-plugin-mozilla/rules/no-more-globals.rst b/docs/code-quality/lint/linters/eslint-plugin-mozilla/rules/no-more-globals.rst
new file mode 100644
index 0000000000..2cbe7e82ab
--- /dev/null
+++ b/docs/code-quality/lint/linters/eslint-plugin-mozilla/rules/no-more-globals.rst
@@ -0,0 +1,20 @@
+no-more-globals
+===============
+
+This rule is used to discourage people from adding ever more global variables to
+files where the rule is run.
+
+For any file ``example.js`` where the rule is applied, the rule will read
+an allowlist of globals from a sibling ``example.js.globals`` file. The rule
+will warn for any globals defined in ``example.js`` that are not listed in the
+``globals`` file, and will also warn for any items on the allowlist in
+the ``globals`` file that are no longer present in ``example.js``, encouraging
+people to remove them from the ``globals`` list.
+
+If you see errors from this rule about new globals, **do not just add items to
+the allowlist**. Instead, work to find a way to run your code so that it does
+not add to the list of globals.
+
+If you see errors when removing globals, simply remove them from the allowlist
+to make sure it is up-to-date and things do not inadvertently end up getting
+put back in.