Skip to content

Commit

Permalink
Update dependencies
Browse files Browse the repository at this point in the history
Exclude Acorn stack traces from reporter logs.

Export types not interfaces.
  • Loading branch information
novemberborn authored Aug 26, 2022
1 parent 14061be commit 02f626f
Show file tree
Hide file tree
Showing 50 changed files with 958 additions and 906 deletions.
10 changes: 8 additions & 2 deletions .xo-config.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -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',
},
},
{
Expand All @@ -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',
},
},
Expand Down
2 changes: 1 addition & 1 deletion entrypoints/plugin.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import {URL} from 'node:url';
import type {URL} from 'node:url';

export namespace SharedWorker {
export type ProtocolIdentifier = 'ava-4';
Expand Down
12 changes: 6 additions & 6 deletions lib/cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@ import process from 'node:process';

import arrify from 'arrify';
import ciParallelVars from 'ci-parallel-vars';
import del from 'del';
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';
Expand Down Expand Up @@ -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 {}
Expand Down Expand Up @@ -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) {
Expand All @@ -262,7 +262,7 @@ export default async function loadCli() { // eslint-disable-line complexity
const cacheDir = path.join(projectDir, 'node_modules', '.cache', 'ava');

try {
const deletedFilePaths = await del('*', {cwd: cacheDir});
const deletedFilePaths = await deleteAsync('*', {cwd: cacheDir});

if (deletedFilePaths.length === 0) {
console.log(`\n${chalk.green(figures.tick)} No cache files to remove`);
Expand Down
2 changes: 1 addition & 1 deletion lib/load-config.js
Original file line number Diff line number Diff line change
Expand Up @@ -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`);
}
Expand Down
2 changes: 1 addition & 1 deletion lib/plugin-support/shared-worker-loader.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down
2 changes: 1 addition & 1 deletion lib/provider-manager.js
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions lib/worker/base.js
Original file line number Diff line number Diff line change
Expand Up @@ -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));
}
}

Expand All @@ -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);
}
Expand Down
2 changes: 1 addition & 1 deletion lib/worker/channel.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down
Loading

0 comments on commit 02f626f

Please sign in to comment.