summaryrefslogtreecommitdiffstats
path: root/docs/code-quality/lint/linters/eslint-plugin-mozilla/environment.rst
blob: 2c779410d6ba2655968928372a250349f093b278 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
Environment
===========

These environments are available by specifying a comment at the top of the file,
e.g.

.. code-block:: js

   /* eslint-env mozilla/chrome-worker */

There are also built-in ESLint environments available as well. Find them here: http://eslint.org/docs/user-guide/configuring#specifying-environments

browser-window
--------------

Defines the environment for scripts that are in the main browser.xhtml scope.

chrome-script
-------------

Defines the environment for scripts loaded by
``SpecialPowers.loadChromeScript``.

chrome-worker
-------------

Defines the environment for chrome workers. This differs from normal workers by
the fact that `ctypes` can be accessed as well.

frame-script
------------

Defines the environment for scripts loaded by ``Services.mm.loadFrameScript``.

jsm
---

Defines the environment for jsm files (javascript modules).

privileged
----------

Defines the environment for privileged JS files.

process-script
--------------

Defines the environment for scripts loaded by
``Services.ppmm.loadProcessScript``.

remote-page
-----------

Defines the environment for scripts loaded with ``<script src="...">`` in
``about:`` pages.

simpletest
----------

Defines the environment for scripts that use the SimpleTest mochitest harness.

sjs
---

Defines the environment for sjs files.

special-powers-sandbox
----------------------

Defines the environment for scripts evaluated inside ``SpecialPowers`` sandbox
with the default options.

xpcshell
--------

Defines the environment for xpcshell test files.