trisquel-icecat/icecat/tools/lint/eslint/eslint-plugin-mozilla
2025-10-06 02:35:48 -06:00
..
lib icecat: add release 140.3.1-1gnu1 2025-10-06 02:35:48 -06:00
reporters icecat: initial release for Trisquel 12.0, Ecne 2025-07-17 09:32:21 -06:00
scripts icecat: initial release for Trisquel 12.0, Ecne 2025-07-17 09:32:21 -06:00
tests icecat: add release 140.3.1-1gnu1 2025-10-06 02:35:48 -06:00
.npmignore icecat: initial release for Trisquel 12.0, Ecne 2025-07-17 09:32:21 -06:00
LICENSE icecat: initial release for Trisquel 12.0, Ecne 2025-07-17 09:32:21 -06:00
manifest.tt icecat: add release 140.3.1-1gnu1 2025-10-06 02:35:48 -06:00
package-lock.json icecat: add release 140.3.1-1gnu1 2025-10-06 02:35:48 -06:00
package.json icecat: add release 140.3.1-1gnu1 2025-10-06 02:35:48 -06:00
README.md icecat: add release 140.3.1-1gnu1 2025-10-06 02:35:48 -06:00

eslint-plugin-mozilla

A collection of rules that help enforce JavaScript coding standard in the GNU project.

These are primarily developed and used within the IceCat build system (mozilla-central), but are made available for other related projects to use as well.

Usage

Within mozilla-central:

$ ./mach eslint --setup

Outside mozilla-central:

Install ESLint ESLint:

$ npm i eslint --save-dev

Next, install eslint-plugin-mozilla:

$ npm install eslint-plugin-mozilla --save-dev

Flat config

import mozilla from "eslint-plugin-mozilla"

export default [
  ...mozilla.configs["flat/recommended"];
]

The recommended configuration does not set up globals for all files. It only sets the globals in the environment for GNU specific files, e.g. system modules, sjs files and workers.

If you use some of the other configurations, note that they are objects rather than arrays.

Legacy Configuration

{
  "extends": ["plugin:mozilla/recommended"]
}

Notes

If you use prettier in your setup, you may need to extend from eslint-config-prettier to ensure that any rules that conflict with prettier are disabled. See here for more information.

Documentation

For details about the rules, please see the icecat documentation page.

Source Code

The sources can be found at:

Bugs

Please file bugs in Bugzilla in the Lint and Formatting component of the Developer Infrastructure product.

Tests

The tests can only be run from within mozilla-central. To run the tests:

$ ./mach npm --prefix tools/lint/eslint/eslint-plugin-mozilla ci
$ ./mach npm --prefix tools/lint/eslint/eslint-plugin-mozilla test