Skip to content

Commit 9c574ba

Browse files
committedSep 5, 2019
💥 update node/recommended
1 parent c2fa788 commit 9c574ba

File tree

6 files changed

+8
-10
lines changed

6 files changed

+8
-10
lines changed
 

‎README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ $ npm install --save-dev eslint eslint-plugin-node
6565
| Rule ID | Description | |
6666
|:--------|:------------|:--:|
6767
| [node/no-callback-literal](./docs/rules/no-callback-literal.md) | ensure Node.js-style error-first callback pattern is followed | |
68-
| [node/no-exports-assign](./docs/rules/no-exports-assign.md) | disallow the assignment to `exports` | |
68+
| [node/no-exports-assign](./docs/rules/no-exports-assign.md) | disallow the assignment to `exports` | ⭐️ |
6969
| [node/no-extraneous-import](./docs/rules/no-extraneous-import.md) | disallow `import` declarations which import extraneous modules | ⭐️ |
7070
| [node/no-extraneous-require](./docs/rules/no-extraneous-require.md) | disallow `require()` expressions which import extraneous modules | ⭐️ |
7171
| [node/no-missing-import](./docs/rules/no-missing-import.md) | disallow `import` declarations which import non-existence modules | ⭐️ |

‎docs/rules/no-exports-assign.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
# node/no-exports-assign
22
> disallow the assignment to `exports`
3+
> - ⭐️ This rule is included in `plugin:node/recommended` preset.
34
45
To assign to `exports` variable would not work as expected.
56

@@ -38,7 +39,6 @@ exports = module.exports = {}
3839
exports = {}
3940
```
4041

41-
4242
## 🔎 Implementation
4343

4444
- [Rule source](../../lib/rules/no-exports-assign.js)

‎lib/configs/_commons.js

+4
Original file line numberDiff line numberDiff line change
@@ -59,9 +59,13 @@ module.exports = {
5959
commonRules: {
6060
"no-process-exit": "error",
6161
"node/no-deprecated-api": "error",
62+
"node/no-extraneous-import": "error",
6263
"node/no-extraneous-require": "error",
64+
"node/no-exports-assign": "error",
65+
"node/no-missing-import": "error",
6366
"node/no-missing-require": "error",
6467
"node/no-unpublished-bin": "error",
68+
"node/no-unpublished-import": "error",
6569
"node/no-unpublished-require": "error",
6670
"node/no-unsupported-features/es-builtins": "error",
6771
"node/no-unsupported-features/es-syntax": "error",

‎lib/configs/recommended-module.js

-3
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,6 @@ module.exports = {
1919
plugins: ["node"],
2020
rules: {
2121
...commonRules,
22-
"node/no-extraneous-import": "error",
23-
"node/no-missing-import": "error",
24-
"node/no-unpublished-import": "error",
2522
"node/no-unsupported-features/es-syntax": [
2623
"error",
2724
{ ignores: ["modules"] },

‎lib/configs/recommended-script.js

+1-4
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ module.exports = {
77
...commonGlobals,
88
__dirname: "readonly",
99
__filename: "readonly",
10-
exports: "readonly",
10+
exports: "writable",
1111
module: "readonly",
1212
require: "readonly",
1313
},
@@ -19,9 +19,6 @@ module.exports = {
1919
plugins: ["node"],
2020
rules: {
2121
...commonRules,
22-
"node/no-extraneous-import": "off",
23-
"node/no-missing-import": "off",
24-
"node/no-unpublished-import": "off",
2522
"node/no-unsupported-features/es-syntax": ["error", { ignores: [] }],
2623
},
2724
}

‎lib/rules/no-exports-assign.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ module.exports = {
3939
docs: {
4040
description: "disallow the assignment to `exports`",
4141
category: "Possible Errors",
42-
recommended: false,
42+
recommended: true,
4343
url:
4444
"https://github.com/mysticatea/eslint-plugin-node/blob/v9.2.0/docs/rules/no-exports-assign.md",
4545
},

0 commit comments

Comments
 (0)
Please sign in to comment.