gecko-dev/tools/lint/eslint/eslint-plugin-mozilla
monikamaheshwari 836c33084c Bug 1578190 - Add a rule to ensure 'if(foo.length)' instead of 'foo.length>0'. r=Standard8
Differential Revision: https://phabricator.services.mozilla.com/D33011

--HG--
extra : moz-landing-system : lando
2019-09-02 11:09:44 +00:00
..
lib Bug 1578190 - Add a rule to ensure 'if(foo.length)' instead of 'foo.length>0'. r=Standard8 2019-09-02 11:09:44 +00:00
reporters Bug 1562642 - Part 4 - Add missing MPL2 headers in tools r=ahal 2019-07-10 19:12:07 +00:00
scripts Bug 1561435 - Format tools/, a=automatic-formatting 2019-07-05 11:18:19 +02:00
tests Bug 1578190 - Add a rule to ensure 'if(foo.length)' instead of 'foo.length>0'. r=Standard8 2019-09-02 11:09:44 +00:00
.npmignore
LICENSE
README.md
manifest.tt Bug 1540982 - Upgrade to ESLint 6.2.2 and switch to ECMA version 11 (BigInt support, Dynamic imports). r=mossop 2019-08-27 14:51:29 +00:00
package-lock.json Bug 1540982 - Upgrade to ESLint 6.2.2 and switch to ECMA version 11 (BigInt support, Dynamic imports). r=mossop 2019-08-27 14:51:29 +00:00
package.json Bug 1540982 - Upgrade to ESLint 6.2.2 and switch to ECMA version 11 (BigInt support, Dynamic imports). r=mossop 2019-08-27 14:51:29 +00:00
update.sh

README.md

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.

Installation

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

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 component of the Testing product.

Tests

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

./mach eslint --setup
cd tools/lint/eslint/eslint-plugin-mozilla
npm run test