summaryrefslogtreecommitdiffstats
path: root/tools/lint/eslint/eslint-plugin-mozilla/README.md
blob: 650507754ea01f4f0966b2242b880e661b05ef28 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
# 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](https://hg.mozilla.org/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](http://eslint.org):

```
$ 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](http://firefox-source-docs.mozilla.org/tools/lint/linters/eslint-plugin-mozilla.html).

## Source Code

The sources can be found at:

* Code: https://searchfox.org/mozilla-central/source/tools/lint/eslint/eslint-plugin-mozilla
* Documentation: https://searchfox.org/mozilla-central/source/docs/code-quality/lint/linters

## Bugs

Please file bugs in Bugzilla in the Lint component of the Testing product.

* [Existing bugs](https://bugzilla.mozilla.org/buglist.cgi?resolution=---&query_format=advanced&component=Lint&product=Testing)
* [New bugs](https://bugzilla.mozilla.org/enter_bug.cgi?product=Testing&component=Lint)

## 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
```