Skip to content

Commit 8ecc429

Browse files
committed
Docs: update README.md
1 parent 0d0ce45 commit 8ecc429

File tree

1 file changed

+48
-18
lines changed

1 file changed

+48
-18
lines changed

README.md

Lines changed: 48 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88

99
Additional ESLint's rules for Node.js
1010

11-
## Install & Usage
11+
## :cd: Install & Usage
1212

1313
```
1414
> npm install --save-dev eslint eslint-plugin-node
@@ -17,16 +17,7 @@ Additional ESLint's rules for Node.js
1717
- Requires Node.js `^0.10.0 || ^0.12.0 || ^4.0.0 || >=6.0.0`
1818
- Requires ESLint `>=2.0.0`
1919

20-
**.eslintrc**
21-
22-
```json
23-
{
24-
"plugins": ["node"],
25-
"extends": ["eslint:recommended", "plugin:node/recommended"]
26-
}
27-
```
28-
29-
## Configs
20+
## :wrench: Configs
3021

3122
This plugin provides `plugin:node/recommended` preset config.
3223
This preset config:
@@ -36,16 +27,40 @@ This preset config:
3627

3728
**Note:** It recommends a use of [the "engines" field of package.json](https://docs.npmjs.com/files/package.json#engines). The "engines" field is used by [no-unsupported-features](docs/rules/no-unsupported-features.md) rule.
3829

39-
## Rules
30+
**.eslintrc.json** (An example)
31+
32+
```json
33+
{
34+
"plugins": ["node"],
35+
"extends": ["eslint:recommended", "plugin:node/recommended"],
36+
"rules": {
37+
"node/exports-style": ["error", "module.exports"],
38+
"node/no-unpublished-bin": "error",
39+
"node/process-exit-as-throw": "error"
40+
}
41+
}
42+
```
43+
44+
**package.json** (An example)
45+
46+
```json
47+
{
48+
"engines": {
49+
"node": ">=4"
50+
}
51+
}
52+
```
53+
54+
## :bulb: Rules
4055

4156
| | | Rule ID | Description |
4257
|:------:|:--------:|:-----------------------------------------------------------------|:------------|
4358
| | | [exports-style](docs/rules/exports-style.md) | Enforce either `module.exports` or `exports`.
4459
| :star: | | [no-deprecated-api](docs/rules/no-deprecated-api.md) | Disallow deprecated API.
45-
| | | [no-missing-import](docs/rules/no-missing-import.md) | Disallow `import` declarations for files that don't exist.
60+
| | | [no-missing-import](docs/rules/no-missing-import.md) | Disallow `import` declarations for files that don't exist. :warning:
4661
| :star: | | [no-missing-require](docs/rules/no-missing-require.md) | Disallow `require()`s for files that don't exist.
4762
| | | [no-unpublished-bin](docs/rules/no-unpublished-bin.md) | Disallow `bin` files that npm ignores.
48-
| | | [no-unpublished-import](docs/rules/no-unpublished-import.md) | Disallow `import` declarations for files that npm ignores.
63+
| | | [no-unpublished-import](docs/rules/no-unpublished-import.md) | Disallow `import` declarations for files that npm ignores. :warning:
4964
| :star: | | [no-unpublished-require](docs/rules/no-unpublished-require.md) | Disallow `require()`s for files that npm ignores.
5065
| :star: | | [no-unsupported-features](docs/rules/no-unsupported-features.md) | Disallow unsupported ECMAScript features on the specified version.
5166
| | | [process-exit-as-throw](docs/rules/process-exit-as-throw.md) | Make the same code path as throw at `process.exit()`.
@@ -54,7 +69,12 @@ This preset config:
5469
- :star: - the mark of a recommended rule.
5570
- :pencil: - the mark of a fixable rule.
5671

57-
## Semantic Versioning Policy
72+
## :couple: FAQ
73+
74+
- Q: The `no-missing-import` / `no-missing-require` rules don't work with nested folders in SublimeLinter-eslint
75+
- A: See [context.getFilename() in rule returns relative path](https://github.com/roadhump/SublimeLinter-eslint#contextgetfilename-in-rule-returns-relative-path) in the SublimeLinter-eslint FAQ.
76+
77+
## :anchor: Semantic Versioning Policy
5878

5979
`eslint-plugin-node` follows [semantic versioning](http://semver.org/) and [ESLint's Semantic Versioning Policy](https://github.com/eslint/eslint#semantic-versioning-policy).
6080

@@ -75,8 +95,18 @@ This preset config:
7595
- An existing option of a rule is removed.
7696
- An existing config is updated.
7797

78-
## FAQ
98+
## :memo: Changelog
99+
100+
- [GitHub Releases](https://github.com/mysticatea/eslint-plugin-node/releases)
101+
102+
## :muscle: Contributing
103+
104+
Welcome contributing!
105+
106+
Please use GitHub's Issues/PRs.
79107

80-
Q: The `no-missing-import` / `no-missing-require` rules don't work with nested folders in SublimeLinter-eslint
108+
### Development Tools
81109

82-
A: See [context.getFilename() in rule returns relative path](https://github.com/roadhump/SublimeLinter-eslint#contextgetfilename-in-rule-returns-relative-path) in the SublimeLinter-eslint FAQ.
110+
- `npm test` runs tests and measures coverage.
111+
- `npm run coverage` shows the coverage result of `npm test` command.
112+
- `npm run clean` removes the coverage result of `npm test` command.

0 commit comments

Comments
 (0)