File: CONTRIBUTING.md

package info (click to toggle)
node-eslint-plugin-flowtype 2.25.0-5
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 636 kB
  • sloc: javascript: 5,678; makefile: 4
file content (52 lines) | stat: -rw-r--r-- 1,591 bytes parent folder | download | duplicates (4)
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
# Contributing

**`README.md` is a generated file. Do not edit it directly.** Edit the files inside `.README` instead.

## Pre-Commit Hook

When making a commit, the following Pre-Commit hooks run:

* tests
* lint
* commit message validation (see "Commit Messages" below)

## Commit Messages

All commit messages must begin with one of the following prefixes:

* `fix: `
* `feat: `
* `refactor: `
* `docs: `
* `chore: `

The prefix is used to bump the correct segment of the version number automatically during deploy.

## Tests

Run them with `npm t`.

## Lint

Run with `npm run lint`.

## Adding a Rule

### Source & Tests

1. Create a file in `tests/rules/assertions` named the `camelCase` version of your rule name with the following template:
  * `export default { invalid: [], valid: [] }`
2. Add your test file to `tests/index.js`
3. Create a file in `src/rules` named the `camelCase` version  of your rule name
4. Add your rule file to `src/index.js`

### Adding Documentation

1. Create new file in `./README/rules/[rule-name].md`.
  * Use [./.README/rules/require-valid-file-annotation.md](./.README/rules/require-valid-file-annotation.md) as a template.
  * Ensure that rule documentation document includes `<!-- assertions spaceAfterTypeColon -->` declaration.
1. Update [./.README/README.md](/.README/README.md) to include the new rule.

A CI service will build and publish the new documentation.

Note: The section "The following patterns are considered problems:" and "The following patterns are not considered problems:" is **generated automatically** using the test cases.