Skip to content

Commit

Permalink
💥 update node/recommended
Browse files Browse the repository at this point in the history
  • Loading branch information
mysticatea committed Sep 5, 2019
1 parent c2fa788 commit 9c574ba
Show file tree
Hide file tree
Showing 6 changed files with 8 additions and 10 deletions.
2 changes: 1 addition & 1 deletion README.md
Expand Up @@ -65,7 +65,7 @@ $ npm install --save-dev eslint eslint-plugin-node
| Rule ID | Description | |
|:--------|:------------|:--:|
| [node/no-callback-literal](./docs/rules/no-callback-literal.md) | ensure Node.js-style error-first callback pattern is followed | |
| [node/no-exports-assign](./docs/rules/no-exports-assign.md) | disallow the assignment to `exports` | |
| [node/no-exports-assign](./docs/rules/no-exports-assign.md) | disallow the assignment to `exports` | ⭐️ |
| [node/no-extraneous-import](./docs/rules/no-extraneous-import.md) | disallow `import` declarations which import extraneous modules | ⭐️ |
| [node/no-extraneous-require](./docs/rules/no-extraneous-require.md) | disallow `require()` expressions which import extraneous modules | ⭐️ |
| [node/no-missing-import](./docs/rules/no-missing-import.md) | disallow `import` declarations which import non-existence modules | ⭐️ |
Expand Down
2 changes: 1 addition & 1 deletion docs/rules/no-exports-assign.md
@@ -1,5 +1,6 @@
# node/no-exports-assign
> disallow the assignment to `exports`
> - ⭐️ This rule is included in `plugin:node/recommended` preset.
To assign to `exports` variable would not work as expected.

Expand Down Expand Up @@ -38,7 +39,6 @@ exports = module.exports = {}
exports = {}
```


## 🔎 Implementation

- [Rule source](../../lib/rules/no-exports-assign.js)
Expand Down
4 changes: 4 additions & 0 deletions lib/configs/_commons.js
Expand Up @@ -59,9 +59,13 @@ module.exports = {
commonRules: {
"no-process-exit": "error",
"node/no-deprecated-api": "error",
"node/no-extraneous-import": "error",
"node/no-extraneous-require": "error",
"node/no-exports-assign": "error",
"node/no-missing-import": "error",
"node/no-missing-require": "error",
"node/no-unpublished-bin": "error",
"node/no-unpublished-import": "error",
"node/no-unpublished-require": "error",
"node/no-unsupported-features/es-builtins": "error",
"node/no-unsupported-features/es-syntax": "error",
Expand Down
3 changes: 0 additions & 3 deletions lib/configs/recommended-module.js
Expand Up @@ -19,9 +19,6 @@ module.exports = {
plugins: ["node"],
rules: {
...commonRules,
"node/no-extraneous-import": "error",
"node/no-missing-import": "error",
"node/no-unpublished-import": "error",
"node/no-unsupported-features/es-syntax": [
"error",
{ ignores: ["modules"] },
Expand Down
5 changes: 1 addition & 4 deletions lib/configs/recommended-script.js
Expand Up @@ -7,7 +7,7 @@ module.exports = {
...commonGlobals,
__dirname: "readonly",
__filename: "readonly",
exports: "readonly",
exports: "writable",
module: "readonly",
require: "readonly",
},
Expand All @@ -19,9 +19,6 @@ module.exports = {
plugins: ["node"],
rules: {
...commonRules,
"node/no-extraneous-import": "off",
"node/no-missing-import": "off",
"node/no-unpublished-import": "off",
"node/no-unsupported-features/es-syntax": ["error", { ignores: [] }],
},
}
2 changes: 1 addition & 1 deletion lib/rules/no-exports-assign.js
Expand Up @@ -39,7 +39,7 @@ module.exports = {
docs: {
description: "disallow the assignment to `exports`",
category: "Possible Errors",
recommended: false,
recommended: true,
url:
"https://github.com/mysticatea/eslint-plugin-node/blob/v9.2.0/docs/rules/no-exports-assign.md",
},
Expand Down

0 comments on commit 9c574ba

Please sign in to comment.