@@ -18,37 +18,36 @@ Additional ESLint's rules for Node.js
1818
1919``` json
2020{
21- "extends" : " eslint:recommended" ,
2221 "plugins" : [" node" ],
23- "env" : {
24- "es6" : true ,
25- "node" : true
26- },
27- "rules" : {
28- "node/no-deprecated-api" : " error" ,
29- "node/no-missing-import" : " error" ,
30- "node/no-missing-require" : " error" ,
31- "node/no-unpublished-import" : " error" ,
32- "node/no-unpublished-require" : " error" ,
33- "node/no-unsupported-features" : [" error" , {"version" : 4 }],
34- "node/process-exit-as-throw" : " error" ,
35- "node/shebang" : " error"
36- }
22+ "extends" : [" eslint:recommended" , " plugin:node/recommended" ]
3723}
3824```
3925
26+ ## Configs
27+
28+ This plugin provides ` plugin:node/recommended ` preset config.
29+ This preset config:
30+
31+ - enables the environment of ES2015 (ES6) and Node.js.
32+ - enables rules which are given :star : in the following table.
33+
34+ ** 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.
35+
4036## Rules
4137
42- Some rules are slow because it searches ` package.json ` and opens it.
38+ | | | Rule ID | Description |
39+ | :------:| :--------:| :-----------------------------------------------------------------| :------------|
40+ | :star : | | [ no-deprecated-api] ( docs/rules/no-deprecated-api.md ) | Disallow deprecated API.
41+ | | | [ no-missing-import] ( docs/rules/no-missing-import.md ) | Disallow ` import ` and ` export ` declarations for files that don't exist.
42+ | :star : | | [ no-missing-require] ( docs/rules/no-missing-require.md ) | Disallow ` require() ` s for files that don't exist.
43+ | | | [ no-unpublished-import] ( docs/rules/no-unpublished-import.md ) | Disallow ` import ` and ` export ` declarations for files that are not published.
44+ | :star : | | [ no-unpublished-require] ( docs/rules/no-unpublished-require.md ) | Disallow ` require() ` s for files that are not published.
45+ | :star : | | [ no-unsupported-features] ( docs/rules/no-unsupported-features.md ) | Disallow unsupported ECMAScript features on the specified version.
46+ | | | [ process-exit-as-throw] ( docs/rules/process-exit-as-throw.md ) | Make the same code path as throw at ` process.exit() ` . (⚠ Experimental)
47+ | :star : | :pencil : | [ shebang] ( docs/rules/shebang.md ) | Suggest correct usage of shebang.
4348
44- - [ no-deprecated-api] ( docs/rules/no-deprecated-api.md ) - Disallow deprecated API.
45- - [ no-missing-import] ( docs/rules/no-missing-import.md ) - Disallow ` import ` and ` export ` declarations for files that don't exist.
46- - [ no-missing-require] ( docs/rules/no-missing-require.md ) - Disallow ` require() ` s for files that don't exist.
47- - [ no-unpublished-import] ( docs/rules/no-unpublished-import.md ) - Disallow ` import ` and ` export ` declarations for files that are not published.
48- - [ no-unpublished-require] ( docs/rules/no-unpublished-require.md ) - Disallow ` require() ` s for files that are not published.
49- - [ no-unsupported-features] ( docs/rules/no-unsupported-features.md ) - Disallow unsupported ECMAScript features on the specified version.
50- - [ process-exit-as-throw] ( docs/rules/process-exit-as-throw.md ) - Make the same code path as throw at ` process.exit() ` . (⚠ Experimental)
51- - [ shebang] ( docs/rules/shebang.md ) - Suggest correct usage of shebang. (fixable)
49+ - :star : - the mark of a recommended rule.
50+ - :pencil : - the mark of a fixable rule.
5251
5352## Semantic Versioning Policy
5453
0 commit comments