From 5f8de423f190bbb79a62f804151bc24824fa32d8 Mon Sep 17 00:00:00 2001 From: "Matt A. Tobin" Date: Fri, 2 Feb 2018 04:16:08 -0500 Subject: Add m-esr52 at 52.6.0 --- tools/lint/docs/Makefile | 192 ++++++ tools/lint/docs/conf.py | 112 ++++ tools/lint/docs/create.rst | 153 +++++ tools/lint/docs/index.rst | 37 ++ tools/lint/docs/linters/eslint-plugin-mozilla.rst | 174 +++++ tools/lint/docs/linters/eslint.rst | 45 ++ tools/lint/docs/linters/flake8.rst | 50 ++ tools/lint/docs/make.bat | 263 ++++++++ tools/lint/docs/usage.rst | 41 ++ tools/lint/eslint.lint | 368 +++++++++++ tools/lint/eslint/eslint-plugin-mozilla/LICENSE | 363 +++++++++++ .../eslint/eslint-plugin-mozilla/lib/globals.js | 188 ++++++ .../eslint/eslint-plugin-mozilla/lib/helpers.js | 524 +++++++++++++++ .../lint/eslint/eslint-plugin-mozilla/lib/index.js | 45 ++ .../lib/processors/xbl-bindings.js | 363 +++++++++++ .../eslint-plugin-mozilla/lib/rules/.eslintrc.js | 51 ++ .../lib/rules/balanced-listeners.js | 113 ++++ .../lib/rules/import-browserjs-globals.js | 83 +++ .../lib/rules/import-globals.js | 15 + .../lib/rules/import-headjs-globals.js | 49 ++ .../lib/rules/mark-test-function-used.js | 37 ++ .../eslint-plugin-mozilla/lib/rules/no-aArgs.js | 55 ++ .../lib/rules/no-cpows-in-tests.js | 112 ++++ .../lib/rules/no-single-arg-cu-import.js | 39 ++ .../lib/rules/reject-importGlobalProperties.js | 37 ++ .../lib/rules/reject-some-requires.js | 48 ++ .../lib/rules/var-only-at-top-level.js | 34 + .../lint/eslint/eslint-plugin-mozilla/package.json | 29 + tools/lint/eslint/manifest.tt | 9 + tools/lint/eslint/modules.json | 247 +++++++ tools/lint/eslint/npm-shrinkwrap.json | 718 +++++++++++++++++++++ tools/lint/eslint/package.json | 16 + tools/lint/eslint/update | 70 ++ tools/lint/flake8.lint | 195 ++++++ tools/lint/flake8/flake8_requirements.txt | 4 + tools/lint/mach_commands.py | 62 ++ tools/lint/wpt.lint | 55 ++ tools/lint/wpt_manifest.lint | 34 + 38 files changed, 5030 insertions(+) create mode 100644 tools/lint/docs/Makefile create mode 100644 tools/lint/docs/conf.py create mode 100644 tools/lint/docs/create.rst create mode 100644 tools/lint/docs/index.rst create mode 100644 tools/lint/docs/linters/eslint-plugin-mozilla.rst create mode 100644 tools/lint/docs/linters/eslint.rst create mode 100644 tools/lint/docs/linters/flake8.rst create mode 100644 tools/lint/docs/make.bat create mode 100644 tools/lint/docs/usage.rst create mode 100644 tools/lint/eslint.lint create mode 100644 tools/lint/eslint/eslint-plugin-mozilla/LICENSE create mode 100644 tools/lint/eslint/eslint-plugin-mozilla/lib/globals.js create mode 100644 tools/lint/eslint/eslint-plugin-mozilla/lib/helpers.js create mode 100644 tools/lint/eslint/eslint-plugin-mozilla/lib/index.js create mode 100644 tools/lint/eslint/eslint-plugin-mozilla/lib/processors/xbl-bindings.js create mode 100644 tools/lint/eslint/eslint-plugin-mozilla/lib/rules/.eslintrc.js create mode 100644 tools/lint/eslint/eslint-plugin-mozilla/lib/rules/balanced-listeners.js create mode 100644 tools/lint/eslint/eslint-plugin-mozilla/lib/rules/import-browserjs-globals.js create mode 100644 tools/lint/eslint/eslint-plugin-mozilla/lib/rules/import-globals.js create mode 100644 tools/lint/eslint/eslint-plugin-mozilla/lib/rules/import-headjs-globals.js create mode 100644 tools/lint/eslint/eslint-plugin-mozilla/lib/rules/mark-test-function-used.js create mode 100644 tools/lint/eslint/eslint-plugin-mozilla/lib/rules/no-aArgs.js create mode 100644 tools/lint/eslint/eslint-plugin-mozilla/lib/rules/no-cpows-in-tests.js create mode 100644 tools/lint/eslint/eslint-plugin-mozilla/lib/rules/no-single-arg-cu-import.js create mode 100644 tools/lint/eslint/eslint-plugin-mozilla/lib/rules/reject-importGlobalProperties.js create mode 100644 tools/lint/eslint/eslint-plugin-mozilla/lib/rules/reject-some-requires.js create mode 100644 tools/lint/eslint/eslint-plugin-mozilla/lib/rules/var-only-at-top-level.js create mode 100644 tools/lint/eslint/eslint-plugin-mozilla/package.json create mode 100644 tools/lint/eslint/manifest.tt create mode 100644 tools/lint/eslint/modules.json create mode 100644 tools/lint/eslint/npm-shrinkwrap.json create mode 100644 tools/lint/eslint/package.json create mode 100755 tools/lint/eslint/update create mode 100644 tools/lint/flake8.lint create mode 100644 tools/lint/flake8/flake8_requirements.txt create mode 100644 tools/lint/mach_commands.py create mode 100644 tools/lint/wpt.lint create mode 100644 tools/lint/wpt_manifest.lint (limited to 'tools/lint') diff --git a/tools/lint/docs/Makefile b/tools/lint/docs/Makefile new file mode 100644 index 000000000..1d97fa065 --- /dev/null +++ b/tools/lint/docs/Makefile @@ -0,0 +1,192 @@ +# Makefile for Sphinx documentation +# + +# You can set these variables from the command line. +SPHINXOPTS = +SPHINXBUILD = sphinx-build +PAPER = +BUILDDIR = _build + +# User-friendly check for sphinx-build +ifeq ($(shell which $(SPHINXBUILD) >/dev/null 2>&1; echo $$?), 1) +$(error The '$(SPHINXBUILD)' command was not found. Make sure you have Sphinx installed, then set the SPHINXBUILD environment variable to point to the full path of the '$(SPHINXBUILD)' executable. Alternatively you can add the directory with the executable to your PATH. If you don't have Sphinx installed, grab it from http://sphinx-doc.org/) +endif + +# Internal variables. +PAPEROPT_a4 = -D latex_paper_size=a4 +PAPEROPT_letter = -D latex_paper_size=letter +ALLSPHINXOPTS = -d $(BUILDDIR)/doctrees $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) . +# the i18n builder cannot share the environment and doctrees with the others +I18NSPHINXOPTS = $(PAPEROPT_$(PAPER)) $(SPHINXOPTS) . + +.PHONY: help clean html dirhtml singlehtml pickle json htmlhelp qthelp devhelp epub latex latexpdf text man changes linkcheck doctest coverage gettext + +help: + @echo "Please use \`make ' where is one of" + @echo " html to make standalone HTML files" + @echo " dirhtml to make HTML files named index.html in directories" + @echo " singlehtml to make a single large HTML file" + @echo " pickle to make pickle files" + @echo " json to make JSON files" + @echo " htmlhelp to make HTML files and a HTML help project" + @echo " qthelp to make HTML files and a qthelp project" + @echo " applehelp to make an Apple Help Book" + @echo " devhelp to make HTML files and a Devhelp project" + @echo " epub to make an epub" + @echo " latex to make LaTeX files, you can set PAPER=a4 or PAPER=letter" + @echo " latexpdf to make LaTeX files and run them through pdflatex" + @echo " latexpdfja to make LaTeX files and run them through platex/dvipdfmx" + @echo " text to make text files" + @echo " man to make manual pages" + @echo " texinfo to make Texinfo files" + @echo " info to make Texinfo files and run them through makeinfo" + @echo " gettext to make PO message catalogs" + @echo " changes to make an overview of all changed/added/deprecated items" + @echo " xml to make Docutils-native XML files" + @echo " pseudoxml to make pseudoxml-XML files for display purposes" + @echo " linkcheck to check all external links for integrity" + @echo " doctest to run all doctests embedded in the documentation (if enabled)" + @echo " coverage to run coverage check of the documentation (if enabled)" + +clean: + rm -rf $(BUILDDIR)/* + +html: + $(SPHINXBUILD) -b html $(ALLSPHINXOPTS) $(BUILDDIR)/html + @echo + @echo "Build finished. The HTML pages are in $(BUILDDIR)/html." + +dirhtml: + $(SPHINXBUILD) -b dirhtml $(ALLSPHINXOPTS) $(BUILDDIR)/dirhtml + @echo + @echo "Build finished. The HTML pages are in $(BUILDDIR)/dirhtml." + +singlehtml: + $(SPHINXBUILD) -b singlehtml $(ALLSPHINXOPTS) $(BUILDDIR)/singlehtml + @echo + @echo "Build finished. The HTML page is in $(BUILDDIR)/singlehtml." + +pickle: + $(SPHINXBUILD) -b pickle $(ALLSPHINXOPTS) $(BUILDDIR)/pickle + @echo + @echo "Build finished; now you can process the pickle files." + +json: + $(SPHINXBUILD) -b json $(ALLSPHINXOPTS) $(BUILDDIR)/json + @echo + @echo "Build finished; now you can process the JSON files." + +htmlhelp: + $(SPHINXBUILD) -b htmlhelp $(ALLSPHINXOPTS) $(BUILDDIR)/htmlhelp + @echo + @echo "Build finished; now you can run HTML Help Workshop with the" \ + ".hhp project file in $(BUILDDIR)/htmlhelp." + +qthelp: + $(SPHINXBUILD) -b qthelp $(ALLSPHINXOPTS) $(BUILDDIR)/qthelp + @echo + @echo "Build finished; now you can run "qcollectiongenerator" with the" \ + ".qhcp project file in $(BUILDDIR)/qthelp, like this:" + @echo "# qcollectiongenerator $(BUILDDIR)/qthelp/mozlint.qhcp" + @echo "To view the help file:" + @echo "# assistant -collectionFile $(BUILDDIR)/qthelp/mozlint.qhc" + +applehelp: + $(SPHINXBUILD) -b applehelp $(ALLSPHINXOPTS) $(BUILDDIR)/applehelp + @echo + @echo "Build finished. The help book is in $(BUILDDIR)/applehelp." + @echo "N.B. You won't be able to view it unless you put it in" \ + "~/Library/Documentation/Help or install it in your application" \ + "bundle." + +devhelp: + $(SPHINXBUILD) -b devhelp $(ALLSPHINXOPTS) $(BUILDDIR)/devhelp + @echo + @echo "Build finished." + @echo "To view the help file:" + @echo "# mkdir -p $$HOME/.local/share/devhelp/mozlint" + @echo "# ln -s $(BUILDDIR)/devhelp $$HOME/.local/share/devhelp/mozlint" + @echo "# devhelp" + +epub: + $(SPHINXBUILD) -b epub $(ALLSPHINXOPTS) $(BUILDDIR)/epub + @echo + @echo "Build finished. The epub file is in $(BUILDDIR)/epub." + +latex: + $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex + @echo + @echo "Build finished; the LaTeX files are in $(BUILDDIR)/latex." + @echo "Run \`make' in that directory to run these through (pdf)latex" \ + "(use \`make latexpdf' here to do that automatically)." + +latexpdf: + $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex + @echo "Running LaTeX files through pdflatex..." + $(MAKE) -C $(BUILDDIR)/latex all-pdf + @echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex." + +latexpdfja: + $(SPHINXBUILD) -b latex $(ALLSPHINXOPTS) $(BUILDDIR)/latex + @echo "Running LaTeX files through platex and dvipdfmx..." + $(MAKE) -C $(BUILDDIR)/latex all-pdf-ja + @echo "pdflatex finished; the PDF files are in $(BUILDDIR)/latex." + +text: + $(SPHINXBUILD) -b text $(ALLSPHINXOPTS) $(BUILDDIR)/text + @echo + @echo "Build finished. The text files are in $(BUILDDIR)/text." + +man: + $(SPHINXBUILD) -b man $(ALLSPHINXOPTS) $(BUILDDIR)/man + @echo + @echo "Build finished. The manual pages are in $(BUILDDIR)/man." + +texinfo: + $(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo + @echo + @echo "Build finished. The Texinfo files are in $(BUILDDIR)/texinfo." + @echo "Run \`make' in that directory to run these through makeinfo" \ + "(use \`make info' here to do that automatically)." + +info: + $(SPHINXBUILD) -b texinfo $(ALLSPHINXOPTS) $(BUILDDIR)/texinfo + @echo "Running Texinfo files through makeinfo..." + make -C $(BUILDDIR)/texinfo info + @echo "makeinfo finished; the Info files are in $(BUILDDIR)/texinfo." + +gettext: + $(SPHINXBUILD) -b gettext $(I18NSPHINXOPTS) $(BUILDDIR)/locale + @echo + @echo "Build finished. The message catalogs are in $(BUILDDIR)/locale." + +changes: + $(SPHINXBUILD) -b changes $(ALLSPHINXOPTS) $(BUILDDIR)/changes + @echo + @echo "The overview file is in $(BUILDDIR)/changes." + +linkcheck: + $(SPHINXBUILD) -b linkcheck $(ALLSPHINXOPTS) $(BUILDDIR)/linkcheck + @echo + @echo "Link check complete; look for any errors in the above output " \ + "or in $(BUILDDIR)/linkcheck/output.txt." + +doctest: + $(SPHINXBUILD) -b doctest $(ALLSPHINXOPTS) $(BUILDDIR)/doctest + @echo "Testing of doctests in the sources finished, look at the " \ + "results in $(BUILDDIR)/doctest/output.txt." + +coverage: + $(SPHINXBUILD) -b coverage $(ALLSPHINXOPTS) $(BUILDDIR)/coverage + @echo "Testing of coverage in the sources finished, look at the " \ + "results in $(BUILDDIR)/coverage/python.txt." + +xml: + $(SPHINXBUILD) -b xml $(ALLSPHINXOPTS) $(BUILDDIR)/xml + @echo + @echo "Build finished. The XML files are in $(BUILDDIR)/xml." + +pseudoxml: + $(SPHINXBUILD) -b pseudoxml $(ALLSPHINXOPTS) $(BUILDDIR)/pseudoxml + @echo + @echo "Build finished. The pseudo-XML files are in $(BUILDDIR)/pseudoxml." diff --git a/tools/lint/docs/conf.py b/tools/lint/docs/conf.py new file mode 100644 index 000000000..31ebb6dcc --- /dev/null +++ b/tools/lint/docs/conf.py @@ -0,0 +1,112 @@ +# -*- coding: utf-8 -*- +# +# mozlint documentation build configuration file, created by +# sphinx-quickstart on Fri Nov 27 17:38:49 2015. +# +# This file is execfile()d with the current directory set to its +# containing dir. + +import os + +# -- General configuration ------------------------------------------------ + +# Add any Sphinx extension module names here, as strings. They can be +# extensions coming with Sphinx (named 'sphinx.ext.*') or your custom +# ones. +extensions = [ + 'sphinx.ext.autodoc', + 'sphinx.ext.intersphinx', +] + +# Add any paths that contain templates here, relative to this directory. +templates_path = ['_templates'] + +# The suffix(es) of source filenames. +# You can specify multiple suffix as a list of string: +# source_suffix = ['.rst', '.md'] +source_suffix = '.rst' + +# The master toctree document. +master_doc = 'index' + +# General information about the project. +project = u'mozlint' +copyright = u'2015, Andrew Halberstadt' +author = u'Andrew Halberstadt' + +# The short X.Y version. +version = '0.1.0' +# The full version, including alpha/beta/rc tags. +release = '0.1.0' + +# This is also used if you do content translation via gettext catalogs. +# Usually you set "language" from the command line for these cases. +language = None + +# List of patterns, relative to source directory, that match files and +# directories to ignore when looking for source files. +exclude_patterns = ['_build'] + +# The name of the Pygments (syntax highlighting) style to use. +pygments_style = 'sphinx' + +# If true, `todo` and `todoList` produce output, else they produce nothing. +todo_include_todos = False + + +# -- Options for HTML output ---------------------------------------------- + +# The theme to use for HTML and HTML Help pages. See the documentation for +# a list of builtin themes. +html_theme = 'default' + +if os.environ.get('READTHEDOCS', None) != 'True': + try: + import sphinx_rtd_theme + html_theme = 'sphinx_rtd_theme' + html_theme_path = [sphinx_rtd_theme.get_html_theme_path()] + except ImportError: + pass + +# Add any paths that contain custom static files (such as style sheets) here, +# relative to this directory. They are copied after the builtin static files, +# so a file named "default.css" will overwrite the builtin "default.css". +html_static_path = ['_static'] + +# Output file base name for HTML help builder. +htmlhelp_basename = 'mozlintdoc' + +# -- Options for LaTeX output --------------------------------------------- + +latex_elements = {} + +# Grouping the document tree into LaTeX files. List of tuples +# (source start file, target name, title, +# author, documentclass [howto, manual, or own class]). +latex_documents = [ + (master_doc, 'mozlint.tex', u'mozlint Documentation', + u'Andrew Halberstadt', 'manual'), +] + +# -- Options for manual page output --------------------------------------- + +# One entry per manual page. List of tuples +# (source start file, name, description, authors, manual section). +man_pages = [ + (master_doc, 'mozlint', u'mozlint Documentation', + [author], 1) +] + +# -- Options for Texinfo output ------------------------------------------- + +# Grouping the document tree into Texinfo files. List of tuples +# (source start file, target name, title, author, +# dir menu entry, description, category) +texinfo_documents = [ + (master_doc, 'mozlint', u'mozlint Documentation', + author, 'mozlint', 'One line description of project.', + 'Miscellaneous'), +] + +# Example configuration for intersphinx: refer to the Python standard library. +intersphinx_mapping = {'https://docs.python.org/': None} diff --git a/tools/lint/docs/create.rst b/tools/lint/docs/create.rst new file mode 100644 index 000000000..a132417a8 --- /dev/null +++ b/tools/lint/docs/create.rst @@ -0,0 +1,153 @@ +Adding a New Linter to the Tree +=============================== + +A linter is a python file with a ``.lint`` extension and a global dict called LINTER. Depending on how +complex it is, there may or may not be any actual python code alongside the LINTER definition. + +Here's a trivial example: + +no-eval.lint + +.. code-block:: python + + LINTER = { + 'name': 'EvalLinter', + 'description': "Ensures the string 'eval' doesn't show up." + 'include': "**/*.js", + 'type': 'string', + 'payload': 'eval', + } + +Now ``no-eval.lint`` gets passed into :func:`LintRoller.read`. + + +Linter Types +------------ + +There are three types of linters, though more may be added in the future. + +1. string - fails if substring is found +2. regex - fails if regex matches +3. external - fails if a python function returns a non-empty result list +4. structured_log - fails if a mozlog logger emits any lint_error or lint_warning log messages + +As seen from the example above, string and regex linters are very easy to create, but they +should be avoided if possible. It is much better to use a context aware linter for the language you +are trying to lint. For example, use eslint to lint JavaScript files, use flake8 to lint python +files, etc. + +Which brings us to the third and most interesting type of linter, +external. External linters call an arbitrary python function which is +responsible for not only running the linter, but ensuring the results +are structured properly. For example, an external type could shell out +to a 3rd party linter, collect the output and format it into a list of +:class:`ResultContainer` objects. The signature for this python +function is ``lint(files, **kwargs)``, where ``files`` is a list of +files to lint. + +Structured log linters are much like external linters, but suitable +for cases where the linter code is using mozlog and emits +``lint_error`` or ``lint_warning`` logging messages when the lint +fails. This is recommended for writing novel gecko-specific lints. In +this case the signature for lint functions is ``lint(files, logger, +**kwargs)``. + +LINTER Definition +----------------- + +Each ``.lint`` file must have a variable called LINTER which is a dict containing metadata about the +linter. Here are the supported keys: + +* name - The name of the linter (required) +* description - A brief description of the linter's purpose (required) +* type - One of 'string', 'regex' or 'external' (required) +* payload - The actual linting logic, depends on the type (required) +* include - A list of glob patterns that must be matched (optional) +* exclude - A list of glob patterns that must not be matched (optional) +* extensions - A list of file extensions to be considered (optional) +* setup - A function that sets up external dependencies (optional) + +In addition to the above, some ``.lint`` files correspond to a single lint rule. For these, the +following additional keys may be specified: + +* message - A string to print on infraction (optional) +* hint - A string with a clue on how to fix the infraction (optional) +* rule - An id string for the lint rule (optional) +* level - The severity of the infraction, either 'error' or 'warning' (optional) + +For structured_log lints the following additional keys apply: + +* logger - A StructuredLog object to use for logging. If not supplied + one will be created (optional) + +Example +------- + +Here is an example of an external linter that shells out to the python flake8 linter: + +.. code-block:: python + + import json + import os + import subprocess + from collections import defaultdict + + from mozlint import result + + + FLAKE8_NOT_FOUND = """ + Could not find flake8! Install flake8 and try again. + """.strip() + + + def lint(files, **lintargs): + import which + + binary = os.environ.get('FLAKE8') + if not binary: + try: + binary = which.which('flake8') + except which.WhichError: + print(FLAKE8_NOT_FOUND) + return 1 + + # Flake8 allows passing in a custom format string. We use + # this to help mold the default flake8 format into what + # mozlint's ResultContainer object expects. + cmdargs = [ + binary, + '--format', + '{"path":"%(path)s","lineno":%(row)s,"column":%(col)s,"rule":"%(code)s","message":"%(text)s"}', + ] + files + + proc = subprocess.Popen(cmdargs, stdout=subprocess.PIPE, env=os.environ) + output = proc.communicate()[0] + + # all passed + if not output: + return [] + + results = [] + for line in output.splitlines(): + # res is a dict of the form specified by --format above + res = json.loads(line) + + # parse level out of the id string + if 'code' in res and res['code'].startswith('W'): + res['level'] = 'warning' + + # result.from_linter is a convenience method that + # creates a ResultContainer using a LINTER definition + # to populate some defaults. + results.append(result.from_linter(LINTER, **res)) + + return results + + + LINTER = { + 'name': "flake8", + 'description': "Python linter", + 'include': ['**/*.py'], + 'type': 'external', + 'payload': lint, + } diff --git a/tools/lint/docs/index.rst b/tools/lint/docs/index.rst new file mode 100644 index 000000000..54bc404a3 --- /dev/null +++ b/tools/lint/docs/index.rst @@ -0,0 +1,37 @@ +Linting +======= + +Linters are used in mozilla-central to help enforce coding style and avoid bad practices. Due to the +wide variety of languages in use and the varying style preferences per team, this is not an easy +task. In addition, linters should be runnable from editors, from the command line, from review tools +and from continuous integration. It's easy to see how the complexity of running all of these +different kinds of linters in all of these different places could quickly balloon out of control. + +``Mozlint`` is a library that accomplishes two goals: + +1. It provides a standard method for adding new linters to the tree, which can be as easy as + defining a json object in a ``.lint`` file. This helps keep lint related code localized, and + prevents different teams from coming up with their own unique lint implementations. +2. It provides a streamlined interface for running all linters at once. Instead of running N + different lint commands to test your patch, a single ``mach lint`` command will automatically run + all applicable linters. This means there is a single API surface that other tools can use to + invoke linters. + +``Mozlint`` isn't designed to be used directly by end users. Instead, it can be consumed by things +like mach, mozreview and taskcluster. + +.. toctree:: + :caption: Linting User Guide + :maxdepth: 2 + + usage + create + linters/eslint + linters/flake8 + +Indices and tables +================== + +* :ref:`genindex` +* :ref:`modindex` +* :ref:`search` diff --git a/tools/lint/docs/linters/eslint-plugin-mozilla.rst b/tools/lint/docs/linters/eslint-plugin-mozilla.rst new file mode 100644 index 000000000..e75864238 --- /dev/null +++ b/tools/lint/docs/linters/eslint-plugin-mozilla.rst @@ -0,0 +1,174 @@ +===================== +Mozilla ESLint Plugin +===================== + + +balanced-listeners +------------------ + +Checks that for every occurence of 'addEventListener' or 'on' there is an +occurence of 'removeEventListener' or 'off' with the same event name. + + +components-imports +------------------ + +Checks the filename of imported files e.g. ``Cu.import("some/path/Blah.jsm")`` +adds Blah to the global scope. + + +import-browserjs-globals +------------------------ + +When included files from the main browser UI scripts will be loaded and any +declared globals will be defined for the current file. This is mostly useful for +browser-chrome mochitests that call browser functions. + + +import-globals-from +------------------- + +Parses a file for globals defined in various unique Mozilla ways. + +When a "import-globals-from " comment is found in a file, then all globals +from the file at will be imported in the current scope. This will also +operate recursively. + +This is useful for scripts that are loaded as