summaryrefslogtreecommitdiffstats
path: root/tools/lint/eslint/eslint-plugin-mozilla/lib/environments/jsm.js
diff options
context:
space:
mode:
Diffstat (limited to 'tools/lint/eslint/eslint-plugin-mozilla/lib/environments/jsm.js')
-rw-r--r--tools/lint/eslint/eslint-plugin-mozilla/lib/environments/jsm.js24
1 files changed, 24 insertions, 0 deletions
diff --git a/tools/lint/eslint/eslint-plugin-mozilla/lib/environments/jsm.js b/tools/lint/eslint/eslint-plugin-mozilla/lib/environments/jsm.js
new file mode 100644
index 0000000000..858494b8d4
--- /dev/null
+++ b/tools/lint/eslint/eslint-plugin-mozilla/lib/environments/jsm.js
@@ -0,0 +1,24 @@
+/**
+ * @fileoverview Defines the environment for jsm files.
+ *
+ * This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/.
+ */
+
+"use strict";
+
+module.exports = {
+ globals: {
+ // These globals are hard-coded and available in .jsm scopes.
+ // https://searchfox.org/mozilla-central/rev/ed212c79cfe86357e9a5740082b9364e7f6e526f/js/xpconnect/loader/mozJSComponentLoader.cpp#134-140
+ atob: false,
+ btoa: false,
+ debug: false,
+ dump: false,
+ // The WebAssembly global is available in most (if not all) contexts where
+ // JS can run. It's definitely available in JSMs. So even if this is not
+ // the perfect place to add it, it's not wrong, and we can move it later.
+ WebAssembly: false,
+ },
+};