Mozilla ESLint Plugin
This is the documentation of Mozilla ESLint PLugin.
Environments
The plugin implements the following environments:
Rules
The plugin implements the following rules:
- avoid-Date-timing
- avoid-removeChild
- balanced-listeners
- balanced-observers
- import-browser-window-globals
- import-content-task-globals
- import-globals
- import-globals-from
- import-headjs-globals
- lazy-getter-object-name
- mark-exported-symbols-as-used
- mark-test-function-used
- no-aArgs
- no-addtask-setup
- no-arbitrary-setTimeout
- no-browser-refs-in-toolkit
- no-compare-against-boolean-literals
- no-comparison-or-assignment-inside-ok
- no-cu-reportError
- no-define-cc-etc
- no-more-globals
- no-redeclare-with-import-autofix
- no-throw-cr-literal
- no-useless-parameters
- no-useless-removeEventListener
- no-useless-run-test
- prefer-boolean-length-check
- prefer-formatValues
- reject-addtask-only
- reject-chromeutils-import
- reject-chromeutils-import-params
- reject-eager-module-in-lazy-getter
- reject-global-this
- reject-globalThis-modification
- reject-import-system-module-from-non-system
- reject-importGlobalProperties
- reject-lazy-imports-into-globals
- reject-mixing-eager-and-lazy
- reject-multiple-await
- reject-multiple-getters-calls
- reject-relative-requires
- reject-requires-await
- reject-scriptableunicodeconverter
- reject-some-requires
- reject-top-level-await
- use-cc-etc
- use-chromeutils-definelazygetter
- use-chromeutils-generateqi
- use-chromeutils-import
- use-console-createInstance
- use-default-preference-values
- use-includes-instead-of-indexOf
- use-isInstance
- use-ownerGlobal
- use-returnValue
- use-services
- use-static-import
- valid-ci-uses
- valid-lazy
- valid-services
- valid-services-property
- var-only-at-top-level
Tests
The tests for eslint-plugin-mozilla are run via mochajs on top of node. Most of the tests use the ESLint Rule Unit Test framework.
Running Tests
The tests for eslint-plugin-mozilla are run via mochajs on top of node. Most of the tests use the ESLint Rule Unit Test framework.
The rules have some self tests, these can be run via:
$ cd tools/lint/eslint/eslint-plugin-mozilla
$ npm install
$ npm run test
Disabling tests
In the unlikely event of needing to disable a test, currently the only way is by commenting-out. Please file a bug if you have to do this. Bugs should be filed in the Testing product under Lint.