Skip to content

Commit 5860795

Browse files
committed
Breaking: update no-deprecated-api rule
1 parent 044ecce commit 5860795

File tree

2 files changed

+71
-0
lines changed

2 files changed

+71
-0
lines changed

Diff for: docs/rules/no-deprecated-api.md

+30
Original file line numberDiff line numberDiff line change
@@ -37,12 +37,16 @@ This rule reports the following deprecated API.
3737
- [SlowBuffer class](https://nodejs.org/dist/v6.0.0/docs/api/buffer.html#buffer_class_slowbuffer)
3838
- constants (undocumented)
3939
- crypto
40+
- [_toBuf](https://nodejs.org/dist/v11.0.0/docs/api/deprecations.html#deprecations_dep0114_crypto_tobuf)
4041
- `Credentials` (undocumented)
4142
- [DEFAULT_ENCODING](https://nodejs.org/dist/v10.0.0/docs/api/crypto.html#crypto_crypto_default_encoding)
4243
- [createCredentials](https://nodejs.org/dist/v0.12.0/docs/api/crypto.html#crypto_crypto_createcredentials_details)
4344
- [createCipher](https://nodejs.org/dist/v10.0.0/docs/api/crypto.html#crypto_crypto_createcipher_algorithm_password_options)
4445
- [createDecipher](https://nodejs.org/dist/v10.0.0/docs/api/crypto.html#crypto_crypto_createdecipher_algorithm_password_options)
4546
- [fips](https://nodejs.org/dist/v10.0.0/docs/api/crypto.html#crypto_crypto_fips)
47+
- [prng](https://nodejs.org/dist/v11.0.0/docs/api/deprecations.html#deprecations_dep0115_crypto_prng_crypto_pseudorandombytes_crypto_rng)
48+
- [pseudoRandomBytes](https://nodejs.org/dist/v11.0.0/docs/api/deprecations.html#deprecations_dep0115_crypto_prng_crypto_pseudorandombytes_crypto_rng)
49+
- [rng](https://nodejs.org/dist/v11.0.0/docs/api/deprecations.html#deprecations_dep0115_crypto_prng_crypto_pseudorandombytes_crypto_rng)
4650
- [domain](https://nodejs.org/dist/v4.0.0/docs/api/domain.html#domain_domain)
4751
- events
4852
- [EventEmitter.listenerCount](https://nodejs.org/dist/v4.0.0/docs/api/events.html#events_class_method_eventemitter_listenercount_emitter_event)
@@ -59,6 +63,12 @@ This rule reports the following deprecated API.
5963
- [GLOBAL](https://nodejs.org/api/deprecations.html#deprecations_dep0016_global_root)
6064
- [root](https://nodejs.org/api/deprecations.html#deprecations_dep0016_global_root)
6165
- [Intl.v8BreakIterator](https://nodejs.org/api/deprecations.html#deprecations_dep0017_intl_v8breakiterator)
66+
- [COUNTER_NET_SERVER_CONNECTION](https://nodejs.org/dist/v11.0.0/docs/api/deprecations.html#deprecations_dep0120_windows_performance_counter_support)
67+
- [COUNTER_NET_SERVER_CONNECTION_CLOSE](https://nodejs.org/dist/v11.0.0/docs/api/deprecations.html#deprecations_dep0120_windows_performance_counter_support)
68+
- [COUNTER_HTTP_SERVER_REQUEST](https://nodejs.org/dist/v11.0.0/docs/api/deprecations.html#deprecations_dep0120_windows_performance_counter_support)
69+
- [COUNTER_HTTP_SERVER_RESPONSE](https://nodejs.org/dist/v11.0.0/docs/api/deprecations.html#deprecations_dep0120_windows_performance_counter_support)
70+
- [COUNTER_HTTP_CLIENT_REQUEST](https://nodejs.org/dist/v11.0.0/docs/api/deprecations.html#deprecations_dep0120_windows_performance_counter_support)
71+
- [COUNTER_HTTP_CLIENT_RESPONSE](https://nodejs.org/dist/v11.0.0/docs/api/deprecations.html#deprecations_dep0120_windows_performance_counter_support)
6272
- http
6373
- [createClient](https://nodejs.org/dist/v0.10.0/docs/api/http.html#http_http_createclient_port_host)
6474
- module
@@ -72,6 +82,7 @@ This rule reports the following deprecated API.
7282
- process
7383
- `EventEmitter` (undocumented)
7484
- `assert` (undocumented)
85+
- [binding](https://nodejs.org/dist/v10.9.0/docs/api/deprecations.html#deprecations_dep0111_process_binding)
7586
- [punycode](https://nodejs.org/dist/v7.0.0/docs/api/punycode.html)
7687
- readline
7788
- `codePointAt` (undocumented)
@@ -94,6 +105,9 @@ This rule reports the following deprecated API.
94105
- [parseCertString](https://nodejs.org/dist/v8.6.0/docs/api/deprecations.html#deprecations_dep0076_tls_parsecertstring)
95106
- tty
96107
- [setRawMode](https://nodejs.org/dist/v0.10.0/docs/api/tty.html#tty_tty_setrawmode_mode)
108+
- url
109+
- [parse](https://nodejs.org/dist/v11.0.0/docs/api/deprecations.html#deprecations_dep0116_legacy_url_api)
110+
- [resolve](https://nodejs.org/dist/v11.0.0/docs/api/deprecations.html#deprecations_dep0116_legacy_url_api)
97111
- util
98112
- [debug](https://nodejs.org/dist/v0.12.0/docs/api/util.html#util_util_debug_string)
99113
- [error](https://nodejs.org/dist/v0.12.0/docs/api/util.html#util_util_error)
@@ -158,12 +172,16 @@ This option can include the following values:
158172
- `new buffer.Buffer()`
159173
- `buffer.SlowBuffer`
160174
- `constants`
175+
- `crypto._toBuf`
161176
- `crypto.Credentials`
162177
- `crypto.DEFAULT_ENCODING`
163178
- `crypto.createCipher`
164179
- `crypto.createCredentials`
165180
- `crypto.createDecipher`
166181
- `crypto.fips`
182+
- `crypto.prng`
183+
- `crypto.pseudoRandomBytes`
184+
- `crypto.rng`
167185
- `domain`
168186
- `events.EventEmitter.listenerCount`
169187
- `events.listenerCount`
@@ -183,6 +201,7 @@ This option can include the following values:
183201
- `path._makeLong`
184202
- `process.EventEmitter`
185203
- `process.assert`
204+
- `process.binding`
186205
- `process.env.NODE_REPL_HISTORY_FILE`
187206
- `punycode`
188207
- `readline.codePointAt`
@@ -199,6 +218,8 @@ This option can include the following values:
199218
- `tls.createSecurePair`
200219
- `tls.parseCertString`
201220
- `tty.setRawMode`
221+
- `url.parse`
222+
- `url.resolve`
202223
- `util.debug`
203224
- `util.error`
204225
- `util.isArray`
@@ -242,10 +263,17 @@ This option can include the following values:
242263

243264
- `Buffer()`
244265
- `new Buffer()`
266+
- `COUNTER_NET_SERVER_CONNECTION`
267+
- `COUNTER_NET_SERVER_CONNECTION_CLOSE`
268+
- `COUNTER_HTTP_SERVER_REQUEST`
269+
- `COUNTER_HTTP_SERVER_RESPONSE`
270+
- `COUNTER_HTTP_CLIENT_REQUEST`
271+
- `COUNTER_HTTP_CLIENT_RESPONSE`
245272
- `Intl.v8BreakIterator`
246273
- `require.extensions`
247274
- `process.EventEmitter`
248275
- `process.assert`
276+
- `process.binding`
249277
- `process.env.NODE_REPL_HISTORY_FILE`
250278

251279
Examples of :+1: **correct** code for the `{"ignoreGlobalItems": ["new Buffer()"]}`:
@@ -283,6 +311,8 @@ This rule cannot report the following cases:
283311

284312
- fs
285313
- `fs.truncate()` and `fs.truncateSync()` usage with a file descriptor has been deprecated.
314+
- url
315+
- `url.format()` with legacy `urlObject` has been deprecated.
286316

287317
### dynamic things
288318

Diff for: lib/rules/no-deprecated-api.js

+41
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,9 @@ const modules = {
8080
},
8181
},
8282
crypto: {
83+
_toBuf: {
84+
[READ]: { since: "11.0.0", replacedBy: null },
85+
},
8386
Credentials: {
8487
[READ]: { since: "0.12.0", replacedBy: "'tls.SecureContext'" },
8588
},
@@ -104,6 +107,15 @@ const modules = {
104107
replacedBy: "'crypto.getFips()' and 'crypto.setFips()'",
105108
},
106109
},
110+
prng: {
111+
[READ]: { since: "11.0.0", replacedBy: "'crypto.randomBytes()'" },
112+
},
113+
pseudoRandomBytes: {
114+
[READ]: { since: "11.0.0", replacedBy: "'crypto.randomBytes()'" },
115+
},
116+
rng: {
117+
[READ]: { since: "11.0.0", replacedBy: "'crypto.randomBytes()'" },
118+
},
107119
},
108120
domain: {
109121
[READ]: { since: "4.0.0", replacedBy: null },
@@ -191,6 +203,9 @@ const modules = {
191203
assert: {
192204
[READ]: { since: "10.0.0", replacedBy: "'require(\"assert\")'" },
193205
},
206+
binding: {
207+
[READ]: { since: "10.9.0", replacedBy: null },
208+
},
194209
env: {
195210
NODE_REPL_HISTORY_FILE: {
196211
[READ]: { since: "4.0.0", replacedBy: "'NODE_REPL_HISTORY'" },
@@ -283,6 +298,14 @@ const modules = {
283298
},
284299
},
285300
},
301+
url: {
302+
parse: {
303+
[READ]: { since: "11.0.0", replacedBy: "'url.URL' constructor" },
304+
},
305+
resolve: {
306+
[READ]: { since: "11.0.0", replacedBy: "'url.URL' constructor" },
307+
},
308+
},
286309
util: {
287310
debug: {
288311
[READ]: { since: "0.12.0", replacedBy: "'console.error()'" },
@@ -368,6 +391,24 @@ const globals = {
368391
replacedBy: "'Buffer.alloc()' or 'Buffer.from()'",
369392
},
370393
},
394+
COUNTER_NET_SERVER_CONNECTION: {
395+
[READ]: { since: "11.0.0", replacedBy: null },
396+
},
397+
COUNTER_NET_SERVER_CONNECTION_CLOSE: {
398+
[READ]: { since: "11.0.0", replacedBy: null },
399+
},
400+
COUNTER_HTTP_SERVER_REQUEST: {
401+
[READ]: { since: "11.0.0", replacedBy: null },
402+
},
403+
COUNTER_HTTP_SERVER_RESPONSE: {
404+
[READ]: { since: "11.0.0", replacedBy: null },
405+
},
406+
COUNTER_HTTP_CLIENT_REQUEST: {
407+
[READ]: { since: "11.0.0", replacedBy: null },
408+
},
409+
COUNTER_HTTP_CLIENT_RESPONSE: {
410+
[READ]: { since: "11.0.0", replacedBy: null },
411+
},
371412
GLOBAL: {
372413
[READ]: { since: "6.0.0", replacedBy: "'global'" },
373414
},

0 commit comments

Comments
 (0)