From 335563cda213de0df942dad6b5808fccc492dffd Mon Sep 17 00:00:00 2001 From: Mark Wubben Date: Fri, 26 Aug 2022 15:28:08 +0200 Subject: [PATCH] Latest XO and apply fixes Notably, export types not interfaces. --- .xo-config.cjs | 10 +- entrypoints/plugin.d.ts | 2 +- lib/cli.js | 8 +- lib/load-config.js | 2 +- lib/plugin-support/shared-worker-loader.js | 2 +- lib/provider-manager.js | 2 +- lib/worker/base.js | 4 +- lib/worker/channel.cjs | 2 +- package-lock.json | 497 ++++++++---------- package.json | 2 +- .../fail-fast/multiple-files/passes-slow.cjs | 2 +- test-tap/fixture/process-cwd-default.cjs | 2 +- .../with-dependencies/require-custom.cjs | 2 +- test-tap/helper/report-worker.js | 2 +- test-tap/reporters/default.js | 2 +- test-tap/reporters/tap.js | 2 +- test-types/module/context.ts | 11 +- test-types/module/macros.ts | 9 +- test-types/module/try-commit.ts | 11 +- test/cjs-default/fixtures/test.cjs | 2 +- types/assertions.d.ts | 80 +-- types/subscribable.d.ts | 4 +- types/test-fn.d.ts | 56 +- types/try-fn.d.ts | 10 +- 24 files changed, 345 insertions(+), 381 deletions(-) diff --git a/.xo-config.cjs b/.xo-config.cjs index 138d98b07..01f8786db 100644 --- a/.xo-config.cjs +++ b/.xo-config.cjs @@ -64,7 +64,13 @@ module.exports = { files: 'test/**', rules: { 'import/no-anonymous-default-export': 'off', - 'node/prefer-global/process': 'off', + 'n/prefer-global/process': 'off', + }, + }, + { + files: 'test/**/fixtures/**', + rules: { + 'n/file-extension-in-import': 'off', }, }, { @@ -79,7 +85,7 @@ module.exports = { files: 'test-tap/**', rules: { 'import/no-anonymous-default-export': 'off', - 'node/prefer-global/process': 'off', + 'n/prefer-global/process': 'off', 'unicorn/error-message': 'off', }, }, diff --git a/entrypoints/plugin.d.ts b/entrypoints/plugin.d.ts index a2f68e179..24319ce25 100644 --- a/entrypoints/plugin.d.ts +++ b/entrypoints/plugin.d.ts @@ -1,4 +1,4 @@ -import {URL} from 'node:url'; +import type {URL} from 'node:url'; export namespace SharedWorker { export type ProtocolIdentifier = 'ava-4'; diff --git a/lib/cli.js b/lib/cli.js index a964aa181..c2ddcbca6 100644 --- a/lib/cli.js +++ b/lib/cli.js @@ -8,7 +8,7 @@ import ciParallelVars from 'ci-parallel-vars'; import {deleteAsync} from 'del'; import figures from 'figures'; import yargs from 'yargs'; -import {hideBin} from 'yargs/helpers'; // eslint-disable-line node/file-extension-in-import +import {hideBin} from 'yargs/helpers'; // eslint-disable-line n/file-extension-in-import import Api from './api.js'; import {chalk} from './chalk.js'; @@ -124,7 +124,7 @@ export default async function loadCli() { // eslint-disable-line complexity // run AVA with the debug command, though it's allowed. let activeInspector = false; try { - const {default: inspector} = await import('node:inspector'); // eslint-disable-line node/no-unsupported-features/es-syntax + const {default: inspector} = await import('node:inspector'); activeInspector = inspector.url() !== undefined; } catch {} @@ -242,11 +242,11 @@ export default async function loadCli() { // eslint-disable-line complexity const chalkOptions = {level: 0}; if (combined.color !== false) { - const {supportsColor: {level}} = await import('chalk'); // eslint-disable-line node/no-unsupported-features/es-syntax, unicorn/import-style + const {supportsColor: {level}} = await import('chalk'); // eslint-disable-line unicorn/import-style chalkOptions.level = level; } - const {set: setChalk} = await import('./chalk.js'); // eslint-disable-line node/no-unsupported-features/es-syntax + const {set: setChalk} = await import('./chalk.js'); setChalk(chalkOptions); if (confError) { diff --git a/lib/load-config.js b/lib/load-config.js index e3c70fd70..9ffa2aa6e 100644 --- a/lib/load-config.js +++ b/lib/load-config.js @@ -11,7 +11,7 @@ const MISSING_DEFAULT_EXPORT = Symbol('missing default export'); const EXPERIMENTS = new Set(); const importConfig = async ({configFile, fileForErrorMessage}) => { - const {default: config = MISSING_DEFAULT_EXPORT} = await import(url.pathToFileURL(configFile)); // eslint-disable-line node/no-unsupported-features/es-syntax + const {default: config = MISSING_DEFAULT_EXPORT} = await import(url.pathToFileURL(configFile)); if (config === MISSING_DEFAULT_EXPORT) { throw new Error(`${fileForErrorMessage} must have a default export`); } diff --git a/lib/plugin-support/shared-worker-loader.js b/lib/plugin-support/shared-worker-loader.js index 2813fe69c..8ab57d444 100644 --- a/lib/plugin-support/shared-worker-loader.js +++ b/lib/plugin-support/shared-worker-loader.js @@ -156,7 +156,7 @@ function broadcastMessage(data) { } async function loadFactory() { - const {default: factory} = await import(workerData.filename); // eslint-disable-line node/no-unsupported-features/es-syntax + const {default: factory} = await import(workerData.filename); return factory; } diff --git a/lib/provider-manager.js b/lib/provider-manager.js index c3b7c85d8..faf61f78b 100644 --- a/lib/provider-manager.js +++ b/lib/provider-manager.js @@ -15,7 +15,7 @@ const levelsByProtocol = { async function load(providerModule, projectDir) { const ava = {version: pkg.version}; - const {default: makeProvider} = await import(providerModule); // eslint-disable-line node/no-unsupported-features/es-syntax + const {default: makeProvider} = await import(providerModule); let fatal; let level; diff --git a/lib/worker/base.js b/lib/worker/base.js index e62e30eb4..a9ed9e4a3 100644 --- a/lib/worker/base.js +++ b/lib/worker/base.js @@ -141,7 +141,7 @@ const run = async options => { for (const extension of extensionsToLoadAsModules) { if (ref.endsWith(`.${extension}`)) { - return import(pathToFileURL(ref)); // eslint-disable-line node/no-unsupported-features/es-syntax + return import(pathToFileURL(ref)); } } @@ -161,7 +161,7 @@ const run = async options => { if (options.debug && options.debug.port !== undefined && options.debug.host !== undefined) { // If an inspector was active when the main process started, and is // already active for the worker process, do not open a new one. - const {default: inspector} = await import('node:inspector'); // eslint-disable-line node/no-unsupported-features/es-syntax + const {default: inspector} = await import('node:inspector'); if (!options.debug.active || inspector.url() === undefined) { inspector.open(options.debug.port, options.debug.host, true); } diff --git a/lib/worker/channel.cjs b/lib/worker/channel.cjs index 7eed7960a..6444f752b 100644 --- a/lib/worker/channel.cjs +++ b/lib/worker/channel.cjs @@ -15,7 +15,7 @@ let pEvent = async (emitter, event, options) => { emitter.on(event, addToBuffer); try { - ({pEvent} = await import('p-event')); // eslint-disable-line node/no-unsupported-features/es-syntax + ({pEvent} = await import('p-event')); } finally { emitter.off(event, addToBuffer); } diff --git a/package-lock.json b/package-lock.json index acadee100..aa48b1265 100644 --- a/package-lock.json +++ b/package-lock.json @@ -77,7 +77,7 @@ "touch": "^3.1.0", "tsd": "^0.22.0", "typescript": "^4.7.3", - "xo": "^0.49.0", + "xo": "^0.52.2", "zen-observable": "^0.8.15" }, "engines": { @@ -844,9 +844,9 @@ "dev": true }, "node_modules/@eslint/eslintrc/node_modules/globals": { - "version": "13.15.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-13.15.0.tgz", - "integrity": "sha512-bpzcOlgDhMG070Av0Vy5Owklpv1I6+j96GhUI7Rh7IzDCKLzboflLrrfqMu8NquDbiR4EOQk7XzJwqVJxicxog==", + "version": "13.17.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-13.17.0.tgz", + "integrity": "sha512-1C+6nQRb1GwGMKm2dH/E7enFAMxGTmGI7/dEdhy/DNelv85w9B72t3uc5frtMNXIbzrarJJ/lTCjcaZwbLJmyw==", "dev": true, "dependencies": { "type-fest": "^0.20.2" @@ -883,9 +883,9 @@ } }, "node_modules/@humanwhocodes/config-array": { - "version": "0.9.5", - "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.9.5.tgz", - "integrity": "sha512-ObyMyWxZiCu/yTisA7uzx81s40xR2fD5Cg/2Kq7G02ajkNubJf6BopgDTmDyc3U7sXpNKM8cYOw7s7Tyr+DnCw==", + "version": "0.10.4", + "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.10.4.tgz", + "integrity": "sha512-mXAIHxZT3Vcpg83opl1wGlVZ9xydbfZO3r5YfRSH6Gpp2J/PfdBP0wbDa2sO6/qRbcalpoevVyW6A/fI6LfeMw==", "dev": true, "dependencies": { "@humanwhocodes/object-schema": "^1.2.1", @@ -896,6 +896,16 @@ "node": ">=10.10.0" } }, + "node_modules/@humanwhocodes/gitignore-to-minimatch": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/@humanwhocodes/gitignore-to-minimatch/-/gitignore-to-minimatch-1.0.2.tgz", + "integrity": "sha512-rSqmMJDdLFUsyxR6FMtD00nfQKKLFb1kv+qBbOVKqErvloEIJLo5bDTJTQNTYgeyp78JsA7u/NPi5jT1GR/MuA==", + "dev": true, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/nzakas" + } + }, "node_modules/@humanwhocodes/object-schema": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/@humanwhocodes/object-schema/-/object-schema-1.2.1.tgz", @@ -1022,13 +1032,13 @@ } }, "node_modules/@jridgewell/source-map/node_modules/@jridgewell/gen-mapping": { - "version": "0.3.1", - "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.1.tgz", - "integrity": "sha512-GcHwniMlA2z+WFPWuY8lp3fsza0I8xPFMWL5+n8LYyP6PSvPrXf4+n8stDHZY2DM0zy9sVkRDy1jDI4XGzYVqg==", + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/@jridgewell/gen-mapping/-/gen-mapping-0.3.2.tgz", + "integrity": "sha512-mh65xKQAzI6iBcFzwv28KVWSmCkdRBWoOh+bYQGW3+6OZvbbN3TqMGo5hqYxQniRcH9F2VZIoJCm4pa3BPDK/A==", "dev": true, "peer": true, "dependencies": { - "@jridgewell/set-array": "^1.0.0", + "@jridgewell/set-array": "^1.0.1", "@jridgewell/sourcemap-codec": "^1.4.10", "@jridgewell/trace-mapping": "^0.3.9" }, @@ -1043,9 +1053,9 @@ "dev": true }, "node_modules/@jridgewell/trace-mapping": { - "version": "0.3.13", - "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.13.tgz", - "integrity": "sha512-o1xbKhp9qnIAoHJSWd6KlCZfqslL4valSF81H8ImioOAxluWYWOpWkpyktY2vnt4tbrX9XYaxovq6cgowaJp2w==", + "version": "0.3.15", + "resolved": "https://registry.npmjs.org/@jridgewell/trace-mapping/-/trace-mapping-0.3.15.tgz", + "integrity": "sha512-oWZNOULl+UbhsgB51uuZzglikfIKSUBO/M9W2OfEjn7cmqoAiCgmv9lyACTUacZwBz0ITnJ2NqjU8Tx0DHL88g==", "dev": true, "dependencies": { "@jridgewell/resolve-uri": "^3.0.3", @@ -1149,9 +1159,9 @@ } }, "node_modules/@types/eslint-scope": { - "version": "3.7.3", - "resolved": "https://registry.npmjs.org/@types/eslint-scope/-/eslint-scope-3.7.3.tgz", - "integrity": "sha512-PB3ldyrcnAicT35TWPs5IcwKD8S333HMaa2VVv4+wdvebJkjWuW/xESoB8IwRcog8HYVYamb1g/R31Qv5Bx03g==", + "version": "3.7.4", + "resolved": "https://registry.npmjs.org/@types/eslint-scope/-/eslint-scope-3.7.4.tgz", + "integrity": "sha512-9K4zoImiZc3HlIp6AVUDE4CWYx22a+lhSZMYNpbjW04+YF0KWj4pJXnEMjdnFTiQibFFmElcsasJXDbdI/EPhA==", "dev": true, "peer": true, "dependencies": { @@ -1190,9 +1200,9 @@ "dev": true }, "node_modules/@types/node": { - "version": "17.0.38", - "resolved": "https://registry.npmjs.org/@types/node/-/node-17.0.38.tgz", - "integrity": "sha512-5jY9RhV7c0Z4Jy09G+NIDTsCZ5G0L5n+Z+p+Y7t5VJHM30bgwzSjVtlcBxqAj+6L/swIlvtOSzr8rBk/aNyV2g==", + "version": "18.7.13", + "resolved": "https://registry.npmjs.org/@types/node/-/node-18.7.13.tgz", + "integrity": "sha512-46yIhxSe5xEaJZXWdIBP7GU4HDTG8/eo0qd9atdiL+lFpA03y8KS+lkTN834TWJj5767GbWv4n/P6efyTFt1Dw==", "dev": true, "peer": true }, @@ -1726,9 +1736,9 @@ } }, "node_modules/builtins": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/builtins/-/builtins-4.1.0.tgz", - "integrity": "sha512-1bPRZQtmKaO6h7qV1YHXNtr6nCK28k0Zo95KM4dXfILcZZwoHJBN1m3lfLv9LPkcOZlrSr+J1bzMaZFO98Yq0w==", + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/builtins/-/builtins-5.0.1.tgz", + "integrity": "sha512-qwVpFEHNfhYJIzNRBvd2C1kyo6jz3ZSMPyyuR47OPdiKWlbYnZNyDWuyR175qDnAJLiCo5fBBqPb3RiXgWlkOQ==", "dev": true, "dependencies": { "semver": "^7.0.0" @@ -2617,13 +2627,14 @@ } }, "node_modules/eslint": { - "version": "8.16.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.16.0.tgz", - "integrity": "sha512-MBndsoXY/PeVTDJeWsYj7kLZ5hQpJOfMYLsF6LicLHQWbRDG19lK5jOix4DPl8yY4SUFcE3txy86OzFLWT+yoA==", + "version": "8.22.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.22.0.tgz", + "integrity": "sha512-ci4t0sz6vSRKdmkOGmprBo6fmI4PrphDFMy5JEq/fNS0gQkJM3rLmrqcp8ipMcdobH3KtUP40KniAE9W19S4wA==", "dev": true, "dependencies": { "@eslint/eslintrc": "^1.3.0", - "@humanwhocodes/config-array": "^0.9.2", + "@humanwhocodes/config-array": "^0.10.4", + "@humanwhocodes/gitignore-to-minimatch": "^1.0.2", "ajv": "^6.10.0", "chalk": "^4.0.0", "cross-spawn": "^7.0.2", @@ -2633,14 +2644,17 @@ "eslint-scope": "^7.1.1", "eslint-utils": "^3.0.0", "eslint-visitor-keys": "^3.3.0", - "espree": "^9.3.2", + "espree": "^9.3.3", "esquery": "^1.4.0", "esutils": "^2.0.2", "fast-deep-equal": "^3.1.3", "file-entry-cache": "^6.0.1", + "find-up": "^5.0.0", "functional-red-black-tree": "^1.0.1", "glob-parent": "^6.0.1", "globals": "^13.15.0", + "globby": "^11.1.0", + "grapheme-splitter": "^1.0.4", "ignore": "^5.2.0", "import-fresh": "^3.0.0", "imurmurhash": "^0.1.4", @@ -2681,9 +2695,9 @@ } }, "node_modules/eslint-config-xo": { - "version": "0.41.0", - "resolved": "https://registry.npmjs.org/eslint-config-xo/-/eslint-config-xo-0.41.0.tgz", - "integrity": "sha512-cyTc182COQVdalOi5105h0Cw/Qb52IRGyIZLmUICIauANm9Upmv81UEsuFkdKnvwr4NtU95qjdk3g4/kNspA6g==", + "version": "0.42.0", + "resolved": "https://registry.npmjs.org/eslint-config-xo/-/eslint-config-xo-0.42.0.tgz", + "integrity": "sha512-HIfd+AM6tHFoaZ/NXYDV3Mr/CJrAj/DoP6IOYt1/v+90XtCwVYOfW7LXbRDYDmhQMzT16h7eqPRcex72waRqdA==", "dev": true, "dependencies": { "confusing-browser-globals": "1.0.11" @@ -2925,16 +2939,20 @@ } }, "node_modules/eslint-module-utils": { - "version": "2.7.3", - "resolved": "https://registry.npmjs.org/eslint-module-utils/-/eslint-module-utils-2.7.3.tgz", - "integrity": "sha512-088JEC7O3lDZM9xGe0RerkOMd0EjFl+Yvd1jPWIkMT5u3H9+HC34mWWPnqPrN13gieT9pBOO+Qt07Nb/6TresQ==", + "version": "2.7.4", + "resolved": "https://registry.npmjs.org/eslint-module-utils/-/eslint-module-utils-2.7.4.tgz", + "integrity": "sha512-j4GT+rqzCoRKHwURX7pddtIPGySnX9Si/cgMI5ztrcqOPtk5dDEeZ34CQVPphnqkJytlc97Vuk05Um2mJ3gEQA==", "dev": true, "dependencies": { - "debug": "^3.2.7", - "find-up": "^2.1.0" + "debug": "^3.2.7" }, "engines": { "node": ">=4" + }, + "peerDependenciesMeta": { + "eslint": { + "optional": true + } } }, "node_modules/eslint-module-utils/node_modules/debug": { @@ -2946,73 +2964,6 @@ "ms": "^2.1.1" } }, - "node_modules/eslint-module-utils/node_modules/find-up": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-2.1.0.tgz", - "integrity": "sha512-NWzkk0jSJtTt08+FBFMvXoeZnOJD+jTtsRmBYbAIzJdX6l7dLgR7CTubCM5/eDdPUBvLCeVasP1brfVR/9/EZQ==", - "dev": true, - "dependencies": { - "locate-path": "^2.0.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/eslint-module-utils/node_modules/locate-path": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-2.0.0.tgz", - "integrity": "sha512-NCI2kiDkyR7VeEKm27Kda/iQHyKJe1Bu0FlTbYp3CqJu+9IFe9bLyAjMxf5ZDDbEg+iMPzB5zYyUTSm8wVTKmA==", - "dev": true, - "dependencies": { - "p-locate": "^2.0.0", - "path-exists": "^3.0.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/eslint-module-utils/node_modules/p-limit": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-1.3.0.tgz", - "integrity": "sha512-vvcXsLAJ9Dr5rQOPk7toZQZJApBl2K4J6dANSsEuh6QI41JYcsS/qhTGa9ErIUUgK3WNQoJYvylxvjqmiqEA9Q==", - "dev": true, - "dependencies": { - "p-try": "^1.0.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/eslint-module-utils/node_modules/p-locate": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-2.0.0.tgz", - "integrity": "sha512-nQja7m7gSKuewoVRen45CtVfODR3crN3goVQ0DDZ9N3yHxgpkuBhZqsaiotSQRrADUrne346peY7kT3TSACykg==", - "dev": true, - "dependencies": { - "p-limit": "^1.1.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/eslint-module-utils/node_modules/p-try": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/p-try/-/p-try-1.0.0.tgz", - "integrity": "sha512-U1etNYuMJoIz3ZXSrrySFjsXQTWOx2/jdi86L+2pRvph/qMKL6sbcCYdH23fqsbm8TH2Gn0OybpT4eSFlCVHww==", - "dev": true, - "engines": { - "node": ">=4" - } - }, - "node_modules/eslint-module-utils/node_modules/path-exists": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", - "integrity": "sha512-bpC7GYwiDYQ4wYLe+FA8lhRjhQCMcQGuSgGGqDkg/QerRWw9CmGRT0iSOVRSZJ29NMLZgIzqaljJ63oaL4NIJQ==", - "dev": true, - "engines": { - "node": ">=4" - } - }, "node_modules/eslint-plugin-ava": { "version": "13.2.0", "resolved": "https://registry.npmjs.org/eslint-plugin-ava/-/eslint-plugin-ava-13.2.0.tgz", @@ -3048,9 +2999,9 @@ } }, "node_modules/eslint-plugin-es": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/eslint-plugin-es/-/eslint-plugin-es-3.0.1.tgz", - "integrity": "sha512-GUmAsJaN4Fc7Gbtl8uOBlayo2DqhwWvEzykMHSCZHU3XdJ+NSzzZcVhXh3VxX5icqQ+oQdIEawXX8xkR3mIFmQ==", + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-es/-/eslint-plugin-es-4.1.0.tgz", + "integrity": "sha512-GILhQTnjYE2WorX5Jyi5i4dz5ALWxBIdQECVQavL6s7cI76IZTDWleTHkxz/QT3kvcs2QlGHvKLYsSlPOlPXnQ==", "dev": true, "dependencies": { "eslint-utils": "^2.0.0", @@ -3172,84 +3123,56 @@ "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==", "dev": true }, - "node_modules/eslint-plugin-no-use-extend-native": { - "version": "0.5.0", - "resolved": "https://registry.npmjs.org/eslint-plugin-no-use-extend-native/-/eslint-plugin-no-use-extend-native-0.5.0.tgz", - "integrity": "sha512-dBNjs8hor8rJgeXLH4HTut5eD3RGWf9JUsadIfuL7UosVQ/dnvOKwxEcRrXrFxrMZ8llUVWT+hOimxJABsAUzQ==", + "node_modules/eslint-plugin-n": { + "version": "15.2.5", + "resolved": "https://registry.npmjs.org/eslint-plugin-n/-/eslint-plugin-n-15.2.5.tgz", + "integrity": "sha512-8+BYsqiyZfpu6NXmdLOXVUfk8IocpCjpd8nMRRH0A9ulrcemhb2VI9RSJMEy5udx++A/YcVPD11zT8hpFq368g==", "dev": true, "dependencies": { - "is-get-set-prop": "^1.0.0", - "is-js-type": "^2.0.0", - "is-obj-prop": "^1.0.0", - "is-proto-prop": "^2.0.0" - }, - "engines": { - "node": ">=6.0.0" - } - }, - "node_modules/eslint-plugin-node": { - "version": "11.1.0", - "resolved": "https://registry.npmjs.org/eslint-plugin-node/-/eslint-plugin-node-11.1.0.tgz", - "integrity": "sha512-oUwtPJ1W0SKD0Tr+wqu92c5xuCeQqB3hSCHasn/ZgjFdA9iDGNkNf2Zi9ztY7X+hNuMib23LNGRm6+uN+KLE3g==", - "dev": true, - "dependencies": { - "eslint-plugin-es": "^3.0.0", - "eslint-utils": "^2.0.0", + "builtins": "^5.0.1", + "eslint-plugin-es": "^4.1.0", + "eslint-utils": "^3.0.0", "ignore": "^5.1.1", - "minimatch": "^3.0.4", - "resolve": "^1.10.1", - "semver": "^6.1.0" + "is-core-module": "^2.10.0", + "minimatch": "^3.1.2", + "resolve": "^1.22.1", + "semver": "^7.3.7" }, "engines": { - "node": ">=8.10.0" + "node": ">=12.22.0" + }, + "funding": { + "url": "https://github.com/sponsors/mysticatea" }, "peerDependencies": { - "eslint": ">=5.16.0" + "eslint": ">=7.0.0" } }, - "node_modules/eslint-plugin-node/node_modules/eslint-utils": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-2.1.0.tgz", - "integrity": "sha512-w94dQYoauyvlDc43XnGB8lU3Zt713vNChgt4EWwhXAP2XkBvndfxF0AgIqKOOasjPIPzj9JqgwkwbCYD0/V3Zg==", + "node_modules/eslint-plugin-no-use-extend-native": { + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-no-use-extend-native/-/eslint-plugin-no-use-extend-native-0.5.0.tgz", + "integrity": "sha512-dBNjs8hor8rJgeXLH4HTut5eD3RGWf9JUsadIfuL7UosVQ/dnvOKwxEcRrXrFxrMZ8llUVWT+hOimxJABsAUzQ==", "dev": true, "dependencies": { - "eslint-visitor-keys": "^1.1.0" - }, - "engines": { - "node": ">=6" + "is-get-set-prop": "^1.0.0", + "is-js-type": "^2.0.0", + "is-obj-prop": "^1.0.0", + "is-proto-prop": "^2.0.0" }, - "funding": { - "url": "https://github.com/sponsors/mysticatea" - } - }, - "node_modules/eslint-plugin-node/node_modules/eslint-visitor-keys": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz", - "integrity": "sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ==", - "dev": true, "engines": { - "node": ">=4" - } - }, - "node_modules/eslint-plugin-node/node_modules/semver": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", - "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", - "dev": true, - "bin": { - "semver": "bin/semver.js" + "node": ">=6.0.0" } }, "node_modules/eslint-plugin-prettier": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/eslint-plugin-prettier/-/eslint-plugin-prettier-4.0.0.tgz", - "integrity": "sha512-98MqmCJ7vJodoQK359bqQWaxOE0CS8paAz/GgjaZLyex4TTk3g9HugoO89EqWCrFiOqn9EVvcoo7gZzONCWVwQ==", + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/eslint-plugin-prettier/-/eslint-plugin-prettier-4.2.1.tgz", + "integrity": "sha512-f/0rXLXUt0oFYs8ra4w49wYZBG5GKZpAYsJSm6rnYL5uVDjd+zowwMwVZHnAjf4edNrKpCDYfXDgmRE/Ak7QyQ==", "dev": true, "dependencies": { "prettier-linter-helpers": "^1.0.0" }, "engines": { - "node": ">=6.0.0" + "node": ">=12.0.0" }, "peerDependencies": { "eslint": ">=7.28.0", @@ -3445,9 +3368,9 @@ } }, "node_modules/eslint/node_modules/globals": { - "version": "13.15.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-13.15.0.tgz", - "integrity": "sha512-bpzcOlgDhMG070Av0Vy5Owklpv1I6+j96GhUI7Rh7IzDCKLzboflLrrfqMu8NquDbiR4EOQk7XzJwqVJxicxog==", + "version": "13.17.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-13.17.0.tgz", + "integrity": "sha512-1C+6nQRb1GwGMKm2dH/E7enFAMxGTmGI7/dEdhy/DNelv85w9B72t3uc5frtMNXIbzrarJJ/lTCjcaZwbLJmyw==", "dev": true, "dependencies": { "type-fest": "^0.20.2" @@ -3459,6 +3382,26 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/eslint/node_modules/globby": { + "version": "11.1.0", + "resolved": "https://registry.npmjs.org/globby/-/globby-11.1.0.tgz", + "integrity": "sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g==", + "dev": true, + "dependencies": { + "array-union": "^2.1.0", + "dir-glob": "^3.0.1", + "fast-glob": "^3.2.9", + "ignore": "^5.2.0", + "merge2": "^1.4.1", + "slash": "^3.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/eslint/node_modules/js-yaml": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", @@ -3496,12 +3439,12 @@ } }, "node_modules/esm-utils": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/esm-utils/-/esm-utils-4.0.0.tgz", - "integrity": "sha512-1x5H25/8BQWV94T8+KRb1gcSdVQ3g+8P0NikggAujVaurUa0cOoR+UO8ie3y29iQO70HjNA93c9ie+qqI/8zzw==", + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/esm-utils/-/esm-utils-4.1.0.tgz", + "integrity": "sha512-/oTSIjfeNL/gzVgM7CbRL4bqE8aKU1ANJqr8voBwTXvVMjYYm15PdYG6c6zNSAHNa3s9b6UMRHDosIq26OBdWg==", "dev": true, "dependencies": { - "import-meta-resolve": "1.1.1", + "import-meta-resolve": "2.1.0", "url-or-path": "2.1.0" }, "funding": { @@ -3509,17 +3452,20 @@ } }, "node_modules/espree": { - "version": "9.3.2", - "resolved": "https://registry.npmjs.org/espree/-/espree-9.3.2.tgz", - "integrity": "sha512-D211tC7ZwouTIuY5x9XnS0E9sWNChB7IYKX/Xp5eQj3nFXhqmiUDB9q27y76oFl8jTg3pXcQx/bpxMfs3CIZbA==", + "version": "9.3.3", + "resolved": "https://registry.npmjs.org/espree/-/espree-9.3.3.tgz", + "integrity": "sha512-ORs1Rt/uQTqUKjDdGCyrtYxbazf5umATSf/K4qxjmZHORR6HJk+2s/2Pqe+Kk49HHINC/xNIrGfgh8sZcll0ng==", "dev": true, "dependencies": { - "acorn": "^8.7.1", + "acorn": "^8.8.0", "acorn-jsx": "^5.3.2", "eslint-visitor-keys": "^3.3.0" }, "engines": { "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + }, + "funding": { + "url": "https://opencollective.com/eslint" } }, "node_modules/esprima": { @@ -3763,9 +3709,9 @@ } }, "node_modules/flatted": { - "version": "3.2.5", - "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.2.5.tgz", - "integrity": "sha512-WIWGi2L3DyTUvUrwRKgGi9TwxQMUEqPOPQBVi71R96jZXJdFskXEmf54BoZaS1kknGODoIGASGEzBUYdyMCBJg==", + "version": "3.2.7", + "resolved": "https://registry.npmjs.org/flatted/-/flatted-3.2.7.tgz", + "integrity": "sha512-5nqDSxl8nn5BSNxyR3n4I6eDmbolI6WT+QqR547RwxQapgjQBmtktdP+HTBb/a/zLsbzERTONyUB5pefh5TtjQ==", "dev": true }, "node_modules/foreground-child": { @@ -3902,14 +3848,14 @@ } }, "node_modules/get-intrinsic": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.1.1.tgz", - "integrity": "sha512-kWZrnVM42QCiEA2Ig1bG8zjoIMOgxWwYCEeNdwY6Tv/cOSeGpcoX4pXHfKUxNKVoArnrEr2e9srnAxxGIraS9Q==", + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.1.2.tgz", + "integrity": "sha512-Jfm3OyCxHh9DJyc28qGk+JmfkpO41A4XkneDSujN9MDXrm4oDKdHvndhZ2dN94+ERNfkYJWDclW6k2L/ZGHjXA==", "dev": true, "dependencies": { "function-bind": "^1.1.1", "has": "^1.0.3", - "has-symbols": "^1.0.1" + "has-symbols": "^1.0.3" }, "funding": { "url": "https://github.com/sponsors/ljharb" @@ -4053,6 +3999,12 @@ "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.10.tgz", "integrity": "sha512-9ByhssR2fPVsNZj478qUUbKfmL0+t5BDVyjShtyZZLiK7ZDAArFFfopyOTj0M05wE2tJPisA4iTnnXl2YoPvOA==" }, + "node_modules/grapheme-splitter": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/grapheme-splitter/-/grapheme-splitter-1.0.4.tgz", + "integrity": "sha512-bzh50DW9kTPM00T8y4o8vQg89Di9oLJVLW/KaOGIXJWP/iqCN6WKYkbNOF04vFLJhwcpYUh9ydh/+5vpOqV4YQ==", + "dev": true + }, "node_modules/hard-rejection": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/hard-rejection/-/hard-rejection-2.1.0.tgz", @@ -4237,13 +4189,10 @@ } }, "node_modules/import-meta-resolve": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/import-meta-resolve/-/import-meta-resolve-1.1.1.tgz", - "integrity": "sha512-JiTuIvVyPaUg11eTrNDx5bgQ/yMKMZffc7YSjvQeSMXy58DO2SQ8BtAf3xteZvmzvjYh14wnqNjL8XVeDy2o9A==", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/import-meta-resolve/-/import-meta-resolve-2.1.0.tgz", + "integrity": "sha512-yG9pxkWJVTy4cmRsNWE3ztFdtFuYIV8G4N+cbCkO8b+qngkLyIUhxQFuZ0qJm67+0nUOxjMPT7nfksPKza1v2g==", "dev": true, - "dependencies": { - "builtins": "^4.0.0" - }, "funding": { "type": "github", "url": "https://github.com/sponsors/wooorm" @@ -4384,15 +4333,18 @@ } }, "node_modules/is-builtin-module": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/is-builtin-module/-/is-builtin-module-3.1.0.tgz", - "integrity": "sha512-OV7JjAgOTfAFJmHZLvpSTb4qi0nIILDV1gWPYDnDJUTNFM5aGlRAhk4QcT8i7TuAleeEV5Fdkqn3t4mS+Q11fg==", + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/is-builtin-module/-/is-builtin-module-3.2.0.tgz", + "integrity": "sha512-phDA4oSGt7vl1n5tJvTWooWWAsXLY+2xCnxNqvKhGEzujg+A43wPlPOyDg3C8XQHN+6k/JTQWJ/j0dQh/qr+Hw==", "dev": true, "dependencies": { - "builtin-modules": "^3.0.0" + "builtin-modules": "^3.3.0" }, "engines": { "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" } }, "node_modules/is-callable": { @@ -4408,9 +4360,9 @@ } }, "node_modules/is-core-module": { - "version": "2.9.0", - "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.9.0.tgz", - "integrity": "sha512-+5FPy5PnwmO3lvfMb0AsoPaBG+5KHUI0wYFXOtYPnVVVspTFUuMZNfNaNVRt3FZadstu2c8x23vykRW/NBoU6A==", + "version": "2.10.0", + "resolved": "https://registry.npmjs.org/is-core-module/-/is-core-module-2.10.0.tgz", + "integrity": "sha512-Erxj2n/LDAZ7H8WNJXd9tw38GYM3dv8rk8Zcs+jJuxYTW7sozH+SS8NtrSjVL1/vpLvWi1hxy96IzjJ3EHTJJg==", "dev": true, "dependencies": { "has": "^1.0.3" @@ -5126,9 +5078,9 @@ } }, "node_modules/line-column-path/node_modules/type-fest": { - "version": "2.13.0", - "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-2.13.0.tgz", - "integrity": "sha512-lPfAm42MxE4/456+QyIaaVBAwgpJb6xZ8PRu09utnhPdWwcyj9vgy6Sq0Z5yNbJ21EdxB5dRU/Qg8bsyAMtlcw==", + "version": "2.19.0", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-2.19.0.tgz", + "integrity": "sha512-RAH822pAdBgcNMAfWnCBU3CFZcfZ/i1eZjwFU/dsLKumyuuP3niueg2UAukXYF0E2AAoc82ZSSf9J0WQBinzHA==", "dev": true, "engines": { "node": ">=12.20" @@ -6010,14 +5962,14 @@ } }, "node_modules/object.assign": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.2.tgz", - "integrity": "sha512-ixT2L5THXsApyiUPYKmW+2EHpXXe5Ii3M+f4e+aJFAHao5amFRW6J0OO6c/LU8Be47utCx2GL89hxGB6XSmKuQ==", + "version": "4.1.4", + "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.4.tgz", + "integrity": "sha512-1mxKf0e58bvyjSCtKYY4sRe9itRk3PJpquJOjeIkz885CczcI4IvJJDLPS72oowuSh+pBxUFROpX+TU++hxhZQ==", "dev": true, "dependencies": { - "call-bind": "^1.0.0", - "define-properties": "^1.1.3", - "has-symbols": "^1.0.1", + "call-bind": "^1.0.2", + "define-properties": "^1.1.4", + "has-symbols": "^1.0.3", "object-keys": "^1.1.1" }, "engines": { @@ -6646,9 +6598,9 @@ } }, "node_modules/prettier": { - "version": "2.6.2", - "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.6.2.tgz", - "integrity": "sha512-PkUpF+qoXTqhOeWL9fu7As8LXsIUZ1WYaJiY/a7McAQzxjk82OF0tibkFXVCDImZtWxbvojFjerkiLb0/q8mew==", + "version": "2.7.1", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.7.1.tgz", + "integrity": "sha512-ujppO+MkdPqoVINuDFDRLClm7D78qbDt0/NR+wp5FqEZOoTNAjPHWj17QRhu7geIHJfcNhRk1XVQmF8Bp3ye+g==", "dev": true, "bin": { "prettier": "bin-prettier.js" @@ -6993,12 +6945,12 @@ "dev": true }, "node_modules/resolve": { - "version": "1.22.0", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.0.tgz", - "integrity": "sha512-Hhtrw0nLeSrFQ7phPp4OOcVjLPIeMnRlr5mcnVuMe7M/7eBn98A3hmFRLoFo3DLZkivSYwhRUJTyPyWAk56WLw==", + "version": "1.22.1", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.22.1.tgz", + "integrity": "sha512-nBpuuYuY5jFsli/JIs1oldw6fOQCBioohqWZg/2hiaOybXOft4lonv85uDOKXdf8rhyK159cxU5cDcK/NKk8zw==", "dev": true, "dependencies": { - "is-core-module": "^2.8.1", + "is-core-module": "^2.9.0", "path-parse": "^1.0.7", "supports-preserve-symlinks-flag": "^1.0.0" }, @@ -9494,7 +9446,7 @@ "node_modules/tapable": { "version": "0.1.10", "resolved": "https://registry.npmjs.org/tapable/-/tapable-0.1.10.tgz", - "integrity": "sha1-KcNXB8K3DlDQdIK10gLo7URtr9Q=", + "integrity": "sha512-jX8Et4hHg57mug1/079yitEKWGB3LCwoxByLsNim89LABq8NqgiX+6iYVOsq0vX8uJHkU+DZ5fnq95f800bEsQ==", "dev": true, "engines": { "node": ">=0.6" @@ -9599,9 +9551,9 @@ } }, "node_modules/terser": { - "version": "5.14.0", - "resolved": "https://registry.npmjs.org/terser/-/terser-5.14.0.tgz", - "integrity": "sha512-JC6qfIEkPBd9j1SMO3Pfn+A6w2kQV54tv+ABQLgZr7dA3k/DL/OBoYSWxzVpZev3J+bUHXfr55L8Mox7AaNo6g==", + "version": "5.15.0", + "resolved": "https://registry.npmjs.org/terser/-/terser-5.15.0.tgz", + "integrity": "sha512-L1BJiXVmheAQQy+as0oF3Pwtlo4s3Wi1X2zNZ2NxOB4wx9bdS9Vk67XQENLFdLYGCK/Z2di53mTj/hBafR+dTA==", "dev": true, "peer": true, "dependencies": { @@ -9618,17 +9570,17 @@ } }, "node_modules/terser-webpack-plugin": { - "version": "5.3.3", - "resolved": "https://registry.npmjs.org/terser-webpack-plugin/-/terser-webpack-plugin-5.3.3.tgz", - "integrity": "sha512-Fx60G5HNYknNTNQnzQ1VePRuu89ZVYWfjRAeT5rITuCY/1b08s49e5kSQwHDirKZWuoKOBRFS98EUUoZ9kLEwQ==", + "version": "5.3.5", + "resolved": "https://registry.npmjs.org/terser-webpack-plugin/-/terser-webpack-plugin-5.3.5.tgz", + "integrity": "sha512-AOEDLDxD2zylUGf/wxHxklEkOe2/r+seuyOWujejFrIxHf11brA1/dWQNIgXa1c6/Wkxgu7zvv0JhOWfc2ELEA==", "dev": true, "peer": true, "dependencies": { - "@jridgewell/trace-mapping": "^0.3.7", + "@jridgewell/trace-mapping": "^0.3.14", "jest-worker": "^27.4.5", "schema-utils": "^3.1.1", "serialize-javascript": "^6.0.0", - "terser": "^5.7.2" + "terser": "^5.14.1" }, "engines": { "node": ">= 10.13.0" @@ -9669,7 +9621,7 @@ "node_modules/text-table": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", - "integrity": "sha1-f17oI66AUgfACvLfSoTsP8+lcLQ=", + "integrity": "sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw==", "dev": true }, "node_modules/time-zone": { @@ -9683,7 +9635,7 @@ "node_modules/to-absolute-glob": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/to-absolute-glob/-/to-absolute-glob-2.0.2.tgz", - "integrity": "sha1-GGX0PZ50sIItufFFt4z/fQ98hJs=", + "integrity": "sha512-rtwLUQEwT8ZeKQbyFJyomBRYXyE16U5VKuy0ftxLMK/PZb2fkOsg5r9kHdauuVDbsNdIBoC/HCthpidamQFXYA==", "dev": true, "dependencies": { "is-absolute": "^1.0.0", @@ -9767,7 +9719,7 @@ "node_modules/tsconfig-paths/node_modules/strip-bom": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz", - "integrity": "sha1-IzTBjpx1n3vdVv3vfprj1YjmjtM=", + "integrity": "sha512-vavAMRXOgBVNF6nyEEmL3DBK19iRpDcoIwW+swQ+CbGiu7lju6t+JklA1MHweoWtadgt4ISVUsXLyDq34ddcwA==", "dev": true, "engines": { "node": ">=4" @@ -9886,7 +9838,7 @@ "node_modules/unc-path-regex": { "version": "0.1.2", "resolved": "https://registry.npmjs.org/unc-path-regex/-/unc-path-regex-0.1.2.tgz", - "integrity": "sha1-5z3T17DXxe2G+6xrCufYxqadUPo=", + "integrity": "sha512-eXL4nmJT7oCpkZsHZUOJo8hcX3GbsiDOa0Qu9F646fi8dT3XuSVopVqAcEiVzSKKH7UoDti23wNX3qGFxcW5Qg==", "dev": true, "engines": { "node": ">=0.10.0" @@ -10020,9 +9972,9 @@ } }, "node_modules/webpack": { - "version": "5.73.0", - "resolved": "https://registry.npmjs.org/webpack/-/webpack-5.73.0.tgz", - "integrity": "sha512-svjudQRPPa0YiOYa2lM/Gacw0r6PvxptHj4FuEKQ2kX05ZLkjbVc5MnPs6its5j7IZljnIqSVo/OsY2X0IpHGA==", + "version": "5.74.0", + "resolved": "https://registry.npmjs.org/webpack/-/webpack-5.74.0.tgz", + "integrity": "sha512-A2InDwnhhGN4LYctJj6M1JEaGL7Luj6LOmyBHjcI8529cm5p6VXiTIW2sn6ffvEAKmveLzvu4jrihwXtPojlAA==", "dev": true, "peer": true, "dependencies": { @@ -10031,11 +9983,11 @@ "@webassemblyjs/ast": "1.11.1", "@webassemblyjs/wasm-edit": "1.11.1", "@webassemblyjs/wasm-parser": "1.11.1", - "acorn": "^8.4.1", + "acorn": "^8.7.1", "acorn-import-assertions": "^1.7.6", "browserslist": "^4.14.5", "chrome-trace-event": "^1.0.2", - "enhanced-resolve": "^5.9.3", + "enhanced-resolve": "^5.10.0", "es-module-lexer": "^0.9.0", "eslint-scope": "5.1.1", "events": "^3.2.0", @@ -10048,7 +10000,7 @@ "schema-utils": "^3.1.0", "tapable": "^2.1.1", "terser-webpack-plugin": "^5.1.3", - "watchpack": "^2.3.1", + "watchpack": "^2.4.0", "webpack-sources": "^3.2.3" }, "bin": { @@ -10078,9 +10030,9 @@ } }, "node_modules/webpack/node_modules/enhanced-resolve": { - "version": "5.9.3", - "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.9.3.tgz", - "integrity": "sha512-Bq9VSor+kjvW3f9/MiiR4eE3XYgOl7/rS8lnSxbRbF3kS0B2r+Y9w5krBWxZgDxASVZbdYrn5wT4j/Wb0J9qow==", + "version": "5.10.0", + "resolved": "https://registry.npmjs.org/enhanced-resolve/-/enhanced-resolve-5.10.0.tgz", + "integrity": "sha512-T0yTFjdpldGY8PmuXXR0PyQ1ufZpEGiHVrp7zHKB7jdR4qlmZHhONVM5AQOAWXuF/w3dnHbEQVrNptJgt7F+cQ==", "dev": true, "peer": true, "dependencies": { @@ -10288,9 +10240,9 @@ } }, "node_modules/xo": { - "version": "0.49.0", - "resolved": "https://registry.npmjs.org/xo/-/xo-0.49.0.tgz", - "integrity": "sha512-dDj1bYy3LJ/8C2XItw/lFVckZtO68C2YCx9TR8xfSLVcmael3y0SkeFse/3OMUPMvG5jG44bQ2CAI6wFTpRqVg==", + "version": "0.52.2", + "resolved": "https://registry.npmjs.org/xo/-/xo-0.52.2.tgz", + "integrity": "sha512-FTvJb6P6w1h3tu5jy3firRyLSqvJSHeffajpZ05RP4Xe0OUJkQzcwwOEF9/VUHC7lTBPnOrewEGJzQo8Mujx3Q==", "bundleDependencies": [ "@typescript-eslint/eslint-plugin", "@typescript-eslint/parser", @@ -10298,26 +10250,26 @@ ], "dev": true, "dependencies": { - "@eslint/eslintrc": "^1.2.3", + "@eslint/eslintrc": "^1.3.0", "@typescript-eslint/eslint-plugin": "*", "@typescript-eslint/parser": "*", "arrify": "^3.0.0", "cosmiconfig": "^7.0.1", "define-lazy-prop": "^3.0.0", - "eslint": "^8.15.0", + "eslint": "^8.22.0", "eslint-config-prettier": "^8.5.0", - "eslint-config-xo": "^0.41.0", + "eslint-config-xo": "^0.42.0", "eslint-config-xo-typescript": "*", "eslint-formatter-pretty": "^4.1.0", "eslint-import-resolver-webpack": "^0.13.2", "eslint-plugin-ava": "^13.2.0", "eslint-plugin-eslint-comments": "^3.2.0", "eslint-plugin-import": "^2.26.0", + "eslint-plugin-n": "^15.2.5", "eslint-plugin-no-use-extend-native": "^0.5.0", - "eslint-plugin-node": "^11.1.0", "eslint-plugin-prettier": "^4.0.0", "eslint-plugin-unicorn": "^42.0.0", - "esm-utils": "^4.0.0", + "esm-utils": "^4.1.0", "find-cache-dir": "^3.3.2", "find-up": "^6.3.0", "get-stdin": "^9.0.0", @@ -10333,7 +10285,7 @@ "semver": "^7.3.7", "slash": "^4.0.0", "to-absolute-glob": "^2.0.2", - "typescript": "^4.6.4" + "typescript": "^4.7.3" }, "bin": { "xo": "cli.js" @@ -10387,14 +10339,14 @@ "license": "MIT" }, "node_modules/xo/node_modules/@typescript-eslint/eslint-plugin": { - "version": "5.24.0", + "version": "5.35.1", "dev": true, "inBundle": true, "license": "MIT", "dependencies": { - "@typescript-eslint/scope-manager": "5.24.0", - "@typescript-eslint/type-utils": "5.24.0", - "@typescript-eslint/utils": "5.24.0", + "@typescript-eslint/scope-manager": "5.35.1", + "@typescript-eslint/type-utils": "5.35.1", + "@typescript-eslint/utils": "5.35.1", "debug": "^4.3.4", "functional-red-black-tree": "^1.0.1", "ignore": "^5.2.0", @@ -10420,14 +10372,14 @@ } }, "node_modules/xo/node_modules/@typescript-eslint/parser": { - "version": "5.24.0", + "version": "5.35.1", "dev": true, "inBundle": true, "license": "BSD-2-Clause", "dependencies": { - "@typescript-eslint/scope-manager": "5.24.0", - "@typescript-eslint/types": "5.24.0", - "@typescript-eslint/typescript-estree": "5.24.0", + "@typescript-eslint/scope-manager": "5.35.1", + "@typescript-eslint/types": "5.35.1", + "@typescript-eslint/typescript-estree": "5.35.1", "debug": "^4.3.4" }, "engines": { @@ -10447,13 +10399,13 @@ } }, "node_modules/xo/node_modules/@typescript-eslint/scope-manager": { - "version": "5.24.0", + "version": "5.35.1", "dev": true, "inBundle": true, "license": "MIT", "dependencies": { - "@typescript-eslint/types": "5.24.0", - "@typescript-eslint/visitor-keys": "5.24.0" + "@typescript-eslint/types": "5.35.1", + "@typescript-eslint/visitor-keys": "5.35.1" }, "engines": { "node": "^12.22.0 || ^14.17.0 || >=16.0.0" @@ -10464,12 +10416,12 @@ } }, "node_modules/xo/node_modules/@typescript-eslint/type-utils": { - "version": "5.24.0", + "version": "5.35.1", "dev": true, "inBundle": true, "license": "MIT", "dependencies": { - "@typescript-eslint/utils": "5.24.0", + "@typescript-eslint/utils": "5.35.1", "debug": "^4.3.4", "tsutils": "^3.21.0" }, @@ -10490,7 +10442,7 @@ } }, "node_modules/xo/node_modules/@typescript-eslint/types": { - "version": "5.24.0", + "version": "5.35.1", "dev": true, "inBundle": true, "license": "MIT", @@ -10503,13 +10455,13 @@ } }, "node_modules/xo/node_modules/@typescript-eslint/typescript-estree": { - "version": "5.24.0", + "version": "5.35.1", "dev": true, "inBundle": true, "license": "BSD-2-Clause", "dependencies": { - "@typescript-eslint/types": "5.24.0", - "@typescript-eslint/visitor-keys": "5.24.0", + "@typescript-eslint/types": "5.35.1", + "@typescript-eslint/visitor-keys": "5.35.1", "debug": "^4.3.4", "globby": "^11.1.0", "is-glob": "^4.0.3", @@ -10559,15 +10511,15 @@ } }, "node_modules/xo/node_modules/@typescript-eslint/utils": { - "version": "5.24.0", + "version": "5.35.1", "dev": true, "inBundle": true, "license": "MIT", "dependencies": { "@types/json-schema": "^7.0.9", - "@typescript-eslint/scope-manager": "5.24.0", - "@typescript-eslint/types": "5.24.0", - "@typescript-eslint/typescript-estree": "5.24.0", + "@typescript-eslint/scope-manager": "5.35.1", + "@typescript-eslint/types": "5.35.1", + "@typescript-eslint/typescript-estree": "5.35.1", "eslint-scope": "^5.1.1", "eslint-utils": "^3.0.0" }, @@ -10583,12 +10535,12 @@ } }, "node_modules/xo/node_modules/@typescript-eslint/visitor-keys": { - "version": "5.24.0", + "version": "5.35.1", "dev": true, "inBundle": true, "license": "MIT", "dependencies": { - "@typescript-eslint/types": "5.24.0", + "@typescript-eslint/types": "5.35.1", "eslint-visitor-keys": "^3.3.0" }, "engines": { @@ -10698,7 +10650,7 @@ } }, "node_modules/xo/node_modules/eslint-config-xo-typescript": { - "version": "0.51.1", + "version": "0.53.0", "dev": true, "inBundle": true, "license": "MIT", @@ -10709,7 +10661,8 @@ "url": "https://github.com/sponsors/sindresorhus" }, "peerDependencies": { - "@typescript-eslint/eslint-plugin": ">=5.22.0", + "@typescript-eslint/eslint-plugin": ">=5.31.0", + "@typescript-eslint/parser": ">=5.31.0", "eslint": ">=8.0.0", "typescript": ">=4.4" } @@ -10904,9 +10857,9 @@ } }, "node_modules/xo/node_modules/locate-path": { - "version": "7.1.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-7.1.0.tgz", - "integrity": "sha512-HNx5uOnYeK4SxEoid5qnhRfprlJeGMzFRKPLCf/15N3/B4AiofNwC/yq7VBKdVk9dx7m+PiYCJOGg55JYTAqoQ==", + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-7.1.1.tgz", + "integrity": "sha512-vJXaRMJgRVD3+cUZs3Mncj2mxpt5mP0EmNOsxRSZRMlbqjvxzDEOIUWXGmavo0ZC9+tNZCBLQ66reA11nbpHZg==", "dev": true, "dependencies": { "p-locate": "^6.0.0" @@ -10931,9 +10884,9 @@ } }, "node_modules/xo/node_modules/meow": { - "version": "10.1.2", - "resolved": "https://registry.npmjs.org/meow/-/meow-10.1.2.tgz", - "integrity": "sha512-zbuAlN+V/sXlbGchNS9WTWjUzeamwMt/BApKCJi7B0QyZstZaMx0n4Unll/fg0njGtMdC9UP5SAscvOCLYdM+Q==", + "version": "10.1.3", + "resolved": "https://registry.npmjs.org/meow/-/meow-10.1.3.tgz", + "integrity": "sha512-0WL7RMCPPdUTE00+GxJjL4d5Dm6eUbmAzxlzywJWiRUKCW093owmZ7/q74tH9VI91vxw9KJJNxAcvdpxb2G4iA==", "dev": true, "dependencies": { "@types/minimist": "^1.2.2", diff --git a/package.json b/package.json index fd22faf0b..fd0452a1a 100644 --- a/package.json +++ b/package.json @@ -145,7 +145,7 @@ "touch": "^3.1.0", "tsd": "^0.22.0", "typescript": "^4.7.3", - "xo": "^0.49.0", + "xo": "^0.52.2", "zen-observable": "^0.8.15" }, "peerDependencies": { diff --git a/test-tap/fixture/fail-fast/multiple-files/passes-slow.cjs b/test-tap/fixture/fail-fast/multiple-files/passes-slow.cjs index 97dda564c..a529c2cb3 100644 --- a/test-tap/fixture/fail-fast/multiple-files/passes-slow.cjs +++ b/test-tap/fixture/fail-fast/multiple-files/passes-slow.cjs @@ -6,7 +6,7 @@ test.serial('first pass', async t => { t.pass(); const timer = setTimeout(() => {}, 60_000); // Ensure process stays alive. const source = parentPort || process; - const {pEvent} = await import('p-event'); // eslint-disable-line node/no-unsupported-features/es-syntax + const {pEvent} = await import('p-event'); await pEvent(source, 'message', message => { if (message.ava) { return message.ava.type === 'peer-failed'; diff --git a/test-tap/fixture/process-cwd-default.cjs b/test-tap/fixture/process-cwd-default.cjs index 1a2bf55d7..a59bc0b87 100644 --- a/test-tap/fixture/process-cwd-default.cjs +++ b/test-tap/fixture/process-cwd-default.cjs @@ -3,7 +3,7 @@ const path = require('path'); const test = require('../../entrypoints/main.cjs'); test('test', async t => { - const {packageConfigSync, packageJsonPath} = await import('pkg-conf'); // eslint-disable-line node/no-unsupported-features/es-syntax + const {packageConfigSync, packageJsonPath} = await import('pkg-conf'); const conf = packageConfigSync('ava'); const pkgDir = path.dirname(packageJsonPath(conf)); t.is(process.cwd(), pkgDir); diff --git a/test-tap/fixture/with-dependencies/require-custom.cjs b/test-tap/fixture/with-dependencies/require-custom.cjs index ccc22e9dc..6a46d7edb 100644 --- a/test-tap/fixture/with-dependencies/require-custom.cjs +++ b/test-tap/fixture/with-dependencies/require-custom.cjs @@ -1,2 +1,2 @@ -/* eslint-disable node/no-deprecated-api */ +/* eslint-disable n/no-deprecated-api */ require.extensions['.custom'] = require.extensions['.js']; diff --git a/test-tap/helper/report-worker.js b/test-tap/helper/report-worker.js index 8d1faa4fc..4c14ecd75 100644 --- a/test-tap/helper/report-worker.js +++ b/test-tap/helper/report-worker.js @@ -1,4 +1,4 @@ import {onlyColors} from './fix-reporter-env.js'; onlyColors(); -import('../../lib/worker/base.js'); // eslint-disable-line node/no-unsupported-features/es-syntax +import('../../lib/worker/base.js'); diff --git a/test-tap/reporters/default.js b/test-tap/reporters/default.js index b2a313d3c..3ab81d01d 100644 --- a/test-tap/reporters/default.js +++ b/test-tap/reporters/default.js @@ -9,7 +9,7 @@ import TTYStream from '../helper/tty-stream.js'; const {restoreClock} = fixReporterEnv(); test(async t => { - const {default: Reporter} = await import('../../lib/reporters/default.js'); // eslint-disable-line node/no-unsupported-features/es-syntax + const {default: Reporter} = await import('../../lib/reporters/default.js'); const run = (type, sanitizers = []) => t => { t.plan(1); diff --git a/test-tap/reporters/tap.js b/test-tap/reporters/tap.js index 738e4cb6c..47050fad8 100644 --- a/test-tap/reporters/tap.js +++ b/test-tap/reporters/tap.js @@ -9,7 +9,7 @@ import TTYStream from '../helper/tty-stream.js'; fixReporterEnv(); test(async t => { - const {default: TapReporter} = await import('../../lib/reporters/tap.js'); // eslint-disable-line node/no-unsupported-features/es-syntax + const {default: TapReporter} = await import('../../lib/reporters/tap.js'); const run = (type, sanitizers = []) => t => { t.plan(1); diff --git a/test-types/module/context.ts b/test-types/module/context.ts index f2901be88..b8d516a1f 100644 --- a/test-types/module/context.ts +++ b/test-types/module/context.ts @@ -1,10 +1,11 @@ /* eslint-disable @typescript-eslint/no-empty-function */ -import anyTest, {ExecutionContext, TestFn} from 'ava'; +import type {ExecutionContext, TestFn} from 'ava'; +import anyTest from 'ava'; import {expectError, expectType} from 'tsd'; -interface Context { +type Context = { foo: string; -} +}; const test = anyTest as TestFn; @@ -24,9 +25,9 @@ anyTest('default context is unknown', t => { }); // See https://github.com/avajs/ava/issues/2253 -interface Covariant extends Context { +type Covariant = { bar: number; -} +} & Context; const test2 = anyTest as TestFn; const hook = (_t: ExecutionContext) => {}; diff --git a/test-types/module/macros.ts b/test-types/module/macros.ts index f775ed7aa..220438756 100644 --- a/test-types/module/macros.ts +++ b/test-types/module/macros.ts @@ -1,5 +1,6 @@ /* eslint-disable no-lone-blocks */ -import test, {ExecutionContext} from 'ava'; +import type {ExecutionContext} from 'ava'; +import test from 'ava'; import {expectType} from 'tsd'; // Typed arguments through generics. @@ -105,20 +106,20 @@ import {expectType} from 'tsd'; } // Inline function with explicit argument types. -test('has length 3', (t: ExecutionContext, input: string, expected: number) => { +test('has length 3 (explicit)', (t: ExecutionContext, input: string, expected: number) => { // @ts-expect-error TS2345 t.is(input, expected); }, 'bar', 3); // Completely inferred arguments for inline functions. -test('has length 3', (t, input, expected) => { +test('has length 3 (inferred)', (t, input, expected) => { expectType(input); expectType(expected); // @ts-expect-error TS2345 t.is(input, expected); }, 'foo', 3); -test.skip('skip', (t, input, expected) => { +test.skip('skip', (t, input, expected) => { // eslint-disable-line ava/no-skip-test expectType(input); expectType(expected); // @ts-expect-error TS2345 diff --git a/test-types/module/try-commit.ts b/test-types/module/try-commit.ts index c207a050b..e726ce2c7 100644 --- a/test-types/module/try-commit.ts +++ b/test-types/module/try-commit.ts @@ -1,4 +1,5 @@ -import test, {ExecutionContext} from 'ava'; +import type {ExecutionContext} from 'ava'; +import test from 'ava'; import {expectType} from 'tsd'; test('attempt', async t => { @@ -37,7 +38,7 @@ test('attempt with helper', async t => { attempt.commit(); }); -test('attempt with title', async t => { +test('attempt with title and helper', async t => { const attempt = await t.try('title', lengthCheck, 'string', 6); attempt.commit(); }); @@ -54,11 +55,13 @@ test('all possible variants to pass to t.try', async t => { void t.try('test', (tt, a, b) => tt.is(a.length, b), 'hello', 5); // Macro with title - const macro1 = test.macro<[string, number]>({ + const macro1 = test.macro<[string, number]>({ // eslint-disable-line ava/no-nested-tests exec: (tt, a, b) => tt.is(a.length, b), title: (title, a, b) => `${title ? `${String(title)} ` : ''}str: "${String(a)}" with len: "${String(b)}"`, }); - const macro2 = test.macro<[string, number]>((tt, a, b) => tt.is(a.slice(b), '')); + const macro2 = test.macro<[string, number]>((tt, a, b) => { // eslint-disable-line ava/no-nested-tests + tt.is(a.slice(b), ''); + }); void t.try(macro1, 'hello', 5); void t.try(macro2, 'hello', 5); diff --git a/test/cjs-default/fixtures/test.cjs b/test/cjs-default/fixtures/test.cjs index 1482fcef6..597f7d610 100644 --- a/test/cjs-default/fixtures/test.cjs +++ b/test/cjs-default/fixtures/test.cjs @@ -15,6 +15,6 @@ test('not enumerable', t => { }); test('main export equals the ESM export', async t => { - const {default: exported} = await import('ava'); // eslint-disable-line node/no-unsupported-features/es-syntax + const {default: exported} = await import('ava'); t.is(test, exported); }); diff --git a/types/assertions.d.ts b/types/assertions.d.ts index 68fd8d85b..08c3e05f1 100644 --- a/types/assertions.d.ts +++ b/types/assertions.d.ts @@ -18,7 +18,7 @@ export type ThrowsExpectation = { name?: string; }; -export interface Assertions { +export type Assertions = { /** * Assert that `actual` is [truthy](https://developer.mozilla.org/en-US/docs/Glossary/Truthy), returning a boolean * indicating whether the assertion passed. @@ -118,9 +118,9 @@ export interface Assertions { * indicating whether the assertion passed. */ truthy: TruthyAssertion; -} +}; -export interface AssertAssertion { +export type AssertAssertion = { /** * Assert that `actual` is [truthy](https://developer.mozilla.org/en-US/docs/Glossary/Truthy), returning a boolean * indicating whether the assertion passed. @@ -129,9 +129,9 @@ export interface AssertAssertion { /** Skip this assertion. */ skip(actual: any, message?: string): void; -} +}; -export interface DeepEqualAssertion { +export type DeepEqualAssertion = { /** * Assert that `actual` is [deeply equal](https://github.com/concordancejs/concordance#comparison-details) to * `expected`, returning a boolean indicating whether the assertion passed. @@ -152,9 +152,9 @@ export interface DeepEqualAssertion { /** Skip this assertion. */ skip(actual: any, expected: any, message?: string): void; -} +}; -export interface LikeAssertion { +export type LikeAssertion = { /** * Assert that `value` is like `selector`, returning a boolean indicating whether the assertion passed. */ @@ -162,17 +162,17 @@ export interface LikeAssertion { /** Skip this assertion. */ skip(value: any, selector: any, message?: string): void; -} +}; -export interface FailAssertion { +export type FailAssertion = { /** Fail the test, always returning `false`. */ (message?: string): boolean; /** Skip this assertion. */ skip(message?: string): void; -} +}; -export interface FalseAssertion { +export type FalseAssertion = { /** * Assert that `actual` is strictly false, returning a boolean indicating whether the assertion passed. */ @@ -180,9 +180,9 @@ export interface FalseAssertion { /** Skip this assertion. */ skip(actual: any, message?: string): void; -} +}; -export interface FalsyAssertion { +export type FalsyAssertion = { /** * Assert that `actual` is [falsy](https://developer.mozilla.org/en-US/docs/Glossary/Falsy), returning a boolean * indicating whether the assertion passed. @@ -191,9 +191,9 @@ export interface FalsyAssertion { /** Skip this assertion. */ skip(actual: any, message?: string): void; -} +}; -export interface IsAssertion { +export type IsAssertion = { /** * Assert that `actual` is [the same * value](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is) as `expected`, @@ -203,9 +203,9 @@ export interface IsAssertion { /** Skip this assertion. */ skip(actual: any, expected: any, message?: string): void; -} +}; -export interface NotAssertion { +export type NotAssertion = { /** * Assert that `actual` is not [the same * value](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/is) as `expected`, @@ -215,9 +215,9 @@ export interface NotAssertion { /** Skip this assertion. */ skip(actual: any, expected: any, message?: string): void; -} +}; -export interface NotDeepEqualAssertion { +export type NotDeepEqualAssertion = { /** * Assert that `actual` is not [deeply equal](https://github.com/concordancejs/concordance#comparison-details) to * `expected`, returning a boolean indicating whether the assertion passed. @@ -226,9 +226,9 @@ export interface NotDeepEqualAssertion { /** Skip this assertion. */ skip(actual: any, expected: any, message?: string): void; -} +}; -export interface NotRegexAssertion { +export type NotRegexAssertion = { /** * Assert that `string` does not match the regular expression, returning a boolean indicating whether the assertion * passed. @@ -237,17 +237,17 @@ export interface NotRegexAssertion { /** Skip this assertion. */ skip(string: string, regex: RegExp, message?: string): void; -} +}; -export interface NotThrowsAssertion { +export type NotThrowsAssertion = { /** Assert that the function does not throw. */ (fn: () => any, message?: string): void; /** Skip this assertion. */ skip(fn: () => any, message?: string): void; -} +}; -export interface NotThrowsAsyncAssertion { +export type NotThrowsAsyncAssertion = { /** Assert that the async function does not throw. You must await the result. */ (fn: () => PromiseLike, message?: string): Promise; @@ -256,17 +256,17 @@ export interface NotThrowsAsyncAssertion { /** Skip this assertion. */ skip(nonThrower: any, message?: string): void; -} +}; -export interface PassAssertion { +export type PassAssertion = { /** Count a passing assertion, always returning `true`. */ (message?: string): boolean; /** Skip this assertion. */ skip(message?: string): void; -} +}; -export interface RegexAssertion { +export type RegexAssertion = { /** * Assert that `string` matches the regular expression, returning a boolean indicating whether the assertion passed. */ @@ -274,9 +274,9 @@ export interface RegexAssertion { /** Skip this assertion. */ skip(string: string, regex: RegExp, message?: string): void; -} +}; -export interface SnapshotAssertion { +export type SnapshotAssertion = { /** * Assert that `expected` is [deeply equal](https://github.com/concordancejs/concordance#comparison-details) to a * previously recorded [snapshot](https://github.com/concordancejs/concordance#serialization-details), or if @@ -286,9 +286,9 @@ export interface SnapshotAssertion { /** Skip this assertion. */ skip(expected: any, message?: string): void; -} +}; -export interface ThrowsAssertion { +export type ThrowsAssertion = { /** * Assert that the function throws [an error](https://www.npmjs.com/package/is-error). If so, returns the error value. * The error must satisfy all expectations. Returns undefined when the assertion fails. @@ -297,9 +297,9 @@ export interface ThrowsAssertion { /** Skip this assertion. */ skip(fn: () => any, expectations?: any, message?: string): void; -} +}; -export interface ThrowsAsyncAssertion { +export type ThrowsAsyncAssertion = { /** * Assert that the async function throws [an error](https://www.npmjs.com/package/is-error). If so, returns the error * value. Returns undefined when the assertion fails. You must await the result. The error must satisfy all expectations. @@ -315,9 +315,9 @@ export interface ThrowsAsyncAssertion { /** Skip this assertion. */ skip(thrower: any, expectations?: any, message?: string): void; -} +}; -export interface TrueAssertion { +export type TrueAssertion = { /** * Assert that `actual` is strictly true, returning a boolean indicating whether the assertion passed. */ @@ -325,9 +325,9 @@ export interface TrueAssertion { /** Skip this assertion. */ skip(actual: any, message?: string): void; -} +}; -export interface TruthyAssertion { +export type TruthyAssertion = { /** * Assert that `actual` is [truthy](https://developer.mozilla.org/en-US/docs/Glossary/Truthy), returning a boolean * indicating whether the assertion passed. @@ -336,4 +336,4 @@ export interface TruthyAssertion { /** Skip this assertion. */ skip(actual: any, message?: string): void; -} +}; diff --git a/types/subscribable.d.ts b/types/subscribable.d.ts index 3a3399bca..42bb0f17c 100644 --- a/types/subscribable.d.ts +++ b/types/subscribable.d.ts @@ -1,6 +1,6 @@ -export interface Subscribable { +export type Subscribable = { subscribe(observer: { error(error: any): void; complete(): void; }): void; -} +}; diff --git a/types/test-fn.d.ts b/types/test-fn.d.ts index 730651ddb..f58a5d2cf 100644 --- a/types/test-fn.d.ts +++ b/types/test-fn.d.ts @@ -3,7 +3,7 @@ import type {Subscribable} from './subscribable.js'; import type {TryFn} from './try-fn.js'; /** The `t` value passed to test & hook implementations. */ -export interface ExecutionContext extends Assertions { +export type ExecutionContext = { /** Test context, shared with hooks. */ context: Context; @@ -18,17 +18,17 @@ export interface ExecutionContext extends Assertions { readonly teardown: TeardownFn; readonly timeout: TimeoutFn; readonly try: TryFn; -} +} & Assertions; -export interface LogFn { +export type LogFn = { /** Log one or more values. */ (...values: any[]): void; /** Skip logging. */ skip(...values: any[]): void; -} +}; -export interface PlanFn { +export type PlanFn = { /** * Plan how many assertion there are in the test. The test will fail if the actual assertion count doesn't match the * number of planned assertions. See [assertion planning](https://github.com/avajs/ava#assertion-planning). @@ -37,7 +37,7 @@ export interface PlanFn { /** Don't plan assertions. */ skip(count: number): void; -} +}; /** * Set a timeout for the test, in milliseconds. The test will fail if the timeout is exceeded. @@ -67,7 +67,7 @@ export type Macro = { /** A test or hook implementation. */ export type Implementation = ImplementationFn | Macro; -export interface TestFn { +export type TestFn = { /** Declare a concurrent test. Additional arguments are passed to the implementation or macro. */ (title: string, implementation: Implementation, ...args: Args): void; @@ -88,9 +88,9 @@ export interface TestFn { serial: SerialFn; skip: SkipFn; todo: TodoFn; -} +}; -export interface AfterFn { +export type AfterFn = { /** * Declare a hook that is run once, after all tests have passed. * Additional arguments are passed to the implementation or macro. @@ -105,9 +105,9 @@ export interface AfterFn { always: AlwaysInterface; skip: HookSkipFn; -} +}; -export interface AlwaysInterface { +export type AlwaysInterface = { /** * Declare a hook that is run once, after all tests are done. * Additional arguments are passed to the implementation or macro. @@ -121,9 +121,9 @@ export interface AlwaysInterface { (implementation: Implementation, ...args: Args): void; skip: HookSkipFn; -} +}; -export interface BeforeFn { +export type BeforeFn = { /** * Declare a hook that is run once, before all tests. * Additional arguments are passed to the implementation or macro. @@ -137,9 +137,9 @@ export interface BeforeFn { (implementation: Implementation, ...args: Args): void; skip: HookSkipFn; -} +}; -export interface FailingFn { +export type FailingFn = { /** * Declare a concurrent test that is expected to fail. * Additional arguments are passed to the implementation or macro. @@ -154,17 +154,17 @@ export interface FailingFn { only: OnlyFn; skip: SkipFn; -} +}; -export interface HookSkipFn { +export type HookSkipFn = { /** Skip this hook. */ (title: string, implementation: Implementation, ...args: Args): void; /** Skip this hook. */ (implementation: Implementation, ...args: Args): void; -} +}; -export interface OnlyFn { +export type OnlyFn = { /** * Declare a test. Only this test and others declared with `.only()` are run. * Additional arguments are passed to the implementation or macro. @@ -176,9 +176,9 @@ export interface OnlyFn { * Additional arguments are passed to the macro. The macro is responsible for generating a unique test title. */ (macro: Macro, ...args: Args): void; -} +}; -export interface SerialFn { +export type SerialFn = { /** Declare a serial test. Additional arguments are passed to the implementation or macro. */ (title: string, implementation: Implementation, ...args: Args): void; @@ -195,15 +195,15 @@ export interface SerialFn { only: OnlyFn; skip: SkipFn; todo: TodoFn; -} +}; -export interface SkipFn { +export type SkipFn = { /** Skip this test. */ (title: string, implementation: Implementation, ...args: Args): void; /** Skip this test. */ (macro: Macro, ...args: Args): void; -} +}; /** Declare a test that should be implemented later. */ export type TodoFn = (title: string) => void; @@ -216,16 +216,16 @@ export type MacroDeclarationOptions = title: TitleFn; }; -export interface MacroFn { +export type MacroFn = { /** Declare a reusable test implementation. */ (/** The function that is executed when the macro is used. */ exec: ImplementationFn): Macro; (declaration: MacroDeclarationOptions): Macro; -} +}; -export interface Meta { +export type Meta = { /** Path to the test file being executed. */ file: string; /** Directory where snapshots are stored. */ snapshotDirectory: string; -} +}; diff --git a/types/try-fn.d.ts b/types/try-fn.d.ts index 8009df0c9..f1381d82d 100644 --- a/types/try-fn.d.ts +++ b/types/try-fn.d.ts @@ -7,9 +7,9 @@ export type CommitDiscardOptions = { retainLogs?: boolean; }; -export interface AssertionError extends Error {} +export type AssertionError = Record & Error; -export interface TryResult { +export type TryResult = { /** * Title of the attempt, helping you tell attempts aparts. */ @@ -40,9 +40,9 @@ export interface TryResult { * Discard the attempt. */ discard(options?: CommitDiscardOptions): void; -} +}; -export interface TryFn { +export type TryFn = { /** * Attempt to run some assertions. The result must be explicitly committed or discarded or else * the test will fail. The title may help distinguish attempts from one another. @@ -54,5 +54,5 @@ export interface TryFn { * the test will fail. */ (fn: Implementation, ...args: Args): Promise; -} +};