You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+62-62Lines changed: 62 additions & 62 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,48 +1,48 @@
1
1
# eslint-plugin-n
2
2
3
-
> forked from [eslint-plugin-node](https://www.npmjs.com/package/eslint-plugin-node) v11.1.0. as the original repository seems [unmaintained](https://github.com/mysticatea/eslint-plugin-node/issues/300).
3
+
> forked from [eslint-plugin-node](https://www.npmjs.com/package/eslint-plugin-node) v11.1.0. as the original repository seems [no longer maintained](https://github.com/mysticatea/eslint-plugin-node/issues/300).
**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 `node/no-unsupported-features/*` rules.
22
+
**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 `n/no-unsupported-features/*` rules.
|[node/no-unsupported-features/es-builtins](./docs/rules/no-unsupported-features/es-builtins.md)| disallow unsupported ECMAScript built-ins on the specified version | ⭐️ |
87
-
|[node/no-unsupported-features/es-syntax](./docs/rules/no-unsupported-features/es-syntax.md)| disallow unsupported ECMAScript syntax on the specified version | ⭐️ |
88
-
|[node/no-unsupported-features/node-builtins](./docs/rules/no-unsupported-features/node-builtins.md)| disallow unsupported Node.js built-in APIs on the specified version | ⭐️ |
89
-
|[node/process-exit-as-throw](./docs/rules/process-exit-as-throw.md)| make `process.exit()` expressions the same code path as `throw`| ⭐️ |
90
-
|[node/shebang](./docs/rules/shebang.md)| suggest correct usage of shebang | ⭐️✒️ |
73
+
|[n/handle-callback-err](./docs/rules/handle-callback-err.md)| require error handling in callbacks ||
74
+
|[n/no-callback-literal](./docs/rules/no-callback-literal.md)| ensure Node.js-style error-first callback pattern is followed ||
75
+
|[n/no-exports-assign](./docs/rules/no-exports-assign.md)| disallow the assignment to `exports`| ⭐️ |
|[n/no-unsupported-features/es-builtins](./docs/rules/no-unsupported-features/es-builtins.md)| disallow unsupported ECMAScript built-ins on the specified version | ⭐️ |
87
+
|[n/no-unsupported-features/es-syntax](./docs/rules/no-unsupported-features/es-syntax.md)| disallow unsupported ECMAScript syntax on the specified version | ⭐️ |
88
+
|[n/no-unsupported-features/node-builtins](./docs/rules/no-unsupported-features/node-builtins.md)| disallow unsupported Node.js built-in APIs on the specified version | ⭐️ |
89
+
|[n/process-exit-as-throw](./docs/rules/process-exit-as-throw.md)| make `process.exit()` expressions the same code path as `throw`| ⭐️ |
90
+
|[n/shebang](./docs/rules/shebang.md)| suggest correct usage of shebang | ⭐️✒️ |
|[node/prefer-global/buffer](./docs/rules/prefer-global/buffer.md)| enforce either `Buffer` or `require("buffer").Buffer`||
112
-
|[node/prefer-global/console](./docs/rules/prefer-global/console.md)| enforce either `console` or `require("console")`||
113
-
|[node/prefer-global/process](./docs/rules/prefer-global/process.md)| enforce either `process` or `require("process")`||
114
-
|[node/prefer-global/text-decoder](./docs/rules/prefer-global/text-decoder.md)| enforce either `TextDecoder` or `require("util").TextDecoder`||
115
-
|[node/prefer-global/text-encoder](./docs/rules/prefer-global/text-encoder.md)| enforce either `TextEncoder` or `require("util").TextEncoder`||
116
-
|[node/prefer-global/url-search-params](./docs/rules/prefer-global/url-search-params.md)| enforce either `URLSearchParams` or `require("url").URLSearchParams`||
117
-
|[node/prefer-global/url](./docs/rules/prefer-global/url.md)| enforce either `URL` or `require("url").URL`||
|[n/prefer-global/buffer](./docs/rules/prefer-global/buffer.md)| enforce either `Buffer` or `require("buffer").Buffer`||
112
+
|[n/prefer-global/console](./docs/rules/prefer-global/console.md)| enforce either `console` or `require("console")`||
113
+
|[n/prefer-global/process](./docs/rules/prefer-global/process.md)| enforce either `process` or `require("process")`||
114
+
|[n/prefer-global/text-decoder](./docs/rules/prefer-global/text-decoder.md)| enforce either `TextDecoder` or `require("util").TextDecoder`||
115
+
|[n/prefer-global/text-encoder](./docs/rules/prefer-global/text-encoder.md)| enforce either `TextEncoder` or `require("util").TextEncoder`||
116
+
|[n/prefer-global/url-search-params](./docs/rules/prefer-global/url-search-params.md)| enforce either `URLSearchParams` or `require("url").URLSearchParams`||
117
+
|[n/prefer-global/url](./docs/rules/prefer-global/url.md)| enforce either `URL` or `require("url").URL`||
These rules have been deprecated in accordance with the [deprecation policy](https://eslint.org/docs/user-guide/rule-deprecation), and replaced by newer rules:
|[node/no-unsupported-features](./docs/rules/no-unsupported-features.md)|[node/no-unsupported-features/es-syntax](./docs/rules/no-unsupported-features/es-syntax.md) and [node/no-unsupported-features/es-builtins](./docs/rules/no-unsupported-features/es-builtins.md)|
|[n/no-unsupported-features](./docs/rules/no-unsupported-features.md)|[n/no-unsupported-features/es-syntax](./docs/rules/no-unsupported-features/es-syntax.md) and [n/no-unsupported-features/es-builtins](./docs/rules/no-unsupported-features/es-builtins.md)|
129
129
130
130
<!--RULES_TABLE_END-->
131
131
132
132
## 🔧 Configs
133
133
134
134
This plugin provides three configs:
135
135
136
-
-`plugin:node/recommended` considers both CommonJS and ES Modules. If [`"type":"module"` field](https://medium.com/@nodejs/announcing-a-new-experimental-modules-1be8d2d6c2ff#b023) existed in package.json then it considers files as ES Modules. Otherwise it considers files as CommonJS. In addition, it considers `*.mjs` files as ES Modules and `*.cjs` files as CommonJS.
137
-
-`plugin:node/recommended-module` considers all files as ES Modules.
138
-
-`plugin:node/recommended-script` considers all files as CommonJS.
136
+
-`plugin:n/recommended` considers both CommonJS and ES Modules. If [`"type":"module"` field](https://medium.com/@nodejs/announcing-a-new-experimental-modules-1be8d2d6c2ff#b023) existed in package.json then it considers files as ES Modules. Otherwise it considers files as CommonJS. In addition, it considers `*.mjs` files as ES Modules and `*.cjs` files as CommonJS.
137
+
-`plugin:n/recommended-module` considers all files as ES Modules.
138
+
-`plugin:n/recommended-script` considers all files as CommonJS.
139
139
140
140
Those preset config:
141
141
@@ -152,7 +152,7 @@ Those preset config:
152
152
153
153
## 🚥 Semantic Versioning Policy
154
154
155
-
`eslint-plugin-node` follows [semantic versioning](http://semver.org/) and [ESLint's Semantic Versioning Policy](https://github.com/eslint/eslint#semantic-versioning-policy).
155
+
`eslint-plugin-n` follows [semantic versioning](http://semver.org/) and [ESLint's Semantic Versioning Policy](https://github.com/eslint/eslint#semantic-versioning-policy).
156
156
157
157
- Patch release (intended to not break your lint build)
158
158
- A bug fix in a rule that results in it reporting fewer errors.
0 commit comments