1 | # eslint-plugin-mozilla
|
2 |
|
3 | A collection of rules that help enforce JavaScript coding standard in the Mozilla project.
|
4 |
|
5 | These are primarily developed and used within the Firefox build system ([mozilla-central](https://hg.mozilla.org/mozilla-central/)), but are made available for other
|
6 | related projects to use as well.
|
7 |
|
8 | ## Installation
|
9 |
|
10 | ### Within mozilla-central:
|
11 |
|
12 | ```
|
13 | $ ./mach eslint --setup
|
14 | ```
|
15 |
|
16 | ### Outside mozilla-central:
|
17 |
|
18 | Install ESLint [ESLint](http://eslint.org):
|
19 |
|
20 | ```
|
21 | $ npm i eslint --save-dev
|
22 | ```
|
23 |
|
24 | Next, install `eslint-plugin-mozilla`:
|
25 |
|
26 | ```
|
27 | $ npm install eslint-plugin-mozilla --save-dev
|
28 | ```
|
29 |
|
30 | ## Documentation
|
31 |
|
32 | For details about the rules, please see the [firefox documentation page](http://firefox-source-docs.mozilla.org/tools/lint/linters/eslint-plugin-mozilla.html).
|
33 |
|
34 | ## Source Code
|
35 |
|
36 | The sources can be found at:
|
37 |
|
38 | * Code: https://dxr.mozilla.org/mozilla-central/source/tools/lint/eslint/eslint-plugin-mozilla
|
39 | * Documentation: https://dxr.mozilla.org/mozilla-central/source/tools/lint/docs/linters
|
40 |
|
41 | ## Bugs
|
42 |
|
43 | Please file bugs in Bugzilla in the Lint component of the Testing product.
|
44 |
|
45 | * [Existing bugs](https://bugzilla.mozilla.org/buglist.cgi?resolution=---&query_format=advanced&component=Lint&product=Testing)
|
46 | * [New bugs](https://bugzilla.mozilla.org/enter_bug.cgi?product=Testing&component=Lint)
|
47 |
|
48 | ## Tests
|
49 |
|
50 | The tests can only be run from within mozilla-central. To run the tests:
|
51 |
|
52 | ```
|
53 | ./mach eslint --setup
|
54 | cd tools/lint/eslint/eslint-plugin-mozilla
|
55 | npm run test
|
56 | ```
|