diff --git a/lib/rules/no-unsupported-features/es-builtins.js b/lib/rules/no-unsupported-features/es-builtins.js index c63b634b..9122ef0f 100644 --- a/lib/rules/no-unsupported-features/es-builtins.js +++ b/lib/rules/no-unsupported-features/es-builtins.js @@ -16,604 +16,604 @@ const trackMap = { globals: { // Core js builtins AggregateError: { - [READ]: { supported: "15.0.0" }, + [READ]: { supported: ["15.0.0"] }, }, Array: { - [READ]: { supported: "0.10.0" }, - from: { [READ]: { supported: "4.0.0" } }, - isArray: { [READ]: { supported: "0.10.0" } }, - length: { [READ]: { supported: "0.10.0" } }, - of: { [READ]: { supported: "4.0.0" } }, - toLocaleString: { [READ]: { supported: "0.10.0" } }, + [READ]: { supported: ["0.10.0"] }, + from: { [READ]: { supported: ["4.0.0"] } }, + isArray: { [READ]: { supported: ["0.10.0"] } }, + length: { [READ]: { supported: ["0.10.0"] } }, + of: { [READ]: { supported: ["4.0.0"] } }, + toLocaleString: { [READ]: { supported: ["0.10.0"] } }, }, ArrayBuffer: { - [READ]: { supported: "0.10.0" }, - isView: { [READ]: { supported: "4.0.0" } }, + [READ]: { supported: ["0.10.0"] }, + isView: { [READ]: { supported: ["4.0.0"] } }, }, Atomics: { - [READ]: { supported: "8.10.0" }, - add: { [READ]: { supported: "8.10.0" } }, - and: { [READ]: { supported: "8.10.0" } }, - compareExchange: { [READ]: { supported: "8.10.0" } }, - exchange: { [READ]: { supported: "8.10.0" } }, - isLockFree: { [READ]: { supported: "8.10.0" } }, - load: { [READ]: { supported: "8.10.0" } }, - notify: { [READ]: { supported: "8.10.0" } }, - or: { [READ]: { supported: "8.10.0" } }, - store: { [READ]: { supported: "8.10.0" } }, - sub: { [READ]: { supported: "8.10.0" } }, - wait: { [READ]: { supported: "8.10.0" } }, - waitAsync: { [READ]: { supported: "16.0.0" } }, - xor: { [READ]: { supported: "8.10.0" } }, + [READ]: { supported: ["8.10.0"] }, + add: { [READ]: { supported: ["8.10.0"] } }, + and: { [READ]: { supported: ["8.10.0"] } }, + compareExchange: { [READ]: { supported: ["8.10.0"] } }, + exchange: { [READ]: { supported: ["8.10.0"] } }, + isLockFree: { [READ]: { supported: ["8.10.0"] } }, + load: { [READ]: { supported: ["8.10.0"] } }, + notify: { [READ]: { supported: ["8.10.0"] } }, + or: { [READ]: { supported: ["8.10.0"] } }, + store: { [READ]: { supported: ["8.10.0"] } }, + sub: { [READ]: { supported: ["8.10.0"] } }, + wait: { [READ]: { supported: ["8.10.0"] } }, + waitAsync: { [READ]: { supported: ["16.0.0"] } }, + xor: { [READ]: { supported: ["8.10.0"] } }, }, BigInt: { - [READ]: { supported: "10.4.0" }, - asIntN: { [READ]: { supported: "10.4.0" } }, - asUintN: { [READ]: { supported: "10.4.0" } }, + [READ]: { supported: ["10.4.0"] }, + asIntN: { [READ]: { supported: ["10.4.0"] } }, + asUintN: { [READ]: { supported: ["10.4.0"] } }, }, BigInt64Array: { - [READ]: { supported: "10.4.0" }, - BYTES_PER_ELEMENT: { [READ]: { supported: "0.10.0" } }, - from: { [READ]: { supported: "4.0.0" } }, - name: { [READ]: { supported: "0.10.0" } }, - of: { [READ]: { supported: "4.0.0" } }, + [READ]: { supported: ["10.4.0"] }, + BYTES_PER_ELEMENT: { [READ]: { supported: ["0.10.0"] } }, + from: { [READ]: { supported: ["4.0.0"] } }, + name: { [READ]: { supported: ["0.10.0"] } }, + of: { [READ]: { supported: ["4.0.0"] } }, }, BigUint64Array: { - [READ]: { supported: "10.4.0" }, - BYTES_PER_ELEMENT: { [READ]: { supported: "0.10.0" } }, - from: { [READ]: { supported: "4.0.0" } }, - name: { [READ]: { supported: "0.10.0" } }, - of: { [READ]: { supported: "4.0.0" } }, + [READ]: { supported: ["10.4.0"] }, + BYTES_PER_ELEMENT: { [READ]: { supported: ["0.10.0"] } }, + from: { [READ]: { supported: ["4.0.0"] } }, + name: { [READ]: { supported: ["0.10.0"] } }, + of: { [READ]: { supported: ["4.0.0"] } }, }, Boolean: { - [READ]: { supported: "0.10.0" }, + [READ]: { supported: ["0.10.0"] }, }, DataView: { - [READ]: { supported: "0.10.0" }, + [READ]: { supported: ["0.10.0"] }, }, Date: { - [READ]: { supported: "0.10.0" }, - UTC: { [READ]: { supported: "0.10.0" } }, - now: { [READ]: { supported: "0.10.0" } }, - parse: { [READ]: { supported: "0.10.0" } }, - toLocaleDateString: { [READ]: { supported: "0.10.0" } }, - toLocaleString: { [READ]: { supported: "0.10.0" } }, - toLocaleTimeString: { [READ]: { supported: "0.10.0" } }, + [READ]: { supported: ["0.10.0"] }, + UTC: { [READ]: { supported: ["0.10.0"] } }, + now: { [READ]: { supported: ["0.10.0"] } }, + parse: { [READ]: { supported: ["0.10.0"] } }, + toLocaleDateString: { [READ]: { supported: ["0.10.0"] } }, + toLocaleString: { [READ]: { supported: ["0.10.0"] } }, + toLocaleTimeString: { [READ]: { supported: ["0.10.0"] } }, }, Error: { - [READ]: { supported: "0.10.0" }, - cause: { [READ]: { supported: "16.9.0" } }, + [READ]: { supported: ["0.10.0"] }, + cause: { [READ]: { supported: ["16.9.0"] } }, }, EvalError: { - [READ]: { supported: "0.10.0" }, + [READ]: { supported: ["0.10.0"] }, }, FinalizationRegistry: { - [READ]: { supported: "14.6.0" }, + [READ]: { supported: ["14.6.0"] }, }, Float32Array: { - [READ]: { supported: "0.10.0" }, - BYTES_PER_ELEMENT: { [READ]: { supported: "0.10.0" } }, - from: { [READ]: { supported: "4.0.0" } }, - name: { [READ]: { supported: "0.10.0" } }, - of: { [READ]: { supported: "4.0.0" } }, + [READ]: { supported: ["0.10.0"] }, + BYTES_PER_ELEMENT: { [READ]: { supported: ["0.10.0"] } }, + from: { [READ]: { supported: ["4.0.0"] } }, + name: { [READ]: { supported: ["0.10.0"] } }, + of: { [READ]: { supported: ["4.0.0"] } }, }, Float64Array: { - [READ]: { supported: "0.10.0" }, - BYTES_PER_ELEMENT: { [READ]: { supported: "0.10.0" } }, - from: { [READ]: { supported: "4.0.0" } }, - name: { [READ]: { supported: "0.10.0" } }, - of: { [READ]: { supported: "4.0.0" } }, + [READ]: { supported: ["0.10.0"] }, + BYTES_PER_ELEMENT: { [READ]: { supported: ["0.10.0"] } }, + from: { [READ]: { supported: ["4.0.0"] } }, + name: { [READ]: { supported: ["0.10.0"] } }, + of: { [READ]: { supported: ["4.0.0"] } }, }, Function: { - [READ]: { supported: "0.10.0" }, - length: { [READ]: { supported: "0.10.0" } }, - name: { [READ]: { supported: "0.10.0" } }, + [READ]: { supported: ["0.10.0"] }, + length: { [READ]: { supported: ["0.10.0"] } }, + name: { [READ]: { supported: ["0.10.0"] } }, }, Infinity: { - [READ]: { supported: "0.10.0" }, + [READ]: { supported: ["0.10.0"] }, }, Int16Array: { - [READ]: { supported: "0.10.0" }, - BYTES_PER_ELEMENT: { [READ]: { supported: "0.10.0" } }, - from: { [READ]: { supported: "4.0.0" } }, - name: { [READ]: { supported: "0.10.0" } }, - of: { [READ]: { supported: "4.0.0" } }, + [READ]: { supported: ["0.10.0"] }, + BYTES_PER_ELEMENT: { [READ]: { supported: ["0.10.0"] } }, + from: { [READ]: { supported: ["4.0.0"] } }, + name: { [READ]: { supported: ["0.10.0"] } }, + of: { [READ]: { supported: ["4.0.0"] } }, }, Int32Array: { - [READ]: { supported: "0.10.0" }, - BYTES_PER_ELEMENT: { [READ]: { supported: "0.10.0" } }, - from: { [READ]: { supported: "4.0.0" } }, - name: { [READ]: { supported: "0.10.0" } }, - of: { [READ]: { supported: "4.0.0" } }, + [READ]: { supported: ["0.10.0"] }, + BYTES_PER_ELEMENT: { [READ]: { supported: ["0.10.0"] } }, + from: { [READ]: { supported: ["4.0.0"] } }, + name: { [READ]: { supported: ["0.10.0"] } }, + of: { [READ]: { supported: ["4.0.0"] } }, }, Int8Array: { - [READ]: { supported: "0.10.0" }, - BYTES_PER_ELEMENT: { [READ]: { supported: "0.10.0" } }, - from: { [READ]: { supported: "4.0.0" } }, - name: { [READ]: { supported: "0.10.0" } }, - of: { [READ]: { supported: "4.0.0" } }, + [READ]: { supported: ["0.10.0"] }, + BYTES_PER_ELEMENT: { [READ]: { supported: ["0.10.0"] } }, + from: { [READ]: { supported: ["4.0.0"] } }, + name: { [READ]: { supported: ["0.10.0"] } }, + of: { [READ]: { supported: ["4.0.0"] } }, }, Intl: { - [READ]: { supported: "0.12.0" }, - Collator: { [READ]: { supported: "0.12.0" } }, - DateTimeFormat: { [READ]: { supported: "0.12.0" } }, - DisplayNames: { [READ]: { supported: "14.0.0" } }, - ListFormat: { [READ]: { supported: "12.0.0" } }, - Locale: { [READ]: { supported: "12.0.0" } }, - NumberFormat: { [READ]: { supported: "0.12.0" } }, - PluralRules: { [READ]: { supported: "10.0.0" } }, - RelativeTimeFormat: { [READ]: { supported: "12.0.0" } }, - Segmenter: { [READ]: { supported: "16.0.0" } }, - Segments: { [READ]: { supported: "16.0.0" } }, - getCanonicalLocales: { [READ]: { supported: "7.0.0" } }, - supportedValuesOf: { [READ]: { supported: "18.0.0" } }, + [READ]: { supported: ["0.12.0"] }, + Collator: { [READ]: { supported: ["0.12.0"] } }, + DateTimeFormat: { [READ]: { supported: ["0.12.0"] } }, + DisplayNames: { [READ]: { supported: ["14.0.0"] } }, + ListFormat: { [READ]: { supported: ["12.0.0"] } }, + Locale: { [READ]: { supported: ["12.0.0"] } }, + NumberFormat: { [READ]: { supported: ["0.12.0"] } }, + PluralRules: { [READ]: { supported: ["10.0.0"] } }, + RelativeTimeFormat: { [READ]: { supported: ["12.0.0"] } }, + Segmenter: { [READ]: { supported: ["16.0.0"] } }, + Segments: { [READ]: { supported: ["16.0.0"] } }, + getCanonicalLocales: { [READ]: { supported: ["7.0.0"] } }, + supportedValuesOf: { [READ]: { supported: ["18.0.0"] } }, }, JSON: { - [READ]: { supported: "0.10.0" }, - parse: { [READ]: { supported: "0.10.0" } }, - stringify: { [READ]: { supported: "0.10.0" } }, + [READ]: { supported: ["0.10.0"] }, + parse: { [READ]: { supported: ["0.10.0"] } }, + stringify: { [READ]: { supported: ["0.10.0"] } }, }, Map: { - [READ]: { supported: "0.12.0" }, - groupBy: { [READ]: { supported: "21.0.0" } }, + [READ]: { supported: ["0.12.0"] }, + groupBy: { [READ]: { supported: ["21.0.0"] } }, }, Math: { - [READ]: { supported: "0.10.0" }, - E: { [READ]: { supported: "0.10.0" } }, - LN10: { [READ]: { supported: "0.10.0" } }, - LN2: { [READ]: { supported: "0.10.0" } }, - LOG10E: { [READ]: { supported: "0.10.0" } }, - LOG2E: { [READ]: { supported: "0.10.0" } }, - PI: { [READ]: { supported: "0.10.0" } }, - SQRT1_2: { [READ]: { supported: "0.10.0" } }, - SQRT2: { [READ]: { supported: "0.10.0" } }, - abs: { [READ]: { supported: "0.10.0" } }, - acos: { [READ]: { supported: "0.10.0" } }, - acosh: { [READ]: { supported: "0.12.0" } }, - asin: { [READ]: { supported: "0.10.0" } }, - asinh: { [READ]: { supported: "0.12.0" } }, - atan: { [READ]: { supported: "0.10.0" } }, - atan2: { [READ]: { supported: "0.10.0" } }, - atanh: { [READ]: { supported: "0.12.0" } }, - cbrt: { [READ]: { supported: "0.12.0" } }, - ceil: { [READ]: { supported: "0.10.0" } }, - clz32: { [READ]: { supported: "0.12.0" } }, - cos: { [READ]: { supported: "0.10.0" } }, - cosh: { [READ]: { supported: "0.12.0" } }, - exp: { [READ]: { supported: "0.10.0" } }, - expm1: { [READ]: { supported: "0.12.0" } }, - floor: { [READ]: { supported: "0.10.0" } }, - fround: { [READ]: { supported: "0.12.0" } }, - hypot: { [READ]: { supported: "0.12.0" } }, - imul: { [READ]: { supported: "0.12.0" } }, - log: { [READ]: { supported: "0.10.0" } }, - log10: { [READ]: { supported: "0.12.0" } }, - log1p: { [READ]: { supported: "0.12.0" } }, - log2: { [READ]: { supported: "0.12.0" } }, - max: { [READ]: { supported: "0.10.0" } }, - min: { [READ]: { supported: "0.10.0" } }, - pow: { [READ]: { supported: "0.10.0" } }, - random: { [READ]: { supported: "0.10.0" } }, - round: { [READ]: { supported: "0.10.0" } }, - sign: { [READ]: { supported: "0.12.0" } }, - sin: { [READ]: { supported: "0.10.0" } }, - sinh: { [READ]: { supported: "0.12.0" } }, - sqrt: { [READ]: { supported: "0.10.0" } }, - tan: { [READ]: { supported: "0.10.0" } }, - tanh: { [READ]: { supported: "0.12.0" } }, - trunc: { [READ]: { supported: "0.12.0" } }, + [READ]: { supported: ["0.10.0"] }, + E: { [READ]: { supported: ["0.10.0"] } }, + LN10: { [READ]: { supported: ["0.10.0"] } }, + LN2: { [READ]: { supported: ["0.10.0"] } }, + LOG10E: { [READ]: { supported: ["0.10.0"] } }, + LOG2E: { [READ]: { supported: ["0.10.0"] } }, + PI: { [READ]: { supported: ["0.10.0"] } }, + SQRT1_2: { [READ]: { supported: ["0.10.0"] } }, + SQRT2: { [READ]: { supported: ["0.10.0"] } }, + abs: { [READ]: { supported: ["0.10.0"] } }, + acos: { [READ]: { supported: ["0.10.0"] } }, + acosh: { [READ]: { supported: ["0.12.0"] } }, + asin: { [READ]: { supported: ["0.10.0"] } }, + asinh: { [READ]: { supported: ["0.12.0"] } }, + atan: { [READ]: { supported: ["0.10.0"] } }, + atan2: { [READ]: { supported: ["0.10.0"] } }, + atanh: { [READ]: { supported: ["0.12.0"] } }, + cbrt: { [READ]: { supported: ["0.12.0"] } }, + ceil: { [READ]: { supported: ["0.10.0"] } }, + clz32: { [READ]: { supported: ["0.12.0"] } }, + cos: { [READ]: { supported: ["0.10.0"] } }, + cosh: { [READ]: { supported: ["0.12.0"] } }, + exp: { [READ]: { supported: ["0.10.0"] } }, + expm1: { [READ]: { supported: ["0.12.0"] } }, + floor: { [READ]: { supported: ["0.10.0"] } }, + fround: { [READ]: { supported: ["0.12.0"] } }, + hypot: { [READ]: { supported: ["0.12.0"] } }, + imul: { [READ]: { supported: ["0.12.0"] } }, + log: { [READ]: { supported: ["0.10.0"] } }, + log10: { [READ]: { supported: ["0.12.0"] } }, + log1p: { [READ]: { supported: ["0.12.0"] } }, + log2: { [READ]: { supported: ["0.12.0"] } }, + max: { [READ]: { supported: ["0.10.0"] } }, + min: { [READ]: { supported: ["0.10.0"] } }, + pow: { [READ]: { supported: ["0.10.0"] } }, + random: { [READ]: { supported: ["0.10.0"] } }, + round: { [READ]: { supported: ["0.10.0"] } }, + sign: { [READ]: { supported: ["0.12.0"] } }, + sin: { [READ]: { supported: ["0.10.0"] } }, + sinh: { [READ]: { supported: ["0.12.0"] } }, + sqrt: { [READ]: { supported: ["0.10.0"] } }, + tan: { [READ]: { supported: ["0.10.0"] } }, + tanh: { [READ]: { supported: ["0.12.0"] } }, + trunc: { [READ]: { supported: ["0.12.0"] } }, }, NaN: { - [READ]: { supported: "0.10.0" }, + [READ]: { supported: ["0.10.0"] }, }, Number: { - // [READ]: { supported: "0.10.0" }, - EPSILON: { [READ]: { supported: "0.12.0" } }, - MAX_SAFE_INTEGER: { [READ]: { supported: "0.12.0" } }, - MAX_VALUE: { [READ]: { supported: "0.10.0" } }, - MIN_SAFE_INTEGER: { [READ]: { supported: "0.12.0" } }, - MIN_VALUE: { [READ]: { supported: "0.10.0" } }, - NEGATIVE_INFINITY: { [READ]: { supported: "0.10.0" } }, - NaN: { [READ]: { supported: "0.10.0" } }, - POSITIVE_INFINITY: { [READ]: { supported: "0.10.0" } }, - isFinite: { [READ]: { supported: "0.10.0" } }, - isInteger: { [READ]: { supported: "0.12.0" } }, - isNaN: { [READ]: { supported: "0.10.0" } }, - isSafeInteger: { [READ]: { supported: "0.12.0" } }, - parseFloat: { [READ]: { supported: "0.12.0" } }, - parseInt: { [READ]: { supported: "0.12.0" } }, - toLocaleString: { [READ]: { supported: "0.10.0" } }, + // [READ]: { supported: [ "0.10.0" ] }, + EPSILON: { [READ]: { supported: ["0.12.0"] } }, + MAX_SAFE_INTEGER: { [READ]: { supported: ["0.12.0"] } }, + MAX_VALUE: { [READ]: { supported: ["0.10.0"] } }, + MIN_SAFE_INTEGER: { [READ]: { supported: ["0.12.0"] } }, + MIN_VALUE: { [READ]: { supported: ["0.10.0"] } }, + NEGATIVE_INFINITY: { [READ]: { supported: ["0.10.0"] } }, + NaN: { [READ]: { supported: ["0.10.0"] } }, + POSITIVE_INFINITY: { [READ]: { supported: ["0.10.0"] } }, + isFinite: { [READ]: { supported: ["0.10.0"] } }, + isInteger: { [READ]: { supported: ["0.12.0"] } }, + isNaN: { [READ]: { supported: ["0.10.0"] } }, + isSafeInteger: { [READ]: { supported: ["0.12.0"] } }, + parseFloat: { [READ]: { supported: ["0.12.0"] } }, + parseInt: { [READ]: { supported: ["0.12.0"] } }, + toLocaleString: { [READ]: { supported: ["0.10.0"] } }, }, Object: { - // [READ]: { supported: "0.10.0" }, - assign: { [READ]: { supported: "4.0.0" } }, - create: { [READ]: { supported: "0.10.0" } }, - defineGetter: { [READ]: { supported: "0.10.0" } }, - defineProperties: { [READ]: { supported: "0.10.0" } }, - defineProperty: { [READ]: { supported: "0.10.0" } }, - defineSetter: { [READ]: { supported: "0.10.0" } }, - entries: { [READ]: { supported: "7.0.0" } }, - freeze: { [READ]: { supported: "0.10.0" } }, - fromEntries: { [READ]: { supported: "12.0.0" } }, - getOwnPropertyDescriptor: { [READ]: { supported: "0.10.0" } }, - getOwnPropertyDescriptors: { [READ]: { supported: "7.0.0" } }, - getOwnPropertyNames: { [READ]: { supported: "0.10.0" } }, - getOwnPropertySymbols: { [READ]: { supported: "0.12.0" } }, - getPrototypeOf: { [READ]: { supported: "0.10.0" } }, - groupBy: { [READ]: { supported: "21.0.0" } }, - hasOwn: { [READ]: { supported: "16.9.0" } }, - is: { [READ]: { supported: "0.10.0" } }, - isExtensible: { [READ]: { supported: "0.10.0" } }, - isFrozen: { [READ]: { supported: "0.10.0" } }, - isSealed: { [READ]: { supported: "0.10.0" } }, - keys: { [READ]: { supported: "0.10.0" } }, - lookupGetter: { [READ]: { supported: "0.10.0" } }, - lookupSetter: { [READ]: { supported: "0.10.0" } }, - preventExtensions: { [READ]: { supported: "0.10.0" } }, - proto: { [READ]: { supported: "0.10.0" } }, - seal: { [READ]: { supported: "0.10.0" } }, - setPrototypeOf: { [READ]: { supported: "0.12.0" } }, - values: { [READ]: { supported: "7.0.0" } }, + // [READ]: { supported: [ "0.10.0" ] }, + assign: { [READ]: { supported: ["4.0.0"] } }, + create: { [READ]: { supported: ["0.10.0"] } }, + defineGetter: { [READ]: { supported: ["0.10.0"] } }, + defineProperties: { [READ]: { supported: ["0.10.0"] } }, + defineProperty: { [READ]: { supported: ["0.10.0"] } }, + defineSetter: { [READ]: { supported: ["0.10.0"] } }, + entries: { [READ]: { supported: ["7.0.0"] } }, + freeze: { [READ]: { supported: ["0.10.0"] } }, + fromEntries: { [READ]: { supported: ["12.0.0"] } }, + getOwnPropertyDescriptor: { [READ]: { supported: ["0.10.0"] } }, + getOwnPropertyDescriptors: { [READ]: { supported: ["7.0.0"] } }, + getOwnPropertyNames: { [READ]: { supported: ["0.10.0"] } }, + getOwnPropertySymbols: { [READ]: { supported: ["0.12.0"] } }, + getPrototypeOf: { [READ]: { supported: ["0.10.0"] } }, + groupBy: { [READ]: { supported: ["21.0.0"] } }, + hasOwn: { [READ]: { supported: ["16.9.0"] } }, + is: { [READ]: { supported: ["0.10.0"] } }, + isExtensible: { [READ]: { supported: ["0.10.0"] } }, + isFrozen: { [READ]: { supported: ["0.10.0"] } }, + isSealed: { [READ]: { supported: ["0.10.0"] } }, + keys: { [READ]: { supported: ["0.10.0"] } }, + lookupGetter: { [READ]: { supported: ["0.10.0"] } }, + lookupSetter: { [READ]: { supported: ["0.10.0"] } }, + preventExtensions: { [READ]: { supported: ["0.10.0"] } }, + proto: { [READ]: { supported: ["0.10.0"] } }, + seal: { [READ]: { supported: ["0.10.0"] } }, + setPrototypeOf: { [READ]: { supported: ["0.12.0"] } }, + values: { [READ]: { supported: ["7.0.0"] } }, }, Promise: { - [READ]: { supported: "0.12.0" }, - all: { [READ]: { supported: "0.12.0" } }, - allSettled: { [READ]: { supported: "12.9.0" } }, - any: { [READ]: { supported: "15.0.0" } }, - race: { [READ]: { supported: "0.12.0" } }, - reject: { [READ]: { supported: "0.12.0" } }, - resolve: { [READ]: { supported: "0.12.0" } }, + [READ]: { supported: ["0.12.0"] }, + all: { [READ]: { supported: ["0.12.0"] } }, + allSettled: { [READ]: { supported: ["12.9.0"] } }, + any: { [READ]: { supported: ["15.0.0"] } }, + race: { [READ]: { supported: ["0.12.0"] } }, + reject: { [READ]: { supported: ["0.12.0"] } }, + resolve: { [READ]: { supported: ["0.12.0"] } }, }, Proxy: { - [READ]: { supported: "6.0.0" }, - revocable: { [READ]: { supported: "6.0.0" } }, + [READ]: { supported: ["6.0.0"] }, + revocable: { [READ]: { supported: ["6.0.0"] } }, }, RangeError: { - [READ]: { supported: "0.10.0" }, + [READ]: { supported: ["0.10.0"] }, }, ReferenceError: { - [READ]: { supported: "0.10.0" }, + [READ]: { supported: ["0.10.0"] }, }, Reflect: { - [READ]: { supported: "6.0.0" }, - apply: { [READ]: { supported: "6.0.0" } }, - construct: { [READ]: { supported: "6.0.0" } }, - defineProperty: { [READ]: { supported: "6.0.0" } }, - deleteProperty: { [READ]: { supported: "6.0.0" } }, - get: { [READ]: { supported: "6.0.0" } }, - getOwnPropertyDescriptor: { [READ]: { supported: "6.0.0" } }, - getPrototypeOf: { [READ]: { supported: "6.0.0" } }, - has: { [READ]: { supported: "6.0.0" } }, - isExtensible: { [READ]: { supported: "6.0.0" } }, - ownKeys: { [READ]: { supported: "6.0.0" } }, - preventExtensions: { [READ]: { supported: "6.0.0" } }, - set: { [READ]: { supported: "6.0.0" } }, - setPrototypeOf: { [READ]: { supported: "6.0.0" } }, + [READ]: { supported: ["6.0.0"] }, + apply: { [READ]: { supported: ["6.0.0"] } }, + construct: { [READ]: { supported: ["6.0.0"] } }, + defineProperty: { [READ]: { supported: ["6.0.0"] } }, + deleteProperty: { [READ]: { supported: ["6.0.0"] } }, + get: { [READ]: { supported: ["6.0.0"] } }, + getOwnPropertyDescriptor: { [READ]: { supported: ["6.0.0"] } }, + getPrototypeOf: { [READ]: { supported: ["6.0.0"] } }, + has: { [READ]: { supported: ["6.0.0"] } }, + isExtensible: { [READ]: { supported: ["6.0.0"] } }, + ownKeys: { [READ]: { supported: ["6.0.0"] } }, + preventExtensions: { [READ]: { supported: ["6.0.0"] } }, + set: { [READ]: { supported: ["6.0.0"] } }, + setPrototypeOf: { [READ]: { supported: ["6.0.0"] } }, }, RegExp: { - [READ]: { supported: "0.10.0" }, - dotAll: { [READ]: { supported: "8.10.0" } }, - hasIndices: { [READ]: { supported: "16.0.0" } }, - input: { [READ]: { supported: "0.10.0" } }, - lastIndex: { [READ]: { supported: "0.10.0" } }, - lastMatch: { [READ]: { supported: "0.10.0" } }, - lastParen: { [READ]: { supported: "0.10.0" } }, - leftContext: { [READ]: { supported: "0.10.0" } }, - n: { [READ]: { supported: "0.10.0" } }, - rightContext: { [READ]: { supported: "0.10.0" } }, + [READ]: { supported: ["0.10.0"] }, + dotAll: { [READ]: { supported: ["8.10.0"] } }, + hasIndices: { [READ]: { supported: ["16.0.0"] } }, + input: { [READ]: { supported: ["0.10.0"] } }, + lastIndex: { [READ]: { supported: ["0.10.0"] } }, + lastMatch: { [READ]: { supported: ["0.10.0"] } }, + lastParen: { [READ]: { supported: ["0.10.0"] } }, + leftContext: { [READ]: { supported: ["0.10.0"] } }, + n: { [READ]: { supported: ["0.10.0"] } }, + rightContext: { [READ]: { supported: ["0.10.0"] } }, }, Set: { - [READ]: { supported: "0.12.0" }, + [READ]: { supported: ["0.12.0"] }, }, SharedArrayBuffer: { - [READ]: { supported: "8.10.0" }, + [READ]: { supported: ["8.10.0"] }, }, String: { - [READ]: { supported: "0.10.0" }, - fromCharCode: { [READ]: { supported: "0.10.0" } }, - fromCodePoint: { [READ]: { supported: "4.0.0" } }, - length: { [READ]: { supported: "0.10.0" } }, - localeCompare: { [READ]: { supported: "0.10.0" } }, - raw: { [READ]: { supported: "4.0.0" } }, - toLocaleLowerCase: { [READ]: { supported: "0.10.0" } }, - toLocaleUpperCase: { [READ]: { supported: "0.10.0" } }, + [READ]: { supported: ["0.10.0"] }, + fromCharCode: { [READ]: { supported: ["0.10.0"] } }, + fromCodePoint: { [READ]: { supported: ["4.0.0"] } }, + length: { [READ]: { supported: ["0.10.0"] } }, + localeCompare: { [READ]: { supported: ["0.10.0"] } }, + raw: { [READ]: { supported: ["4.0.0"] } }, + toLocaleLowerCase: { [READ]: { supported: ["0.10.0"] } }, + toLocaleUpperCase: { [READ]: { supported: ["0.10.0"] } }, }, Symbol: { - [READ]: { supported: "0.12.0" }, - asyncIterator: { [READ]: { supported: "10.0.0" } }, - for: { [READ]: { supported: "0.12.0" } }, - hasInstance: { [READ]: { supported: "6.5.0" } }, - isConcatSpreadable: { [READ]: { supported: "6.0.0" } }, - iterator: { [READ]: { supported: "0.12.0" } }, - keyFor: { [READ]: { supported: "0.12.0" } }, - match: { [READ]: { supported: "6.0.0" } }, - matchAll: { [READ]: { supported: "12.0.0" } }, - replace: { [READ]: { supported: "6.0.0" } }, - search: { [READ]: { supported: "6.0.0" } }, - species: { [READ]: { supported: "6.5.0" } }, - split: { [READ]: { supported: "6.0.0" } }, - toPrimitive: { [READ]: { supported: "6.0.0" } }, - toStringTag: { [READ]: { supported: "6.0.0" } }, - unscopables: { [READ]: { supported: "0.12.0" } }, + [READ]: { supported: ["0.12.0"] }, + asyncIterator: { [READ]: { supported: ["10.0.0"] } }, + for: { [READ]: { supported: ["0.12.0"] } }, + hasInstance: { [READ]: { supported: ["6.5.0"] } }, + isConcatSpreadable: { [READ]: { supported: ["6.0.0"] } }, + iterator: { [READ]: { supported: ["0.12.0"] } }, + keyFor: { [READ]: { supported: ["0.12.0"] } }, + match: { [READ]: { supported: ["6.0.0"] } }, + matchAll: { [READ]: { supported: ["12.0.0"] } }, + replace: { [READ]: { supported: ["6.0.0"] } }, + search: { [READ]: { supported: ["6.0.0"] } }, + species: { [READ]: { supported: ["6.5.0"] } }, + split: { [READ]: { supported: ["6.0.0"] } }, + toPrimitive: { [READ]: { supported: ["6.0.0"] } }, + toStringTag: { [READ]: { supported: ["6.0.0"] } }, + unscopables: { [READ]: { supported: ["0.12.0"] } }, }, SyntaxError: { - [READ]: { supported: "0.10.0" }, + [READ]: { supported: ["0.10.0"] }, }, TypeError: { - [READ]: { supported: "0.10.0" }, + [READ]: { supported: ["0.10.0"] }, }, URIError: { - [READ]: { supported: "0.10.0" }, + [READ]: { supported: ["0.10.0"] }, }, Uint16Array: { - [READ]: { supported: "0.10.0" }, - BYTES_PER_ELEMENT: { [READ]: { supported: "0.10.0" } }, - from: { [READ]: { supported: "4.0.0" } }, - name: { [READ]: { supported: "0.10.0" } }, - of: { [READ]: { supported: "4.0.0" } }, + [READ]: { supported: ["0.10.0"] }, + BYTES_PER_ELEMENT: { [READ]: { supported: ["0.10.0"] } }, + from: { [READ]: { supported: ["4.0.0"] } }, + name: { [READ]: { supported: ["0.10.0"] } }, + of: { [READ]: { supported: ["4.0.0"] } }, }, Uint32Array: { - [READ]: { supported: "0.10.0" }, - BYTES_PER_ELEMENT: { [READ]: { supported: "0.10.0" } }, - from: { [READ]: { supported: "4.0.0" } }, - name: { [READ]: { supported: "0.10.0" } }, - of: { [READ]: { supported: "4.0.0" } }, + [READ]: { supported: ["0.10.0"] }, + BYTES_PER_ELEMENT: { [READ]: { supported: ["0.10.0"] } }, + from: { [READ]: { supported: ["4.0.0"] } }, + name: { [READ]: { supported: ["0.10.0"] } }, + of: { [READ]: { supported: ["4.0.0"] } }, }, Uint8Array: { - [READ]: { supported: "0.10.0" }, - BYTES_PER_ELEMENT: { [READ]: { supported: "0.10.0" } }, - from: { [READ]: { supported: "4.0.0" } }, - name: { [READ]: { supported: "0.10.0" } }, - of: { [READ]: { supported: "4.0.0" } }, + [READ]: { supported: ["0.10.0"] }, + BYTES_PER_ELEMENT: { [READ]: { supported: ["0.10.0"] } }, + from: { [READ]: { supported: ["4.0.0"] } }, + name: { [READ]: { supported: ["0.10.0"] } }, + of: { [READ]: { supported: ["4.0.0"] } }, }, Uint8ClampedArray: { - [READ]: { supported: "0.10.0" }, - BYTES_PER_ELEMENT: { [READ]: { supported: "0.10.0" } }, - from: { [READ]: { supported: "4.0.0" } }, - name: { [READ]: { supported: "0.10.0" } }, - of: { [READ]: { supported: "4.0.0" } }, + [READ]: { supported: ["0.10.0"] }, + BYTES_PER_ELEMENT: { [READ]: { supported: ["0.10.0"] } }, + from: { [READ]: { supported: ["4.0.0"] } }, + name: { [READ]: { supported: ["0.10.0"] } }, + of: { [READ]: { supported: ["4.0.0"] } }, }, WeakMap: { - [READ]: { supported: "0.12.0" }, + [READ]: { supported: ["0.12.0"] }, }, WeakRef: { - [READ]: { supported: "14.6.0" }, + [READ]: { supported: ["14.6.0"] }, }, WeakSet: { - [READ]: { supported: "0.12.0" }, + [READ]: { supported: ["0.12.0"] }, }, decodeURI: { - [READ]: { supported: "0.10.0" }, + [READ]: { supported: ["0.10.0"] }, }, decodeURIComponent: { - [READ]: { supported: "0.10.0" }, + [READ]: { supported: ["0.10.0"] }, }, encodeURI: { - [READ]: { supported: "0.10.0" }, + [READ]: { supported: ["0.10.0"] }, }, encodeURIComponent: { - [READ]: { supported: "0.10.0" }, + [READ]: { supported: ["0.10.0"] }, }, escape: { - [READ]: { supported: "0.10.0" }, + [READ]: { supported: ["0.10.0"] }, }, eval: { - [READ]: { supported: "0.10.0" }, + [READ]: { supported: ["0.10.0"] }, }, globalThis: { - [READ]: { supported: "12.0.0" }, + [READ]: { supported: ["12.0.0"] }, }, isFinite: { - [READ]: { supported: "0.10.0" }, + [READ]: { supported: ["0.10.0"] }, }, isNaN: { - [READ]: { supported: "0.10.0" }, + [READ]: { supported: ["0.10.0"] }, }, parseFloat: { - [READ]: { supported: "0.10.0" }, + [READ]: { supported: ["0.10.0"] }, }, parseInt: { - [READ]: { supported: "0.10.0" }, + [READ]: { supported: ["0.10.0"] }, }, unescape: { - [READ]: { supported: "0.10.0" }, + [READ]: { supported: ["0.10.0"] }, }, // General APIs AbortController: { - [READ]: { supported: "15.0.0" }, + [READ]: { supported: ["15.0.0"] }, }, AbortSignal: { - [READ]: { supported: "15.0.0" }, - abort: { [READ]: { supported: "15.12.0" } }, - any: { [READ]: { supported: "20.3.0" } }, - timeout: { [READ]: { supported: "17.3.0" } }, + [READ]: { supported: ["15.0.0"] }, + abort: { [READ]: { supported: ["15.12.0"] } }, + any: { [READ]: { supported: ["20.3.0"] } }, + timeout: { [READ]: { supported: ["17.3.0"] } }, }, Blob: { - [READ]: { supported: "18.0.0" }, + [READ]: { supported: ["18.0.0"] }, }, BroadcastChannel: { - [READ]: { supported: "15.4.0" }, + [READ]: { supported: ["15.4.0"] }, }, ByteLengthQueuingStrategy: { - [READ]: { supported: "18.0.0" }, + [READ]: { supported: ["18.0.0"] }, }, CompressionStream: { - [READ]: { supported: "18.0.0" }, + [READ]: { supported: ["18.0.0"] }, }, CountQueuingStrategy: { - [READ]: { supported: "18.0.0" }, + [READ]: { supported: ["18.0.0"] }, }, Crypto: { - [READ]: { supported: "19.0.0" }, + [READ]: { supported: ["19.0.0"] }, }, CryptoKey: { - [READ]: { supported: "15.0.0" }, + [READ]: { supported: ["15.0.0"] }, }, CustomEvent: { - [READ]: { supported: "19.0.0" }, + [READ]: { supported: ["19.0.0"] }, }, DOMException: { - [READ]: { supported: "17.0.0" }, + [READ]: { supported: ["17.0.0"] }, }, DecompressionStream: { - [READ]: { supported: "18.0.0" }, + [READ]: { supported: ["18.0.0"] }, }, Event: { - [READ]: { supported: "14.5.0" }, + [READ]: { supported: ["14.5.0"] }, }, EventTarget: { - [READ]: { supported: "14.5.0" }, + [READ]: { supported: ["14.5.0"] }, }, FormData: { - [READ]: { supported: "18.0.0" }, + [READ]: { supported: ["18.0.0"] }, }, Headers: { - [READ]: { supported: "18.0.0" }, + [READ]: { supported: ["18.0.0"] }, }, MessageChannel: { - [READ]: { supported: "15.0.0" }, + [READ]: { supported: ["15.0.0"] }, }, MessageEvent: { - [READ]: { supported: "15.0.0" }, + [READ]: { supported: ["15.0.0"] }, }, MessagePort: { - [READ]: { supported: "14.7.0" }, + [READ]: { supported: ["14.7.0"] }, }, Performance: { - [READ]: { supported: "8.5.0" }, + [READ]: { supported: ["8.5.0"] }, }, PerformanceEntry: { - [READ]: { supported: "8.5.0" }, + [READ]: { supported: ["8.5.0"] }, }, PerformanceMark: { - [READ]: { supported: "8.5.0" }, + [READ]: { supported: ["8.5.0"] }, }, PerformanceMeasure: { - [READ]: { supported: "8.5.0" }, + [READ]: { supported: ["8.5.0"] }, }, PerformanceObserver: { - [READ]: { supported: "8.5.0" }, - supportedEntryTypes: { [READ]: { supported: "8.5.0" } }, + [READ]: { supported: ["8.5.0"] }, + supportedEntryTypes: { [READ]: { supported: ["8.5.0"] } }, }, PerformanceObserverEntryList: { - [READ]: { supported: "8.5.0" }, + [READ]: { supported: ["8.5.0"] }, }, ReadableByteStreamController: { - [READ]: { supported: "18.0.0" }, + [READ]: { supported: ["18.0.0"] }, }, ReadableStream: { - [READ]: { supported: "18.0.0" }, - from: { [READ]: { supported: "20.6.0" } }, + [READ]: { supported: ["18.0.0"] }, + from: { [READ]: { supported: ["20.6.0"] } }, }, ReadableStreamBYOBReader: { - [READ]: { supported: "18.0.0" }, + [READ]: { supported: ["18.0.0"] }, }, ReadableStreamBYOBRequest: { - [READ]: { supported: "18.0.0" }, + [READ]: { supported: ["18.0.0"] }, }, ReadableStreamDefaultController: { - [READ]: { supported: "18.0.0" }, + [READ]: { supported: ["18.0.0"] }, }, ReadableStreamDefaultReader: { - [READ]: { supported: "18.0.0" }, + [READ]: { supported: ["18.0.0"] }, }, Request: { - [READ]: { supported: "18.0.0" }, + [READ]: { supported: ["18.0.0"] }, }, Response: { - [READ]: { supported: "18.0.0" }, + [READ]: { supported: ["18.0.0"] }, }, SubtleCrypto: { - [READ]: { supported: "15.0.0" }, + [READ]: { supported: ["15.0.0"] }, }, TextDecoder: { - [READ]: { supported: "11.0.0" }, + [READ]: { supported: ["11.0.0"] }, }, TextDecoderStream: { - [READ]: { supported: "18.0.0" }, + [READ]: { supported: ["18.0.0"] }, }, TextEncoder: { - [READ]: { supported: "11.0.0" }, + [READ]: { supported: ["11.0.0"] }, }, TextEncoderStream: { - [READ]: { supported: "18.0.0" }, + [READ]: { supported: ["18.0.0"] }, }, TransformStream: { - [READ]: { supported: "18.0.0" }, + [READ]: { supported: ["18.0.0"] }, }, TransformStreamDefaultController: { - [READ]: { supported: "16.5.0" }, + [READ]: { supported: ["16.5.0"] }, }, URL: { - [READ]: { supported: "10.0.0" }, - canParse: { [READ]: { supported: "19.9.0" } }, - createObjectURL: { [READ]: { supported: "16.7.0" } }, - revokeObjectURL: { [READ]: { supported: "16.7.0" } }, + [READ]: { supported: ["10.0.0"] }, + canParse: { [READ]: { supported: ["19.9.0"] } }, + createObjectURL: { [READ]: { supported: ["16.7.0"] } }, + revokeObjectURL: { [READ]: { supported: ["16.7.0"] } }, }, URLSearchParams: { - [READ]: { supported: "10.0.0" }, + [READ]: { supported: ["10.0.0"] }, }, Worker: { - [READ]: { supported: "12.17.0" }, + [READ]: { supported: ["12.17.0"] }, }, WritableStream: { - [READ]: { supported: "18.0.0" }, + [READ]: { supported: ["18.0.0"] }, }, WritableStreamDefaultController: { - [READ]: { supported: "18.0.0" }, + [READ]: { supported: ["18.0.0"] }, }, WritableStreamDefaultWriter: { - [READ]: { supported: "18.0.0" }, + [READ]: { supported: ["18.0.0"] }, }, atob: { - [READ]: { supported: "16.0.0" }, + [READ]: { supported: ["16.0.0"] }, }, btoa: { - [READ]: { supported: "16.0.0" }, + [READ]: { supported: ["16.0.0"] }, }, clearInterval: { - [READ]: { supported: "0.10.0" }, + [READ]: { supported: ["0.10.0"] }, }, clearTimeout: { - [READ]: { supported: "0.10.0" }, + [READ]: { supported: ["0.10.0"] }, }, console: { - [READ]: { supported: "0.10.0" }, - assert: { [READ]: { supported: "10.0.0" } }, - clear: { [READ]: { supported: "8.3.0" } }, - countReset: { [READ]: { supported: "8.3.0" } }, - count: { [READ]: { supported: "8.3.0" } }, - debug: { [READ]: { supported: "8.0.0" } }, - dir: { [READ]: { supported: "0.10.0" } }, - dirxml: { [READ]: { supported: "9.3.0" } }, - error: { [READ]: { supported: "0.10.0" } }, - groupCollapsed: { [READ]: { supported: "8.5.0" } }, - groupEnd: { [READ]: { supported: "8.5.0" } }, - group: { [READ]: { supported: "8.5.0" } }, - info: { [READ]: { supported: "0.10.0" } }, - log: { [READ]: { supported: "0.10.0" } }, - table: { [READ]: { supported: "10.0.0" } }, - timeEnd: { [READ]: { supported: "0.10.0" } }, - timeLog: { [READ]: { supported: "10.7.0" } }, - time: { [READ]: { supported: "0.10.0" } }, - trace: { [READ]: { supported: "0.10.0" } }, - warn: { [READ]: { supported: "0.10.0" } }, + [READ]: { supported: ["0.10.0"] }, + assert: { [READ]: { supported: ["10.0.0"] } }, + clear: { [READ]: { supported: ["8.3.0"] } }, + countReset: { [READ]: { supported: ["8.3.0"] } }, + count: { [READ]: { supported: ["8.3.0"] } }, + debug: { [READ]: { supported: ["8.0.0"] } }, + dir: { [READ]: { supported: ["0.10.0"] } }, + dirxml: { [READ]: { supported: ["9.3.0"] } }, + error: { [READ]: { supported: ["0.10.0"] } }, + groupCollapsed: { [READ]: { supported: ["8.5.0"] } }, + groupEnd: { [READ]: { supported: ["8.5.0"] } }, + group: { [READ]: { supported: ["8.5.0"] } }, + info: { [READ]: { supported: ["0.10.0"] } }, + log: { [READ]: { supported: ["0.10.0"] } }, + table: { [READ]: { supported: ["10.0.0"] } }, + timeEnd: { [READ]: { supported: ["0.10.0"] } }, + timeLog: { [READ]: { supported: ["10.7.0"] } }, + time: { [READ]: { supported: ["0.10.0"] } }, + trace: { [READ]: { supported: ["0.10.0"] } }, + warn: { [READ]: { supported: ["0.10.0"] } }, }, fetch: { - [READ]: { supported: "18.0.0" }, + [READ]: { supported: ["18.0.0"] }, }, queueMicrotask: { - [READ]: { supported: "11.0.0" }, + [READ]: { supported: ["11.0.0"] }, }, setInterval: { - [READ]: { supported: "0.10.0" }, + [READ]: { supported: ["0.10.0"] }, }, setTimeout: { - [READ]: { supported: "0.10.0" }, + [READ]: { supported: ["0.10.0"] }, }, structuredClone: { - [READ]: { supported: "17.0.0" }, + [READ]: { supported: ["17.0.0"] }, }, }, } diff --git a/lib/rules/no-unsupported-features/node-builtins.js b/lib/rules/no-unsupported-features/node-builtins.js index 23666fee..32def045 100644 --- a/lib/rules/no-unsupported-features/node-builtins.js +++ b/lib/rules/no-unsupported-features/node-builtins.js @@ -16,110 +16,109 @@ const extendTrackMapWithNodePrefix = require("../../util/extend-trackmap-with-no const trackMap = { globals: { queueMicrotask: { - [READ]: { supported: "12.0.0", experimental: "11.0.0" }, + [READ]: { supported: ["12.0.0"], experimental: "11.0.0" }, }, require: { resolve: { - paths: { [READ]: { supported: "8.9.0" } }, + paths: { [READ]: { supported: ["8.9.0"] } }, }, }, }, modules: { assert: { strict: { - [READ]: { supported: "9.9.0", backported: ["8.13.0"] }, - doesNotReject: { [READ]: { supported: "10.0.0" } }, - rejects: { [READ]: { supported: "10.0.0" } }, - }, - deepStrictEqual: { [READ]: { supported: "4.0.0" } }, - doesNotReject: { [READ]: { supported: "10.0.0" } }, - notDeepStrictEqual: { [READ]: { supported: "4.0.0" } }, - rejects: { [READ]: { supported: "10.0.0" } }, + [READ]: { supported: ["9.9.0", "8.13.0"] }, + doesNotReject: { [READ]: { supported: ["10.0.0"] } }, + rejects: { [READ]: { supported: ["10.0.0"] } }, + }, + deepStrictEqual: { [READ]: { supported: ["4.0.0"] } }, + doesNotReject: { [READ]: { supported: ["10.0.0"] } }, + notDeepStrictEqual: { [READ]: { supported: ["4.0.0"] } }, + rejects: { [READ]: { supported: ["10.0.0"] } }, CallTracker: { [READ]: { supported: null, experimental: "14.2.0" }, }, }, async_hooks: { - [READ]: { supported: "8.0.0" }, - createHook: { [READ]: { supported: "8.1.0" } }, + [READ]: { supported: ["8.0.0"] }, + createHook: { [READ]: { supported: ["8.1.0"] } }, AsyncLocalStorage: { - [READ]: { supported: "13.10.0", backported: ["12.17.0"] }, + [READ]: { supported: ["13.10.0", "12.17.0"] }, }, }, buffer: { Buffer: { - alloc: { [READ]: { supported: "4.5.0" } }, - allocUnsafe: { [READ]: { supported: "4.5.0" } }, - allocUnsafeSlow: { [READ]: { supported: "4.5.0" } }, - from: { [READ]: { supported: "4.5.0" } }, - }, - kMaxLength: { [READ]: { supported: "3.0.0" } }, - transcode: { [READ]: { supported: "7.1.0" } }, - constants: { [READ]: { supported: "8.2.0" } }, + alloc: { [READ]: { supported: ["4.5.0"] } }, + allocUnsafe: { [READ]: { supported: ["4.5.0"] } }, + allocUnsafeSlow: { [READ]: { supported: ["4.5.0"] } }, + from: { [READ]: { supported: ["4.5.0"] } }, + }, + kMaxLength: { [READ]: { supported: ["3.0.0"] } }, + transcode: { [READ]: { supported: ["7.1.0"] } }, + constants: { [READ]: { supported: ["8.2.0"] } }, Blob: { [READ]: { supported: null, experimental: "15.7.0" } }, }, child_process: { - ChildProcess: { [READ]: { supported: "2.2.0" } }, + ChildProcess: { [READ]: { supported: ["2.2.0"] } }, }, console: { - clear: { [READ]: { supported: "8.3.0", backported: ["6.13.0"] } }, - count: { [READ]: { supported: "8.3.0", backported: ["6.13.0"] } }, + clear: { [READ]: { supported: ["8.3.0", "6.13.0"] } }, + count: { [READ]: { supported: ["8.3.0", "6.13.0"] } }, countReset: { - [READ]: { supported: "8.3.0", backported: ["6.13.0"] }, - }, - debug: { [READ]: { supported: "8.0.0" } }, - dirxml: { [READ]: { supported: "8.0.0" } }, - group: { [READ]: { supported: "8.5.0" } }, - groupCollapsed: { [READ]: { supported: "8.5.0" } }, - groupEnd: { [READ]: { supported: "8.5.0" } }, - table: { [READ]: { supported: "10.0.0" } }, - markTimeline: { [READ]: { supported: "8.0.0" } }, - profile: { [READ]: { supported: "8.0.0" } }, - profileEnd: { [READ]: { supported: "8.0.0" } }, - timeLog: { [READ]: { supported: "10.7.0" } }, - timeStamp: { [READ]: { supported: "8.0.0" } }, - timeline: { [READ]: { supported: "8.0.0" } }, - timelineEnd: { [READ]: { supported: "8.0.0" } }, + [READ]: { supported: ["8.3.0", "6.13.0"] }, + }, + debug: { [READ]: { supported: ["8.0.0"] } }, + dirxml: { [READ]: { supported: ["8.0.0"] } }, + group: { [READ]: { supported: ["8.5.0"] } }, + groupCollapsed: { [READ]: { supported: ["8.5.0"] } }, + groupEnd: { [READ]: { supported: ["8.5.0"] } }, + table: { [READ]: { supported: ["10.0.0"] } }, + markTimeline: { [READ]: { supported: ["8.0.0"] } }, + profile: { [READ]: { supported: ["8.0.0"] } }, + profileEnd: { [READ]: { supported: ["8.0.0"] } }, + timeLog: { [READ]: { supported: ["10.7.0"] } }, + timeStamp: { [READ]: { supported: ["8.0.0"] } }, + timeline: { [READ]: { supported: ["8.0.0"] } }, + timelineEnd: { [READ]: { supported: ["8.0.0"] } }, }, crypto: { Certificate: { - exportChallenge: { [READ]: { supported: "9.0.0" } }, - exportPublicKey: { [READ]: { supported: "9.0.0" } }, - verifySpkac: { [READ]: { supported: "9.0.0" } }, - }, - ECDH: { [READ]: { supported: "8.8.0", backported: ["6.13.0"] } }, - KeyObject: { [READ]: { supported: "11.6.0" } }, - createPrivateKey: { [READ]: { supported: "11.6.0" } }, - createPublicKey: { [READ]: { supported: "11.6.0" } }, - createSecretKey: { [READ]: { supported: "11.6.0" } }, - constants: { [READ]: { supported: "6.3.0" } }, - fips: { [READ]: { supported: "6.0.0" } }, - generateKeyPair: { [READ]: { supported: "10.12.0" } }, - generateKeyPairSync: { [READ]: { supported: "10.12.0" } }, - getCurves: { [READ]: { supported: "2.3.0" } }, - getFips: { [READ]: { supported: "10.0.0" } }, - privateEncrypt: { [READ]: { supported: "1.1.0" } }, - publicDecrypt: { [READ]: { supported: "1.1.0" } }, + exportChallenge: { [READ]: { supported: ["9.0.0"] } }, + exportPublicKey: { [READ]: { supported: ["9.0.0"] } }, + verifySpkac: { [READ]: { supported: ["9.0.0"] } }, + }, + ECDH: { [READ]: { supported: ["8.8.0", "6.13.0"] } }, + KeyObject: { [READ]: { supported: ["11.6.0"] } }, + createPrivateKey: { [READ]: { supported: ["11.6.0"] } }, + createPublicKey: { [READ]: { supported: ["11.6.0"] } }, + createSecretKey: { [READ]: { supported: ["11.6.0"] } }, + constants: { [READ]: { supported: ["6.3.0"] } }, + fips: { [READ]: { supported: ["6.0.0"] } }, + generateKeyPair: { [READ]: { supported: ["10.12.0"] } }, + generateKeyPairSync: { [READ]: { supported: ["10.12.0"] } }, + getCurves: { [READ]: { supported: ["2.3.0"] } }, + getFips: { [READ]: { supported: ["10.0.0"] } }, + privateEncrypt: { [READ]: { supported: ["1.1.0"] } }, + publicDecrypt: { [READ]: { supported: ["1.1.0"] } }, randomFillSync: { - [READ]: { supported: "7.10.0", backported: ["6.13.0"] }, + [READ]: { supported: ["7.10.0", "6.13.0"] }, }, randomFill: { - [READ]: { supported: "7.10.0", backported: ["6.13.0"] }, - }, - scrypt: { [READ]: { supported: "10.5.0" } }, - scryptSync: { [READ]: { supported: "10.5.0" } }, - setFips: { [READ]: { supported: "10.0.0" } }, - sign: { [READ]: { supported: "12.0.0" } }, - timingSafeEqual: { [READ]: { supported: "6.6.0" } }, - verify: { [READ]: { supported: "12.0.0" } }, + [READ]: { supported: ["7.10.0", "6.13.0"] }, + }, + scrypt: { [READ]: { supported: ["10.5.0"] } }, + scryptSync: { [READ]: { supported: ["10.5.0"] } }, + setFips: { [READ]: { supported: ["10.0.0"] } }, + sign: { [READ]: { supported: ["12.0.0"] } }, + timingSafeEqual: { [READ]: { supported: ["6.6.0"] } }, + verify: { [READ]: { supported: ["12.0.0"] } }, }, dns: { - Resolver: { [READ]: { supported: "8.3.0" } }, - resolvePtr: { [READ]: { supported: "6.0.0" } }, + Resolver: { [READ]: { supported: ["8.3.0"] } }, + resolvePtr: { [READ]: { supported: ["6.0.0"] } }, promises: { [READ]: { - supported: "11.14.0", - backported: ["10.17.0"], + supported: ["11.14.0", "10.17.0"], experimental: "10.6.0", }, }, @@ -127,78 +126,76 @@ const trackMap = { events: { EventEmitter: { once: { - [READ]: { supported: "11.13.0", backported: ["10.16.0"] }, + [READ]: { supported: ["11.13.0", "10.16.0"] }, }, }, - once: { [READ]: { supported: "11.13.0", backported: ["10.16.0"] } }, + once: { [READ]: { supported: ["11.13.0", "10.16.0"] } }, }, fs: { - Dirent: { [READ]: { supported: "10.10.0" } }, - copyFile: { [READ]: { supported: "8.5.0" } }, - copyFileSync: { [READ]: { supported: "8.5.0" } }, - mkdtemp: { [READ]: { supported: "5.10.0" } }, - mkdtempSync: { [READ]: { supported: "5.10.0" } }, + Dirent: { [READ]: { supported: ["10.10.0"] } }, + copyFile: { [READ]: { supported: ["8.5.0"] } }, + copyFileSync: { [READ]: { supported: ["8.5.0"] } }, + mkdtemp: { [READ]: { supported: ["5.10.0"] } }, + mkdtempSync: { [READ]: { supported: ["5.10.0"] } }, realpath: { - native: { [READ]: { supported: "9.2.0" } }, + native: { [READ]: { supported: ["9.2.0"] } }, }, realpathSync: { - native: { [READ]: { supported: "9.2.0" } }, + native: { [READ]: { supported: ["9.2.0"] } }, }, promises: { [READ]: { - supported: "11.14.0", - backported: ["10.17.0"], + supported: ["11.14.0", "10.17.0"], experimental: "10.1.0", }, }, - writev: { [READ]: { supported: "12.9.0" } }, - writevSync: { [READ]: { supported: "12.9.0" } }, + writev: { [READ]: { supported: ["12.9.0"] } }, + writevSync: { [READ]: { supported: ["12.9.0"] } }, readv: { - [READ]: { supported: "13.13.0", backported: ["12.17.0"] }, + [READ]: { supported: ["13.13.0", "12.17.0"] }, }, readvSync: { - [READ]: { supported: "13.13.0", backported: ["12.17.0"] }, + [READ]: { supported: ["13.13.0", "12.17.0"] }, }, lutimes: { - [READ]: { supported: "14.5.0", backported: ["12.19.0"] }, + [READ]: { supported: ["14.5.0", "12.19.0"] }, }, lutimesSync: { - [READ]: { supported: "14.5.0", backported: ["12.19.0"] }, + [READ]: { supported: ["14.5.0", "12.19.0"] }, }, opendir: { - [READ]: { supported: "12.12.0" }, + [READ]: { supported: ["12.12.0"] }, }, opendirSync: { - [READ]: { supported: "12.12.0" }, + [READ]: { supported: ["12.12.0"] }, }, rm: { - [READ]: { supported: "14.14.0" }, + [READ]: { supported: ["14.14.0"] }, }, rmSync: { - [READ]: { supported: "14.14.0" }, + [READ]: { supported: ["14.14.0"] }, }, read: { - [READ]: { supported: "13.11.0", backported: ["12.17.0"] }, + [READ]: { supported: ["13.11.0", "12.17.0"] }, }, readSync: { - [READ]: { supported: "13.11.0", backported: ["12.17.0"] }, + [READ]: { supported: ["13.11.0", "12.17.0"] }, }, Dir: { - [READ]: { supported: "12.12.0" }, + [READ]: { supported: ["12.12.0"] }, }, StatWatcher: { - [READ]: { supported: "14.3.0", backported: ["12.20.0"] }, + [READ]: { supported: ["14.3.0", "12.20.0"] }, }, }, "fs/promises": { [READ]: { - supported: "14.0.0", + supported: ["14.0.0"], }, }, http2: { [READ]: { - supported: "10.10.0", - backported: ["8.13.0"], + supported: ["10.10.0", "8.13.0"], experimental: "8.4.0", }, }, @@ -209,142 +206,141 @@ const trackMap = { Module: { builtinModules: { [READ]: { - supported: "9.3.0", - backported: ["6.13.0", "8.10.0"], + supported: ["9.3.0", "6.13.0", "8.10.0"], }, }, - createRequireFromPath: { [READ]: { supported: "10.12.0" } }, - createRequire: { [READ]: { supported: "12.2.0" } }, - syncBuiltinESMExports: { [READ]: { supported: "12.12.0" } }, + createRequireFromPath: { [READ]: { supported: ["10.12.0"] } }, + createRequire: { [READ]: { supported: ["12.2.0"] } }, + syncBuiltinESMExports: { [READ]: { supported: ["12.12.0"] } }, }, builtinModules: { [READ]: { - supported: "9.3.0", - backported: ["6.13.0", "8.10.0"], + supported: ["9.3.0", "6.13.0", "8.10.0"], }, }, - createRequireFromPath: { [READ]: { supported: "10.12.0" } }, - createRequire: { [READ]: { supported: "12.2.0" } }, - syncBuiltinESMExports: { [READ]: { supported: "12.12.0" } }, + createRequireFromPath: { [READ]: { supported: ["10.12.0"] } }, + createRequire: { [READ]: { supported: ["12.2.0"] } }, + syncBuiltinESMExports: { [READ]: { supported: ["12.12.0"] } }, }, os: { constants: { - [READ]: { supported: "6.3.0" }, - priority: { [READ]: { supported: "10.10.0" } }, + [READ]: { supported: ["6.3.0"] }, + priority: { [READ]: { supported: ["10.10.0"] } }, }, - getPriority: { [READ]: { supported: "10.10.0" } }, - homedir: { [READ]: { supported: "2.3.0" } }, - setPriority: { [READ]: { supported: "10.10.0" } }, - userInfo: { [READ]: { supported: "6.0.0" } }, + getPriority: { [READ]: { supported: ["10.10.0"] } }, + homedir: { [READ]: { supported: ["2.3.0"] } }, + setPriority: { [READ]: { supported: ["10.10.0"] } }, + userInfo: { [READ]: { supported: ["6.0.0"] } }, }, path: { - toNamespacedPath: { [READ]: { supported: "9.0.0" } }, + toNamespacedPath: { [READ]: { supported: ["9.0.0"] } }, }, perf_hooks: { - [READ]: { supported: "8.5.0" }, - monitorEventLoopDelay: { [READ]: { supported: "11.10.0" } }, + [READ]: { supported: ["8.5.0"] }, + monitorEventLoopDelay: { [READ]: { supported: ["11.10.0"] } }, }, process: { - allowedNodeEnvironmentFlags: { [READ]: { supported: "10.10.0" } }, - argv0: { [READ]: { supported: "6.4.0" } }, - channel: { [READ]: { supported: "7.1.0" } }, - cpuUsage: { [READ]: { supported: "6.1.0" } }, - emitWarning: { [READ]: { supported: "6.0.0" } }, - getegid: { [READ]: { supported: "2.0.0" } }, - geteuid: { [READ]: { supported: "2.0.0" } }, + allowedNodeEnvironmentFlags: { [READ]: { supported: ["10.10.0"] } }, + argv0: { [READ]: { supported: ["6.4.0"] } }, + channel: { [READ]: { supported: ["7.1.0"] } }, + cpuUsage: { [READ]: { supported: ["6.1.0"] } }, + emitWarning: { [READ]: { supported: ["6.0.0"] } }, + getegid: { [READ]: { supported: ["2.0.0"] } }, + geteuid: { [READ]: { supported: ["2.0.0"] } }, hasUncaughtExceptionCaptureCallback: { - [READ]: { supported: "9.3.0" }, + [READ]: { supported: ["9.3.0"] }, }, hrtime: { - bigint: { [READ]: { supported: "10.7.0" } }, + bigint: { [READ]: { supported: ["10.7.0"] } }, }, ppid: { [READ]: { - supported: "9.2.0", - backported: ["6.13.0", "8.10.0"], + supported: ["9.2.0", "6.13.0", "8.10.0"], }, }, - release: { [READ]: { supported: "3.0.0" } }, - report: { [READ]: { supported: "14.0.0", experimental: "11.8.0" } }, - resourceUsage: { [READ]: { supported: "12.6.0" } }, - setegid: { [READ]: { supported: "2.0.0" } }, - seteuid: { [READ]: { supported: "2.0.0" } }, + release: { [READ]: { supported: ["3.0.0"] } }, + report: { + [READ]: { supported: ["14.0.0"], experimental: "11.8.0" }, + }, + resourceUsage: { [READ]: { supported: ["12.6.0"] } }, + setegid: { [READ]: { supported: ["2.0.0"] } }, + seteuid: { [READ]: { supported: ["2.0.0"] } }, setUncaughtExceptionCaptureCallback: { - [READ]: { supported: "9.3.0" }, + [READ]: { supported: ["9.3.0"] }, }, stdout: { - getColorDepth: { [READ]: { supported: "9.9.0" } }, - hasColor: { [READ]: { supported: "11.13.0" } }, + getColorDepth: { [READ]: { supported: ["9.9.0"] } }, + hasColor: { [READ]: { supported: ["11.13.0"] } }, }, stderr: { - getColorDepth: { [READ]: { supported: "9.9.0" } }, - hasColor: { [READ]: { supported: "11.13.0" } }, + getColorDepth: { [READ]: { supported: ["9.9.0"] } }, + hasColor: { [READ]: { supported: ["11.13.0"] } }, }, }, stream: { Readable: { from: { - [READ]: { supported: "12.3.0", backported: ["10.17.0"] }, + [READ]: { supported: ["12.3.0", "10.17.0"] }, }, }, - finished: { [READ]: { supported: "10.0.0" } }, - pipeline: { [READ]: { supported: "10.0.0" } }, + finished: { [READ]: { supported: ["10.0.0"] } }, + pipeline: { [READ]: { supported: ["10.0.0"] } }, }, trace_events: { - [READ]: { supported: "10.0.0" }, + [READ]: { supported: ["10.0.0"] }, }, url: { - URL: { [READ]: { supported: "7.0.0", backported: ["6.13.0"] } }, + URL: { [READ]: { supported: ["7.0.0", "6.13.0"] } }, URLSearchParams: { - [READ]: { supported: "7.5.0", backported: ["6.13.0"] }, + [READ]: { supported: ["7.5.0", "6.13.0"] }, }, - domainToASCII: { [READ]: { supported: "7.4.0" } }, - domainToUnicode: { [READ]: { supported: "7.4.0" } }, + domainToASCII: { [READ]: { supported: ["7.4.0"] } }, + domainToUnicode: { [READ]: { supported: ["7.4.0"] } }, }, util: { - callbackify: { [READ]: { supported: "8.2.0" } }, - formatWithOptions: { [READ]: { supported: "10.0.0" } }, + callbackify: { [READ]: { supported: ["8.2.0"] } }, + formatWithOptions: { [READ]: { supported: ["10.0.0"] } }, getSystemErrorName: { - [READ]: { supported: "9.7.0", backported: ["8.12.0"] }, + [READ]: { supported: ["9.7.0", "8.12.0"] }, }, inspect: { - custom: { [READ]: { supported: "6.6.0" } }, - defaultOptions: { [READ]: { supported: "6.4.0" } }, - replDefaults: { [READ]: { supported: "11.12.0" } }, + custom: { [READ]: { supported: ["6.6.0"] } }, + defaultOptions: { [READ]: { supported: ["6.4.0"] } }, + replDefaults: { [READ]: { supported: ["11.12.0"] } }, }, - isDeepStrictEqual: { [READ]: { supported: "9.0.0" } }, - promisify: { [READ]: { supported: "8.0.0" } }, + isDeepStrictEqual: { [READ]: { supported: ["9.0.0"] } }, + promisify: { [READ]: { supported: ["8.0.0"] } }, TextDecoder: { - [READ]: { supported: "8.9.0", experimental: "8.3.0" }, + [READ]: { supported: ["8.9.0"], experimental: "8.3.0" }, }, TextEncoder: { - [READ]: { supported: "8.9.0", experimental: "8.3.0" }, + [READ]: { supported: ["8.9.0"], experimental: "8.3.0" }, }, types: { - [READ]: { supported: "10.0.0" }, - isBoxedPrimitive: { [READ]: { supported: "10.11.0" } }, + [READ]: { supported: ["10.0.0"] }, + isBoxedPrimitive: { [READ]: { supported: ["10.11.0"] } }, }, }, v8: { - [READ]: { supported: "1.0.0" }, - DefaultDeserializer: { [READ]: { supported: "8.0.0" } }, - DefaultSerializer: { [READ]: { supported: "8.0.0" } }, - Deserializer: { [READ]: { supported: "8.0.0" } }, - Serializer: { [READ]: { supported: "8.0.0" } }, - cachedDataVersionTag: { [READ]: { supported: "8.0.0" } }, - deserialize: { [READ]: { supported: "8.0.0" } }, - getHeapCodeStatistics: { [READ]: { supported: "12.8.0" } }, - getHeapSnapshot: { [READ]: { supported: "11.13.0" } }, - getHeapSpaceStatistics: { [READ]: { supported: "6.0.0" } }, - serialize: { [READ]: { supported: "8.0.0" } }, - writeHeapSnapshot: { [READ]: { supported: "11.13.0" } }, + [READ]: { supported: ["1.0.0"] }, + DefaultDeserializer: { [READ]: { supported: ["8.0.0"] } }, + DefaultSerializer: { [READ]: { supported: ["8.0.0"] } }, + Deserializer: { [READ]: { supported: ["8.0.0"] } }, + Serializer: { [READ]: { supported: ["8.0.0"] } }, + cachedDataVersionTag: { [READ]: { supported: ["8.0.0"] } }, + deserialize: { [READ]: { supported: ["8.0.0"] } }, + getHeapCodeStatistics: { [READ]: { supported: ["12.8.0"] } }, + getHeapSnapshot: { [READ]: { supported: ["11.13.0"] } }, + getHeapSpaceStatistics: { [READ]: { supported: ["6.0.0"] } }, + serialize: { [READ]: { supported: ["8.0.0"] } }, + writeHeapSnapshot: { [READ]: { supported: ["11.13.0"] } }, }, vm: { - Module: { [READ]: { supported: "9.6.0" } }, - compileFunction: { [READ]: { supported: "10.10.0" } }, + Module: { [READ]: { supported: ["9.6.0"] } }, + compileFunction: { [READ]: { supported: ["10.10.0"] } }, }, worker_threads: { - [READ]: { supported: "12.11.0", experimental: "10.5.0" }, + [READ]: { supported: ["12.11.0"], experimental: "10.5.0" }, }, }, } @@ -352,19 +348,19 @@ Object.assign(trackMap.globals, { Buffer: trackMap.modules.buffer.Buffer, TextDecoder: { ...trackMap.modules.util.TextDecoder, - [READ]: { supported: "11.0.0" }, + [READ]: { supported: ["11.0.0"] }, }, TextEncoder: { ...trackMap.modules.util.TextEncoder, - [READ]: { supported: "11.0.0" }, + [READ]: { supported: ["11.0.0"] }, }, URL: { ...trackMap.modules.url.URL, - [READ]: { supported: "10.0.0" }, + [READ]: { supported: ["10.0.0"] }, }, URLSearchParams: { ...trackMap.modules.url.URLSearchParams, - [READ]: { supported: "10.0.0" }, + [READ]: { supported: ["10.0.0"] }, }, console: trackMap.modules.console, process: trackMap.modules.process, diff --git a/lib/util/check-unsupported-builtins.js b/lib/util/check-unsupported-builtins.js index ffd6b1d7..09958a40 100644 --- a/lib/util/check-unsupported-builtins.js +++ b/lib/util/check-unsupported-builtins.js @@ -4,7 +4,7 @@ */ "use strict" -const { Range, lt, major } = require("semver") // eslint-disable-line no-unused-vars +const { major, rsort } = require("semver") const { ReferenceTracker } = require("@eslint-community/eslint-utils") const getConfiguredNodeVersion = require("./get-configured-node-version") const getSemverRange = require("./get-semver-range") @@ -12,8 +12,7 @@ const unprefixNodeColon = require("./unprefix-node-colon") /** * @typedef {Object} SupportInfo - * @property {string | null} supported The stably supported version. If `null` is present, it hasn't been supported yet. - * @property {string[]} [backported] The backported versions. + * @property {string[]} supported The stably supported version. If `null` is present, it hasn't been supported yet. * @property {string} [experimental] The added version as experimental. */ @@ -35,43 +34,42 @@ function parseOptions(context) { * @param {SupportInfo} info The support info. * @param {Range} configured The configured version range. */ -function isSupported({ backported, supported }, configured) { - if ( - backported && - backported.length >= 2 && - !backported.every((v, i) => i === 0 || lt(backported[i - 1], v)) - ) { - throw new Error("Invalid BackportConfiguration") - } - - if (supported == null) { +function isSupported({ supported }, configured) { + if (supported == null || supported.length === 0) { return false } - if (backported == null || backported.length === 0) { - return !configured.intersects(getSemverRange(`<${supported}`)) - } - return !configured.intersects( - getSemverRange( - [...backported, supported] - .map((v, i) => (i === 0 ? `<${v}` : `>=${major(v)}.0.0 <${v}`)) - .join(" || ") - ) + const [latest] = rsort(supported) + const range = getSemverRange( + [ + ...supported.map( + version => `>= ${version} < ${major(version) + 1}` + ), + `> ${major(latest)}`, + ].join("||") ) + + return configured.intersects(range) } /** * Get the formatted text of a given supported version. * @param {SupportInfo} info The support info. */ -function supportedVersionToString({ backported, supported }) { - if (supported == null) { +function supportedVersionToString({ supported }) { + if (supported == null || supported.length === 0) { return "(none yet)" } - if (backported == null || backported.length === 0) { - return supported + + const [latest, ...backported] = rsort(supported) + + if (backported.length === 0) { + return latest } - return `${supported} (backported: ^${backported.join(", ^")})` + + const backportString = backported.map(version => `^${version}`).join(", ") + + return `${latest} (backported: ${backportString})` } /** diff --git a/tests/lib/rules/no-unsupported-features/node-builtins.js b/tests/lib/rules/no-unsupported-features/node-builtins.js index ed6422e4..079065de 100644 --- a/tests/lib/rules/no-unsupported-features/node-builtins.js +++ b/tests/lib/rules/no-unsupported-features/node-builtins.js @@ -3441,7 +3441,7 @@ new RuleTester({ languageOptions: { sourceType: "module" } }).run( data: { name: "module.builtinModules", supported: - "9.3.0 (backported: ^6.13.0, ^8.10.0)", + "9.3.0 (backported: ^8.10.0, ^6.13.0)", version: "9.2.9", }, }, @@ -4161,7 +4161,7 @@ new RuleTester({ languageOptions: { sourceType: "module" } }).run( data: { name: "process.ppid", supported: - "9.2.0 (backported: ^6.13.0, ^8.10.0)", + "9.2.0 (backported: ^8.10.0, ^6.13.0)", version: "9.1.9", }, },