eslint-plugin-n 17.9.0 β†’ 17.10.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -26,28 +26,29 @@ npm install --save-dev eslint eslint-plugin-n
26
26
 
27
27
  **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.
28
28
 
29
- ### **[.eslintrc.json](https://eslint.org/docs/latest/use/configure/configuration-files)** (An example)
29
+ ### [`eslint.config.js`](https://eslint.org/docs/latest/use/configure/configuration-files-new) (requires eslint>=v8.23.0)
30
30
 
31
- ```jsonc
32
- {
33
- "extends": ["eslint:recommended", "plugin:n/recommended"],
34
- "parserOptions": {
35
- "ecmaVersion": 2021
36
- },
37
- "rules": {
38
- "n/exports-style": ["error", "module.exports"]
31
+ ```js
32
+ const nodePlugin = require("eslint-plugin-n")
33
+
34
+ module.exports = [
35
+ nodePlugin.configs["flat/recommended-script"],
36
+ {
37
+ rules: {
38
+ "n/exports-style": ["error", "module.exports"]
39
+ }
39
40
  }
40
- }
41
+ ]
41
42
  ```
42
43
 
43
- ### [`eslint.config.js`](https://eslint.org/docs/latest/use/configure/configuration-files-new) (requires eslint>=v8.23.0)
44
+ To setup without the recommended configs, you'll need to add the plugin:
44
45
 
45
46
  ```js
46
47
  const nodePlugin = require("eslint-plugin-n")
47
48
 
