New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

eslint-plugin-mozilla

Package Overview
Dependencies
Maintainers
0
Versions
88
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

eslint-plugin-mozilla

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

  • 4.0.0
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
1.5K
decreased by-24.72%
Maintainers
0
Weekly downloads
 
Created
Source

eslint-plugin-mozilla

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

These are primarily developed and used within the Firefox 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 Mozilla 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 firefox 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

Keywords

FAQs

Package last updated on 19 Oct 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc