Skip to content

Commit

Permalink
feat: Update no-unsupported to node v22.9.0 (#342)
Browse files Browse the repository at this point in the history
* feat: Node v20.17.0 #333

* feat: Node v22.6.0 #330

* feat: Node v22.7.0 #334

* feat: Add perf_hooks.performance to unsupported

* feat: Node v22.8.0 #335

* feat: Node v22.9.0 #340
  • Loading branch information
scagood authored Oct 9, 2024
1 parent 8c0a2cc commit 87fb484
Show file tree
Hide file tree
Showing 10 changed files with 186 additions and 13 deletions.
52 changes: 52 additions & 0 deletions lib/rules/no-deprecated-api.js
Original file line number Diff line number Diff line change
Expand Up @@ -330,6 +330,12 @@ const rawModules = {
},
},
},
nextTick: {
[READ]: {
since: "22.7.0",
replacedBy: "'queueMicrotask()'",
},
},
},
punycode: {
[READ]: {
Expand All @@ -351,6 +357,17 @@ const rawModules = {
[READ]: { since: "6.0.0", replacedBy: null },
},
},
repl: {
REPLServer: {
[READ]: { since: "22.9.0", replacedBy: "new repl.REPLServer()" },
},
Recoverable: {
[READ]: { since: "22.9.0", replacedBy: "new repl.Recoverable()" },
},
REPL_MODE_MAGIC: {
[READ]: { since: "8.0.0", replacedBy: null },
},
},
// safe-buffer.Buffer function/constructror is just a re-export of buffer.Buffer
// and should be deprecated likewise.
"safe-buffer": {
Expand Down Expand Up @@ -576,6 +593,41 @@ const rawModules = {
[READ]: { since: "8.0.0", replacedBy: null },
},
},
zlib: {
BrotliCompress: {
[CALL]: {
since: "22.9.0",
replacedBy: "new zlib.BrotliCompress()",
},
},
BrotliDecompress: {
[CALL]: {
since: "22.9.0",
replacedBy: "new zlib.BrotliDecompress()",
},
},
Deflate: {
[CALL]: { since: "22.9.0", replacedBy: "new zlib.Deflate()" },
},
DeflateRaw: {
[CALL]: { since: "22.9.0", replacedBy: "new zlib.DeflateRaw()" },
},
Gunzip: {
[CALL]: { since: "22.9.0", replacedBy: "new zlib.Gunzip()" },
},
Gzip: {
[CALL]: { since: "22.9.0", replacedBy: "new zlib.Gzip()" },
},
Inflate: {
[CALL]: { since: "22.9.0", replacedBy: "new zlib.Inflate()" },
},
InflateRaw: {
[CALL]: { since: "22.9.0", replacedBy: "new zlib.InflateRaw()" },
},
Unzip: {
[CALL]: { since: "22.9.0", replacedBy: "new zlib.Unzip()" },
},
},
}
const modules = extendTrackmapWithNodePrefix(rawModules)

Expand Down
6 changes: 6 additions & 0 deletions lib/unsupported-features/node-builtins-modules/inspector.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@ const { READ } = require("@eslint-community/eslint-utils")

/** @type {import('../types.js').SupportVersionTraceMap} */
const common_objects = {
Network: {
requestWillBeSent: { [READ]: { experimental: ["22.6.0"] } },
responseReceived: { [READ]: { experimental: ["22.6.0"] } },
loadingFinished: { [READ]: { experimental: ["22.6.0"] } },
loadingFailed: { [READ]: { experimental: ["22.7.0"] } },
},
console: { [READ]: { supported: ["8.0.0"] } },
close: { [READ]: { supported: ["9.0.0"] } },
open: { [READ]: { supported: ["8.0.0"] } },
Expand Down
7 changes: 7 additions & 0 deletions lib/unsupported-features/node-builtins-modules/module.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,20 @@ const { READ } = require("@eslint-community/eslint-utils")
/** @type {import('../types.js').SupportVersionTraceMap} */
const Module = {
builtinModules: { [READ]: { supported: ["9.3.0", "8.10.0", "6.13.0"] } },
constants: {
compileCacheStatus: {
[READ]: { experimental: ["22.8.0"] },
},
},
createRequire: { [READ]: { supported: ["12.2.0"] } },
createRequireFromPath: {
[READ]: {
supported: ["10.12.0"],
deprecated: ["12.2.0"],
},
},
enableCompileCache: { [READ]: { experimental: ["22.8.0"] } },
getCompileCacheDir: { [READ]: { experimental: ["22.8.0"] } },
isBuiltin: { [READ]: { supported: ["18.6.0", "16.17.0"] } },
register: { [READ]: { experimental: ["20.6.0"] } },
syncBuiltinESMExports: { [READ]: { supported: ["12.12.0"] } },
Expand Down
2 changes: 1 addition & 1 deletion lib/unsupported-features/node-builtins-modules/path.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const path = {
dirname: { [READ]: { supported: ["0.1.16"] } },
extname: { [READ]: { supported: ["0.1.25"] } },
format: { [READ]: { supported: ["0.11.15"] } },
matchesGlob: { [READ]: { experimental: ["22.5.0"] } },
matchesGlob: { [READ]: { experimental: ["22.5.0", "20.17.0"] } },
isAbsolute: { [READ]: { supported: ["0.11.2"] } },
join: { [READ]: { supported: ["0.1.16"] } },
normalize: { [READ]: { supported: ["0.1.23"] } },
Expand Down
33 changes: 31 additions & 2 deletions lib/unsupported-features/node-builtins-modules/perf_hooks.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,36 @@ const { READ } = require("@eslint-community/eslint-utils")

/** @type {import('../types.js').SupportVersionTraceMap} */
const perf_hooks = {
performance: { [READ]: { supported: ["8.5.0"] } },
performance: {
[READ]: { supported: ["8.5.0"] },
clearMarks: { [READ]: { supported: ["8.5.0"] } },
clearMeasures: { [READ]: { supported: ["16.7.0"] } },
clearResourceTimings: { [READ]: { supported: ["18.2.0", "v16.17.0"] } },
eventLoopUtilization: { [READ]: { supported: ["14.10.0", "12.19.0"] } },
getEntries: { [READ]: { supported: ["16.7.0"] } },
getEntriesByName: { [READ]: { supported: ["16.7.0"] } },
getEntriesByType: { [READ]: { supported: ["16.7.0"] } },
mark: { [READ]: { supported: ["8.5.0"] } },
markResourceTiming: { [READ]: { supported: ["8.2.0", "16.17.0"] } },
measure: { [READ]: { supported: ["8.5.0"] } },
nodeTiming: {
[READ]: { supported: ["8.5.0"] },
bootstrapComplete: { [READ]: { supported: ["8.5.0"] } },
environment: { [READ]: { supported: ["8.5.0"] } },
idleTime: { [READ]: { supported: ["14.10.0", "12.19.0"] } },
loopExit: { [READ]: { supported: ["8.5.0"] } },
loopStart: { [READ]: { supported: ["8.5.0"] } },
nodeStart: { [READ]: { supported: ["8.5.0"] } },
uvMetricsInfo: { [READ]: { supported: ["22.8.0"] } },
v8Start: { [READ]: { supported: ["8.5.0"] } },
},
now: { [READ]: { supported: ["8.5.0"] } },
onresourcetimingbufferfull: { [READ]: { supported: ["18.8.0"] } },
setResourceTimingBufferSize: { [READ]: { supported: ["18.8.0"] } },
timeOrigin: { [READ]: { supported: ["8.5.0"] } },
timerify: { [READ]: { supported: ["8.5.0"] } },
toJSON: { [READ]: { supported: ["16.1.0"] } },
},
createHistogram: { [READ]: { supported: ["15.9.0", "14.18.0"] } },
monitorEventLoopDelay: { [READ]: { supported: ["11.10.0"] } },
PerformanceEntry: { [READ]: { supported: ["8.5.0"] } },
Expand All @@ -16,7 +45,7 @@ const perf_hooks = {
PerformanceObserver: { [READ]: { supported: ["8.5.0"] } },
PerformanceObserverEntryList: { [READ]: { supported: ["8.5.0"] } },
Histogram: { [READ]: { supported: ["11.10.0"] } },
IntervalHistogram: { [READ]: { supported: ["8.5.0"] } },
IntervalHistogram: { [READ]: { supported: ["11.10.0"] } },
RecordableHistogram: { [READ]: { supported: ["15.9.0", "14.18.0"] } },
}

Expand Down
49 changes: 49 additions & 0 deletions lib/unsupported-features/node-builtins-modules/repl.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
"use strict"

const { CALL, READ } = require("@eslint-community/eslint-utils")

/** @type {import('../types.js').SupportVersionTraceMap} */
const repl = {
start: {
[READ]: { supported: ["0.1.91"] },
},
writer: {
[READ]: { supported: ["0.1.91"] },
},
REPLServer: {
[READ]: { supported: ["0.1.91"] },
[CALL]: { deprecated: ["22.9.0"] },
},
REPL_MODE_MAGIC: {
[READ]: {
supported: ["4.0.0"],
deprecated: ["8.0.0"],
// removed: ['10.0.0'],
},
},
REPL_MODE_SLOPPY: {
[READ]: { supported: ["4.0.0"] },
},
REPL_MODE_STRICT: {
[READ]: { supported: ["4.0.0"] },
},
Recoverable: {
[READ]: { supported: ["6.2.0"] },
[CALL]: { deprecated: ["22.9.0"] },
},
builtinModules: {
[READ]: { supported: ["14.5.0"] },
},
}

/** @type {import('../types.js').SupportVersionTraceMap} */
module.exports = {
repl: {
[READ]: { supported: ["0.1.91"] },
...repl,
},
"node:repl": {
[READ]: { supported: ["14.13.1", "12.20.0"] },
...repl,
},
}
1 change: 1 addition & 0 deletions lib/unsupported-features/node-builtins-modules/stream.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,7 @@ const Stream = {
finished: { [READ]: { supported: ["10.0.0"] } },
pipeline: { [READ]: { supported: ["10.0.0"] } },
compose: { [READ]: { supported: ["16.9.0"] } },
duplexPair: { [READ]: { supported: ["22.6.0", "20.17.0"] } },

Readable,
Writable,
Expand Down
1 change: 1 addition & 0 deletions lib/unsupported-features/node-builtins-modules/util.js
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,7 @@ const util = {
deprecate: { [READ]: { supported: ["0.8.0"] } },
format: { [READ]: { supported: ["0.5.3"] } },
formatWithOptions: { [READ]: { supported: ["10.0.0"] } },
getCallSite: { [READ]: { supported: ["22.9.0"] } },
getSystemErrorName: { [READ]: { supported: ["9.7.0", "8.12.0"] } },
getSystemErrorMap: { [READ]: { supported: ["16.0.0", "14.17.0"] } },
inherits: { [READ]: { supported: ["0.3.0"] } },
Expand Down
47 changes: 37 additions & 10 deletions lib/unsupported-features/node-builtins-modules/zlib.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
"use strict"

const { READ } = require("@eslint-community/eslint-utils")
const { CALL, READ } = require("@eslint-community/eslint-utils")

/** @type {import('../types.js').SupportVersionTraceMap} */
const zlib = {
Expand Down Expand Up @@ -33,15 +33,42 @@ const zlib = {
inflateRawSync: { [READ]: { supported: ["0.11.12"] } },
unzip: { [READ]: { supported: ["0.6.0"] } },
unzipSync: { [READ]: { supported: ["0.11.12"] } },
BrotliCompress: { [READ]: { supported: ["11.7.0", "10.16.0"] } },
BrotliDecompress: { [READ]: { supported: ["11.7.0", "10.16.0"] } },
Deflate: { [READ]: { supported: ["0.5.8"] } },
DeflateRaw: { [READ]: { supported: ["0.5.8"] } },
Gunzip: { [READ]: { supported: ["0.5.8"] } },
Gzip: { [READ]: { supported: ["0.5.8"] } },
Inflate: { [READ]: { supported: ["0.5.8"] } },
InflateRaw: { [READ]: { supported: ["0.5.8"] } },
Unzip: { [READ]: { supported: ["0.5.8"] } },
BrotliCompress: {
[CALL]: { deprecated: ["22.9.0"] },
[READ]: { supported: ["11.7.0", "10.16.0"] },
},
BrotliDecompress: {
[CALL]: { deprecated: ["22.9.0"] },
[READ]: { supported: ["11.7.0", "10.16.0"] },
},
Deflate: {
[CALL]: { deprecated: ["22.9.0"] },
[READ]: { supported: ["0.5.8"] },
},
DeflateRaw: {
[CALL]: { deprecated: ["22.9.0"] },
[READ]: { supported: ["0.5.8"] },
},
Gunzip: {
[CALL]: { deprecated: ["22.9.0"] },
[READ]: { supported: ["0.5.8"] },
},
Gzip: {
[CALL]: { deprecated: ["22.9.0"] },
[READ]: { supported: ["0.5.8"] },
},
Inflate: {
[CALL]: { deprecated: ["22.9.0"] },
[READ]: { supported: ["0.5.8"] },
},
InflateRaw: {
[CALL]: { deprecated: ["22.9.0"] },
[READ]: { supported: ["0.5.8"] },
},
Unzip: {
[CALL]: { deprecated: ["22.9.0"] },
[READ]: { supported: ["0.5.8"] },
},
}

/** @type {import('../types.js').SupportVersionTraceMap} */
Expand Down
1 change: 1 addition & 0 deletions lib/unsupported-features/node-builtins.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ const NodeBuiltinModules = {
...require("./node-builtins-modules/punycode.js"),
...require("./node-builtins-modules/querystring.js"),
...require("./node-builtins-modules/readline.js"),
...require("./node-builtins-modules/repl.js"),
...require("./node-builtins-modules/sea.js"),
...require("./node-builtins-modules/stream.js"),
...require("./node-builtins-modules/string_decoder.js"),
Expand Down

0 comments on commit 87fb484

Please sign in to comment.