48
49
  module.exports = [
49
- nodePlugin.configs["flat/recommended-script"],
50
50
  {
51
+ plugins: {n: nodePlugin},
51
52
  rules: {
52
53
  "n/exports-style": ["error", "module.exports"]
53
54
  }
@@ -55,6 +56,34 @@ module.exports = [
55
56
  ]
56
57
  ```
57
58
 
59
+ ### **[.eslintrc.json](https://eslint.org/docs/latest/use/configure/configuration-files)** (legacy example)
60
+
61
+ ```jsonc
62
+ {
63
+ "extends": ["eslint:recommended", "plugin:n/recommended"],
64
+ "parserOptions": {
65
+ "ecmaVersion": 2021
66
+ },
67
+ "rules": {
68
+ "n/exports-style": ["error", "module.exports"]
69
+ }
70
+ }
71
+ ```
72
+
73
+ To setup without the recommended rules you'll need to add the plugin:
74
+
75
+ ```jsonc
76
+ {
77
+ "parserOptions": {
78
+ "ecmaVersion": 2021
79
+ },
80
+ "plugins": ["n"],
81
+ "rules": {
82
+ "n/exports-style": ["error", "module.exports"]
83
+ }
84
+ }
85
+ ```
86
+
58
87
  **package.json** (An example)
59
88
 
60
89
  ```json
@@ -98,57 +127,53 @@ For [Shareable Configs](https://eslint.org/docs/latest/developer-guide/shareable
98
127
  <!-- begin auto-generated rules list -->
99
128
 
100
129
  πŸ’Ό [Configurations](https://github.com/eslint-community/eslint-plugin-n#-configs) enabled in.\
101
- β˜‘οΈ Set in the `flat/recommended` [configuration](https://github.com/eslint-community/eslint-plugin-n#-configs).\
102
- 🟒 Set in the `flat/recommended-module` [configuration](https://github.com/eslint-community/eslint-plugin-n#-configs).\
103
- βœ… Set in the `flat/recommended-script` [configuration](https://github.com/eslint-community/eslint-plugin-n#-configs).\
104
- β˜‘οΈ Set in the `recommended` [configuration](https://github.com/eslint-community/eslint-plugin-n#-configs).\
105
130
  🟒 Set in the `recommended-module` [configuration](https://github.com/eslint-community/eslint-plugin-n#-configs).\
106
131
  βœ… Set in the `recommended-script` [configuration](https://github.com/eslint-community/eslint-plugin-n#-configs).\
107
132
  πŸ”§ Automatically fixable by the [`--fix` CLI option](https://eslint.org/docs/user-guide/command-line-interface#--fix).\
108
133
  ❌ Deprecated.
109
134
 
110
- | NameΒ Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β  | Description | πŸ’Ό | πŸ”§ | ❌ |
111
- | :------------------------------------------------------------------------------------------- | :-------------------------------------------------------------------------- | :-------------- | :- | :- |
112
- | [callback-return](docs/rules/callback-return.md) | require `return` statements after callbacks | | | |
113
- | [exports-style](docs/rules/exports-style.md) | enforce either `module.exports` or `exports` | | πŸ”§ | |
114
- | [file-extension-in-import](docs/rules/file-extension-in-import.md) | enforce the style of file extensions in `import` declarations | | πŸ”§ | |
115
- | [global-require](docs/rules/global-require.md) | require `require()` calls to be placed at top-level module scope | | | |
116
- | [handle-callback-err](docs/rules/handle-callback-err.md) | require error handling in callbacks | | | |
117
- | [hashbang](docs/rules/hashbang.md) | require correct usage of hashbang | β˜‘οΈ 🟒 βœ… β˜‘οΈ 🟒 βœ… | πŸ”§ | |
118
- | [no-callback-literal](docs/rules/no-callback-literal.md) | enforce Node.js-style error-first callback pattern is followed | | | |
119
- | [no-deprecated-api](docs/rules/no-deprecated-api.md) | disallow deprecated APIs | β˜‘οΈ 🟒 βœ… β˜‘οΈ 🟒 βœ… | | |
120
- | [no-exports-assign](docs/rules/no-exports-assign.md) | disallow the assignment to `exports` | β˜‘οΈ 🟒 βœ… β˜‘οΈ 🟒 βœ… | | |
121
- | [no-extraneous-import](docs/rules/no-extraneous-import.md) | disallow `import` declarations which import extraneous modules | β˜‘οΈ 🟒 βœ… β˜‘οΈ 🟒 βœ… | | |
122
- | [no-extraneous-require](docs/rules/no-extraneous-require.md) | disallow `require()` expressions which import extraneous modules | β˜‘οΈ 🟒 βœ… β˜‘οΈ 🟒 βœ… | | |
123
- | [no-hide-core-modules](docs/rules/no-hide-core-modules.md) | disallow third-party modules which are hiding core modules | | | ❌ |
124
- | [no-missing-import](docs/rules/no-missing-import.md) | disallow `import` declarations which import non-existence modules | β˜‘οΈ 🟒 βœ… β˜‘οΈ 🟒 βœ… | | |
125
- | [no-missing-require](docs/rules/no-missing-require.md) | disallow `require()` expressions which import non-existence modules | β˜‘οΈ 🟒 βœ… β˜‘οΈ 🟒 βœ… | | |
126
- | [no-mixed-requires](docs/rules/no-mixed-requires.md) | disallow `require` calls to be mixed with regular variable declarations | | | |
127
- | [no-new-require](docs/rules/no-new-require.md) | disallow `new` operators with calls to `require` | | | |
128
- | [no-path-concat](docs/rules/no-path-concat.md) | disallow string concatenation with `__dirname` and `__filename` | | | |
129
- | [no-process-env](docs/rules/no-process-env.md) | disallow the use of `process.env` | | | |
130
- | [no-process-exit](docs/rules/no-process-exit.md) | disallow the use of `process.exit()` | β˜‘οΈ 🟒 βœ… β˜‘οΈ 🟒 βœ… | | |
131
- | [no-restricted-import](docs/rules/no-restricted-import.md) | disallow specified modules when loaded by `import` declarations | | | |
132
- | [no-restricted-require](docs/rules/no-restricted-require.md) | disallow specified modules when loaded by `require` | | | |
133
- | [no-sync](docs/rules/no-sync.md) | disallow synchronous methods | | | |
134
- | [no-unpublished-bin](docs/rules/no-unpublished-bin.md) | disallow `bin` files that npm ignores | β˜‘οΈ 🟒 βœ… β˜‘οΈ 🟒 βœ… | | |
135
- | [no-unpublished-import](docs/rules/no-unpublished-import.md) | disallow `import` declarations which import private modules | β˜‘οΈ 🟒 βœ… β˜‘οΈ 🟒 βœ… | | |
136
- | [no-unpublished-require](docs/rules/no-unpublished-require.md) | disallow `require()` expressions which import private modules | β˜‘οΈ 🟒 βœ… β˜‘οΈ 🟒 βœ… | | |
137
- | [no-unsupported-features/es-builtins](docs/rules/no-unsupported-features/es-builtins.md) | disallow unsupported ECMAScript built-ins on the specified version | β˜‘οΈ 🟒 βœ… β˜‘οΈ 🟒 βœ… | | |
138
- | [no-unsupported-features/es-syntax](docs/rules/no-unsupported-features/es-syntax.md) | disallow unsupported ECMAScript syntax on the specified version | β˜‘οΈ 🟒 βœ… β˜‘οΈ 🟒 βœ… | | |
139
- | [no-unsupported-features/node-builtins](docs/rules/no-unsupported-features/node-builtins.md) | disallow unsupported Node.js built-in APIs on the specified version | β˜‘οΈ 🟒 βœ… β˜‘οΈ 🟒 βœ… | | |
140
- | [prefer-global/buffer](docs/rules/prefer-global/buffer.md) | enforce either `Buffer` or `require("buffer").Buffer` | | | |
141
- | [prefer-global/console](docs/rules/prefer-global/console.md) | enforce either `console` or `require("console")` | | | |
142
- | [prefer-global/process](docs/rules/prefer-global/process.md) | enforce either `process` or `require("process")` | | | |
143
- | [prefer-global/text-decoder](docs/rules/prefer-global/text-decoder.md) | enforce either `TextDecoder` or `require("util").TextDecoder` | | | |
144
- | [prefer-global/text-encoder](docs/rules/prefer-global/text-encoder.md) | enforce either `TextEncoder` or `require("util").TextEncoder` | | | |
145
- | [prefer-global/url](docs/rules/prefer-global/url.md) | enforce either `URL` or `require("url").URL` | | | |
146
- | [prefer-global/url-search-params](docs/rules/prefer-global/url-search-params.md) | enforce either `URLSearchParams` or `require("url").URLSearchParams` | | | |
147
- | [prefer-node-protocol](docs/rules/prefer-node-protocol.md) | enforce using the `node:` protocol when importing Node.js builtin modules. | | πŸ”§ | |
148
- | [prefer-promises/dns](docs/rules/prefer-promises/dns.md) | enforce `require("dns").promises` | | | |
149
- | [prefer-promises/fs](docs/rules/prefer-promises/fs.md) | enforce `require("fs").promises` | | | |
150
- | [process-exit-as-throw](docs/rules/process-exit-as-throw.md) | require that `process.exit()` expressions use the same code path as `throw` | β˜‘οΈ 🟒 βœ… β˜‘οΈ 🟒 βœ… | | |
151
- | [shebang](docs/rules/shebang.md) | require correct usage of hashbang | | πŸ”§ | ❌ |
135
+ | NameΒ Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β Β  | Description | πŸ’Ό | πŸ”§ | ❌ |
136
+ | :------------------------------------------------------------------------------------------- | :-------------------------------------------------------------------------- | :--- | :- | :- |
137
+ | [callback-return](docs/rules/callback-return.md) | require `return` statements after callbacks | | | |
138
+ | [exports-style](docs/rules/exports-style.md) | enforce either `module.exports` or `exports` | | πŸ”§ | |
139
+ | [file-extension-in-import](docs/rules/file-extension-in-import.md) | enforce the style of file extensions in `import` declarations | | πŸ”§ | |
140
+ | [global-require](docs/rules/global-require.md) | require `require()` calls to be placed at top-level module scope | | | |
141
+ | [handle-callback-err](docs/rules/handle-callback-err.md) | require error handling in callbacks | | | |
142
+ | [hashbang](docs/rules/hashbang.md) | require correct usage of hashbang | 🟒 βœ… | πŸ”§ | |
143
+ | [no-callback-literal](docs/rules/no-callback-literal.md) | enforce Node.js-style error-first callback pattern is followed | | | |
144
+ | [no-deprecated-api](docs/rules/no-deprecated-api.md) | disallow deprecated APIs | 🟒 βœ… | | |
145
+ | [no-exports-assign](docs/rules/no-exports-assign.md) | disallow the assignment to `exports` | 🟒 βœ… | | |
146
+ | [no-extraneous-import](docs/rules/no-extraneous-import.md) | disallow `import` declarations which import extraneous modules | 🟒 βœ… | | |
147
+ | [no-extraneous-require](docs/rules/no-extraneous-require.md) | disallow `require()` expressions which import extraneous modules | 🟒 βœ… | | |
148
+ | [no-hide-core-modules](docs/rules/no-hide-core-modules.md) | disallow third-party modules which are hiding core modules | | | ❌ |
149
+ | [no-missing-import](docs/rules/no-missing-import.md) | disallow `import` declarations which import non-existence modules | 🟒 βœ… | | |
150
+ | [no-missing-require](docs/rules/no-missing-require.md) | disallow `require()` expressions which import non-existence modules | 🟒 βœ… | | |
151
+ | [no-mixed-requires](docs/rules/no-mixed-requires.md) | disallow `require` calls to be mixed with regular variable declarations | | | |
152
+ | [no-new-require](docs/rules/no-new-require.md) | disallow `new` operators with calls to `require` | | | |
153
+ | [no-path-concat](docs/rules/no-path-concat.md) | disallow string concatenation with `__dirname` and `__filename` | | | |
154
+ | [no-process-env](docs/rules/no-process-env.md) | disallow the use of `process.env` | | | |
155
+ | [no-process-exit](docs/rules/no-process-exit.md) | disallow the use of `process.exit()` | 🟒 βœ… | | |
156
+ | [no-restricted-import](docs/rules/no-restricted-import.md) | disallow specified modules when loaded by `import` declarations | | | |
157
+ | [no-restricted-require](docs/rules/no-restricted-require.md) | disallow specified modules when loaded by `require` | | | |
158
+ | [no-sync](docs/rules/no-sync.md) | disallow synchronous methods | | | |
159
+ | [no-unpublished-bin](docs/rules/no-unpublished-bin.md) | disallow `bin` files that npm ignores | 🟒 βœ… | | |
160
+ | [no-unpublished-import](docs/rules/no-unpublished-import.md) | disallow `import` declarations which import private modules | 🟒 βœ… | | |
161
+ | [no-unpublished-require](docs/rules/no-unpublished-require.md) | disallow `require()` expressions which import private modules | 🟒 βœ… | | |
162
+ | [no-unsupported-features/es-builtins](docs/rules/no-unsupported-features/es-builtins.md) | disallow unsupported ECMAScript built-ins on the specified version | 🟒 βœ… | | |
163
+ | [no-unsupported-features/es-syntax](docs/rules/no-unsupported-features/es-syntax.md) | disallow unsupported ECMAScript syntax on the specified version | 🟒 βœ… | | |
164
+ | [no-unsupported-features/node-builtins](docs/rules/no-unsupported-features/node-builtins.md) | disallow unsupported Node.js built-in APIs on the specified version | 🟒 βœ… | | |
165
+ | [prefer-global/buffer](docs/rules/prefer-global/buffer.md) | enforce either `Buffer` or `require("buffer").Buffer` | | | |
166
+ | [prefer-global/console](docs/rules/prefer-global/console.md) | enforce either `console` or `require("console")` | | | |
167
+ | [prefer-global/process](docs/rules/prefer-global/process.md) | enforce either `process` or `require("process")` | | | |
168
+ | [prefer-global/text-decoder](docs/rules/prefer-global/text-decoder.md) | enforce either `TextDecoder` or `require("util").TextDecoder` | | | |
169
+ | [prefer-global/text-encoder](docs/rules/prefer-global/text-encoder.md) | enforce either `TextEncoder` or `require("util").TextEncoder` | | | |
170
+ | [prefer-global/url](docs/rules/prefer-global/url.md) | enforce either `URL` or `require("url").URL` | | | |
171
+ | [prefer-global/url-search-params](docs/rules/prefer-global/url-search-params.md) | enforce either `URLSearchParams` or `require("url").URLSearchParams` | | | |
172
+ | [prefer-node-protocol](docs/rules/prefer-node-protocol.md) | enforce using the `node:` protocol when importing Node.js builtin modules. | | πŸ”§ | |
173
+ | [prefer-promises/dns](docs/rules/prefer-promises/dns.md) | enforce `require("dns").promises` | | | |
174
+ | [prefer-promises/fs](docs/rules/prefer-promises/fs.md) | enforce `require("fs").promises` | | | |
175
+ | [process-exit-as-throw](docs/rules/process-exit-as-throw.md) | require that `process.exit()` expressions use the same code path as `throw` | 🟒 βœ… | | |
176
+ | [shebang](docs/rules/shebang.md) | require correct usage of hashbang | | πŸ”§ | ❌ |
152
177
 
153
178
  <!-- end auto-generated rules list -->
154
179
 
@@ -156,15 +181,10 @@ For [Shareable Configs](https://eslint.org/docs/latest/developer-guide/shareable
156
181
 
157
182
  <!-- begin auto-generated configs list -->
158
183
 
159
- | | Name |
160
- | :- | :------------------------ |
161
- | 🟠 | `flat/mixed-esm-and-cjs` |
162
- | β˜‘οΈ | `flat/recommended` |
163
- | 🟒 | `flat/recommended-module` |
164
- | βœ… | `flat/recommended-script` |
165
- | β˜‘οΈ | `recommended` |
166
- | 🟒 | `recommended-module` |
167
- | βœ… | `recommended-script` |
184
+ | | Name |
185
+ | :- | :------------------- |
186
+ | 🟒 | `recommended-module` |
187
+ | βœ… | `recommended-script` |
168
188
 
169
189
  <!-- end auto-generated configs list -->
170
190
 
@@ -11,7 +11,7 @@ const promises_api = {
11
11
  chown: { [READ]: { supported: ["10.0.0"] } },
12
12
  constants: { [READ]: { supported: ["18.4.0", "16.17.0"] } },
13
13
  copyFile: { [READ]: { supported: ["10.0.0"] } },
14
- cp: { [READ]: { experimental: ["16.7.0"] } },
14
+ cp: { [READ]: { supported: ["22.3.0"], experimental: ["16.7.0"] } },
15
15
  glob: { [READ]: { experimental: ["22.0.0"] } },
16
16
  lchmod: { [READ]: { supported: ["10.0.0"], deprecated: ["10.0.0"] } },
17
17
  lchown: { [READ]: { supported: ["10.0.0"] } },
@@ -47,7 +47,7 @@ const callback_api = {
47
47
  chown: { [READ]: { supported: ["0.1.97"] } },
48
48
  close: { [READ]: { supported: ["0.0.2"] } },
49
49
  copyFile: { [READ]: { supported: ["8.5.0"] } },
50
- cp: { [READ]: { experimental: ["16.7.0"] } },
50
+ cp: { [READ]: { supported: ["22.3.0"], experimental: ["16.7.0"] } },
51
51
  createReadStream: { [READ]: { supported: ["0.1.31"] } },
52
52
  createWriteStream: { [READ]: { supported: ["0.1.31"] } },
53
53
  exists: { [READ]: { supported: ["0.0.2"], deprecated: ["1.0.0"] } },
@@ -104,7 +104,7 @@ const synchronous_api = {
104
104
  chownSync: { [READ]: { supported: ["0.1.97"] } },
105
105
  closeSync: { [READ]: { supported: ["0.1.21"] } },
106
106
  copyFileSync: { [READ]: { supported: ["8.5.0"] } },
107
- cpSync: { [READ]: { experimental: ["16.7.0"] } },
107
+ cpSync: { [READ]: { supported: ["22.3.0"], experimental: ["16.7.0"] } },
108
108
  existsSync: { [READ]: { supported: ["0.1.21"] } },
109
109
  fchmodSync: { [READ]: { supported: ["0.4.7"] } },
110
110
  fchownSync: { [READ]: { supported: ["0.4.7"] } },
@@ -20,6 +20,7 @@ const http = {
20
20
  ServerResponse: { [READ]: { supported: ["0.1.17"] } },
21
21
  IncomingMessage: { [READ]: { supported: ["0.1.17"] } },
22
22
  OutgoingMessage: { [READ]: { supported: ["0.1.17"] } },
23
+ WebSocket: { [READ]: { supported: ["22.5.0"] } },
23
24
  }
24
25
 
25
26
  /** @type {import('../types.js').SupportVersionTraceMap} */
@@ -10,6 +10,7 @@ const path = {
10
10
  dirname: { [READ]: { supported: ["0.1.16"] } },
11
11
  extname: { [READ]: { supported: ["0.1.25"] } },
12
12
  format: { [READ]: { supported: ["0.11.15"] } },
13
+ matchesGlob: { [READ]: { experimental: ["22.5.0"] } },
13
14
  isAbsolute: { [READ]: { supported: ["0.11.2"] } },
14
15
  join: { [READ]: { supported: ["0.1.16"] } },
15
16
  normalize: { [READ]: { supported: ["0.1.23"] } },
@@ -17,6 +17,12 @@ const process = {
17
17
  execArgv: { [READ]: { supported: ["0.7.7"] } },
18
18
  execPath: { [READ]: { supported: ["0.1.100"] } },
19
19
  exitCode: { [READ]: { supported: ["0.11.8"] } },
20
+ finalization: {
21
+ register: { [READ]: { experimental: ["22.5.0"] } },
22
+ registerBeforeExit: { [READ]: { experimental: ["22.5.0"] } },
23
+ unregister: { [READ]: { experimental: ["22.5.0"] } },
24
+ },
25
+ getBuiltinModule: { [READ]: { supported: ["22.3.0", "20.16.0"] } },
20
26
  mainModule: {
21
27
  [READ]: {
22
28
  supported: ["0.1.17"],
@@ -0,0 +1,17 @@
1
+ "use strict"
2
+
3
+ const { READ } = require("@eslint-community/eslint-utils")
4
+
5
+ /** @type {import('../types.js').SupportVersionTraceMap} */
6
+ const sqlite = {
7
+ DatabaseSync: { [READ]: { supported: ["22.5.0"] } },
8
+ StatementSync: { [READ]: { supported: ["22.5.0"] } },
9
+ }
10
+
11
+ /** @type {import('../types.js').SupportVersionTraceMap} */
12
+ module.exports = {
13
+ "node:sqlite": {
14
+ [READ]: { experimental: ["22.5.0"] },
15
+ ...sqlite,
16
+ },
17
+ }
@@ -30,7 +30,13 @@ const test = {
30
30
  after: { [READ]: { supported: ["18.8.0", "16.18.0"] } },
31
31
  beforeEach: { [READ]: { supported: ["18.8.0", "16.18.0"] } },
32
32
  afterEach: { [READ]: { supported: ["18.8.0", "16.18.0"] } },
33
+ snapshot: {
34
+ [READ]: { experimental: ["22.3.0"] },
35
+ setDefaultSnapshotSerializers: { [READ]: { experimental: ["22.3.0"] } },
36
+ setResolveSnapshotPath: { [READ]: { experimental: ["22.3.0"] } },
37
+ },
33
38
  MockFunctionContext: { [READ]: { supported: ["19.1.0", "18.13.0"] } },
39
+ MockModuleContext: { [READ]: { experimental: ["22.3.0"] } },
34
40
  MockTracker: { [READ]: { supported: ["19.1.0", "18.13.0"] } },
35
41
  MockTimers: { [READ]: { experimental: ["20.4.0"] } },
36
42
  TestsStream: { [READ]: { supported: ["18.9.0", "16.19.0"] } },
@@ -19,6 +19,7 @@ const worker_threads = {
19
19
  markAsUntransferable: { [READ]: { supported: ["14.5.0", "12.19.0"] } },
20
20
  isMarkedAsUntransferable: { [READ]: { supported: ["21.0.0"] } },
21
21
  moveMessagePortToContext: { [READ]: { supported: ["11.13.0"] } },
22
+ postMessageToThread: { [READ]: { experimental: ["22.5.0"] } },
22
23
  receiveMessageOnPort: { [READ]: { supported: ["12.3.0"] } },
23
24
  setEnvironmentData: {
24
25
  [READ]: {
@@ -5,7 +5,7 @@ const { READ } = require("@eslint-community/eslint-utils")
5
5
  /** @type {import('../types.js').SupportVersionTraceMap} */
6
6
  const zlib = {
7
7
  constants: { [READ]: { supported: ["7.0.0"] } },
8
- crc32: { [READ]: { supported: ["22.2.0"] } },
8
+ crc32: { [READ]: { supported: ["22.2.0", "20.15.0"] } },
9
9
  createBrotliCompress: { [READ]: { supported: ["11.7.0", "10.16.0"] } },
10
10
  createBrotliDecompress: { [READ]: { supported: ["11.7.0", "10.16.0"] } },
11
11
  createDeflate: { [READ]: { supported: ["0.5.8"] } },
@@ -90,7 +90,12 @@ const nodeGlobals = {
90
90
  [READ]: { experimental: ["17.5.0", "16.15.0"], supported: ["21.0.0"] },
91
91
  },
92
92
  WebAssembly: { [READ]: { supported: ["8.0.0"] } },
93
- WebSocket: { [READ]: { experimental: ["21.0.0", "20.10.0"] } },
93
+ WebSocket: {
94
+ [READ]: {
95
+ experimental: ["21.0.0", "20.10.0"],
96
+ supported: ["22.4.0"],
97
+ },
98
+ },
94
99
 
95
100
  fetch: {
96
101
  [READ]: { experimental: ["17.5.0", "16.15.0"], supported: ["21.0.0"] },
@@ -109,6 +114,11 @@ const nodeGlobals = {
109
114
  },
110
115
  structuredClone: { [READ]: { supported: ["17.0.0"] } },
111
116
 
117
+ // --experimental-webstorage
118
+ localStorage: { [READ]: { experimental: ["22.4.0"] } },
119
+ sessionStorage: { [READ]: { experimental: ["22.4.0"] } },
120
+ Storage: { [READ]: { experimental: ["22.4.0"] } },
121
+
112
122
  // module.buffer
113
123
  Blob: buffer.Blob,
114
124
  Buffer: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eslint-plugin-n",
3
- "version": "17.9.0",
3
+ "version": "17.10.0",
4
4
  "description": "Additional ESLint's rules for Node.js",
5
5
  "engines": {
6
6
  "node": "^18.18.0 || ^20.9.0 || >=21.1.0"
@@ -20,38 +20,38 @@
20
20
  "enhanced-resolve": "^5.17.0",
21
21
  "eslint-plugin-es-x": "^7.5.0",
22
22
  "get-tsconfig": "^4.7.0",
23
- "globals": "^15.0.0",
23
+ "globals": "^15.8.0",
24
24
  "ignore": "^5.2.4",
25
- "minimatch": "^9.0.0",
25
+ "minimatch": "^9.0.5",
26
26
  "semver": "^7.5.3"
27
27
  },
28
28
  "devDependencies": {
29
- "@eslint/js": "^9.0.0",
29
+ "@eslint/js": "^9.6.0",
30
30
  "@types/eslint": "^8.56.7",
31
31
  "@types/estree": "^1.0.5",
32
- "@types/node": "^20.11.0",
33
- "@typescript-eslint/parser": "^7.0.0",
34
- "@typescript-eslint/typescript-estree": "^7.0.0",
35
- "eslint": "^9.0.0",
32
+ "@types/node": "^20.14.9",
33
+ "@typescript-eslint/parser": "^7.15.0",
34
+ "@typescript-eslint/typescript-estree": "^7.15.0",
35
+ "eslint": "^9.6.0",
36
36
  "eslint-config-prettier": "^9.1.0",
37
37
  "eslint-doc-generator": "^1.6.1",
38
- "eslint-plugin-eslint-plugin": "^6.0.0",
38
+ "eslint-plugin-eslint-plugin": "^6.2.0",
39
39
  "eslint-plugin-n": "file:.",
40
40
  "fast-glob": "^3.2.12",
41
41
  "husky": "^9.0.0",
42
- "lint-staged": "^15.2.0",
42
+ "lint-staged": "^15.2.7",
43
43
  "markdownlint-cli": "^0.41.0",
44
- "mocha": "^10.2.0",
45
- "npm-run-all2": "^6.1.1",
46
- "nyc": "^15.1.0",
44
+ "mocha": "^10.6.0",
45
+ "npm-run-all2": "^6.2.2",
46
+ "nyc": "^17.0.0",
47
47
  "opener": "^1.5.2",
48
- "prettier": "^3.1.1",
48
+ "prettier": "^3.3.2",
49
49
  "punycode": "^2.3.0",
50
- "release-it": "^17.0.0",
51
- "rimraf": "^5.0.1",
50
+ "release-it": "^17.4.1",
51
+ "rimraf": "^5.0.7",
52
52
  "ts-ignore-import": "^4.0.1",
53
- "type-fest": "^4.9.0",
54
- "typescript": "^5.1.3"
53
+ "type-fest": "^4.21.0",
54
+ "typescript": "^5.5.3"
55
55
  },
56
56
  "scripts": {
57
57
  "build": "node scripts/update",
package/types/index.d.ts CHANGED
@@ -13,29 +13,6 @@ export = plugin;
13
13
  /** @type {import('eslint').ESLint.Plugin & { configs: Configs }} */
14
14
 
15
15
  // @ts-ignore
16
- declare const plugin: import('eslint').ESLint.Plugin & {
16
+ declare const plugin: import("eslint").ESLint.Plugin & {
17
17
  configs: Configs;
18
18
  };
19
- type Configs = {
20
-
21
- // @ts-ignore
22
- 'recommended-module': import('eslint').ESLint.ConfigData;
23
-
24
- // @ts-ignore
25
- 'recommended-script': import('eslint').ESLint.ConfigData;
26
-
27
- // @ts-ignore
28
- 'recommended': import('eslint').ESLint.ConfigData;
29
-
30
- // @ts-ignore
31
- 'flat/recommended-module': import('eslint').Linter.FlatConfig;
32
-
33
- // @ts-ignore
34
- 'flat/recommended-script': import('eslint').Linter.FlatConfig;
35
-
36
- // @ts-ignore
37
- 'flat/recommended': import('eslint').Linter.FlatConfig;
38
-
39
- // @ts-ignore
40
- 'flat/mixed-esm-and-cjs': import('eslint').Linter.FlatConfig[];
41
- };