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
+37-44
Original file line number
Diff line number
Diff line change
@@ -2,11 +2,7 @@
2
2
3
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).
@@ -16,19 +12,16 @@ Additional ESLint's rules for Node.js
16
12
$ npm install --save-dev eslint eslint-plugin-n
17
13
```
18
14
19
-
- Requires Node.js `>=12.22.0`
20
-
- Requires ESLint `>=7.0.0`
15
+
-Requires Node.js `>=12.22.0`
16
+
-Requires ESLint `>=7.0.0`
21
17
22
18
**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.
@@ -133,48 +126,48 @@ These rules have been deprecated in accordance with the [deprecation policy](htt
133
126
134
127
This plugin provides three configs:
135
128
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.
129
+
-`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.
130
+
-`plugin:n/recommended-module` considers all files as ES Modules.
131
+
-`plugin:n/recommended-script` considers all files as CommonJS.
139
132
140
133
Those preset config:
141
134
142
-
- enable [no-process-exit](http://eslint.org/docs/rules/no-process-exit) rule because [the official document](https://nodejs.org/api/process.html#process_process_exit_code) does not recommend a use of `process.exit()`.
143
-
- enable plugin rules which are given :star: in the above table.
144
-
- add `{ecmaVersion: 2019}` and etc into `parserOptions`.
145
-
- add proper globals into `globals`.
146
-
- add this plugin into `plugins`.
135
+
-enable [no-process-exit](http://eslint.org/docs/rules/no-process-exit) rule because [the official document](https://nodejs.org/api/process.html#process_process_exit_code) does not recommend a use of `process.exit()`.
136
+
-enable plugin rules which are given :star: in the above table.
137
+
-add `{ecmaVersion: 2019}` and etc into `parserOptions`.
138
+
-add proper globals into `globals`.
139
+
-add this plugin into `plugins`.
147
140
148
141
## 👫 FAQ
149
142
150
-
- Q: The `no-missing-import` / `no-missing-require` rules don't work with nested folders in SublimeLinter-eslint
151
-
- 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.
143
+
-Q: The `no-missing-import` / `no-missing-require` rules don't work with nested folders in SublimeLinter-eslint
144
+
-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.
152
145
153
146
## 🚥 Semantic Versioning Policy
154
147
155
148
`eslint-plugin-n` follows [semantic versioning](http://semver.org/) and [ESLint's Semantic Versioning Policy](https://github.com/eslint/eslint#semantic-versioning-policy).
156
149
157
-
- Patch release (intended to not break your lint build)
158
-
- A bug fix in a rule that results in it reporting fewer errors.
159
-
- Improvements to documentation.
160
-
- Non-user-facing changes such as refactoring code, adding, deleting, or modifying tests, and increasing test coverage.
161
-
- Re-releasing after a failed release (i.e., publishing a release that doesn't work for anyone).
162
-
- Minor release (might break your lint build)
163
-
- A bug fix in a rule that results in it reporting more errors.
164
-
- A new rule is created.
165
-
- A new option to an existing rule is created.
166
-
- An existing rule is deprecated.
167
-
- Major release (likely to break your lint build)
168
-
- A support for old Node version is dropped.
169
-
- A support for old ESLint version is dropped.
170
-
- An existing rule is changed in it reporting more errors.
171
-
- An existing rule is removed.
172
-
- An existing option of a rule is removed.
173
-
- An existing config is updated.
150
+
-Patch release (intended to not break your lint build)
151
+
-A bug fix in a rule that results in it reporting fewer errors.
152
+
-Improvements to documentation.
153
+
-Non-user-facing changes such as refactoring code, adding, deleting, or modifying tests, and increasing test coverage.
154
+
-Re-releasing after a failed release (i.e., publishing a release that doesn't work for anyone).
155
+
-Minor release (might break your lint build)
156
+
-A bug fix in a rule that results in it reporting more errors.
157
+
-A new rule is created.
158
+
-A new option to an existing rule is created.
159
+
-An existing rule is deprecated.
160
+
-Major release (likely to break your lint build)
161
+
-A support for old Node version is dropped.
162
+
-A support for old ESLint version is dropped.
163
+
-An existing rule is changed in it reporting more errors.
0 commit comments