diff --git a/lib/options.js b/lib/options.js index 9ee1b69..fe3ba9d 100644 --- a/lib/options.js +++ b/lib/options.js @@ -96,7 +96,7 @@ export function options(flags, configuration) { processor: configuration.processor, help: config.help, version: config.version, - files: config._, + files: config[''], filePath: config.filePath, watch: config.watch, extensions: ext.length === 0 ? configuration.extensions : ext, diff --git a/package.json b/package.json index f6fd7e4..9f42d36 100644 --- a/package.json +++ b/package.json @@ -32,8 +32,8 @@ ], "dependencies": { "@types/text-table": "^0.2.0", - "camelcase": "^6.0.0", - "chalk": "^4.0.0", + "camelcase": "^7.0.0", + "chalk": "^5.0.0", "chokidar": "^3.0.0", "fault": "^2.0.0", "json5": "^2.0.0", @@ -46,11 +46,11 @@ "@types/touch": "^3.0.0", "bail": "^2.0.0", "c8": "^7.0.0", - "execa": "^5.0.0", + "execa": "^6.0.0", "prettier": "^2.0.0", "remark": "^14.0.0", "remark-cli": "^10.0.0", - "remark-preset-wooorm": "^8.0.0", + "remark-preset-wooorm": "^9.0.0", "rimraf": "^3.0.0", "strip-ansi": "^7.0.0", "tape": "^5.0.0", @@ -59,7 +59,7 @@ "typescript": "^4.0.0", "unified": "^10.0.0", "vfile-reporter-json": "^3.0.0", - "xo": "^0.44.0" + "xo": "^0.50.0" }, "scripts": { "build": "rimraf \"lib/**/*.d.ts\" \"test/**/*.d.ts\" && tsc && type-coverage", diff --git a/test/index.js b/test/index.js index 8d640d9..d430be9 100644 --- a/test/index.js +++ b/test/index.js @@ -1,7 +1,11 @@ +/** + * @typedef {import('execa').ExecaReturnValue} ExecaReturnValue + */ + import fs from 'node:fs' import path from 'node:path' import process from 'node:process' -import execa from 'execa' +import {execa} from 'execa' import {bail} from 'bail' import test from 'tape' import strip from 'strip-ansi' @@ -28,7 +32,7 @@ test('unified-args', (t) => { execa(bin, ['missing.txt']).then( () => t.fail(), - (/** @type {execa.ExecaReturnValue} */ error) => { + (/** @type {ExecaReturnValue} */ error) => { t.deepEqual( [error.exitCode, strip(error.stderr)], [1, expected], @@ -125,7 +129,7 @@ test('unified-args', (t) => { execa(bin, ['-n']).then( () => t.fail(), - (/** @type {execa.ExecaReturnValue} */ error) => { + (/** @type {ExecaReturnValue} */ error) => { t.deepEqual( [error.exitCode, strip(error.stderr)], [1, expected], @@ -145,7 +149,7 @@ test('unified-args', (t) => { execa(bin, ['-on']).then( () => t.fail(), - (/** @type {execa.ExecaReturnValue} */ error) => { + (/** @type {ExecaReturnValue} */ error) => { t.deepEqual( [error.exitCode, strip(error.stderr)], [1, expected], @@ -165,7 +169,7 @@ test('unified-args', (t) => { execa(bin, ['--no']).then( () => t.fail(), - (/** @type {execa.ExecaReturnValue} */ error) => { + (/** @type {ExecaReturnValue} */ error) => { t.deepEqual( [error.exitCode, strip(error.stderr)], [1, expected], @@ -290,7 +294,7 @@ test('unified-args', (t) => { execa(bin, ['.', flag]).then( () => t.fail(), - (/** @type {execa.ExecaReturnValue} */ error) => { + (/** @type {ExecaReturnValue} */ error) => { t.deepEqual( [error.stdout, error.stderr], ['', expected], @@ -337,7 +341,7 @@ test('unified-args', (t) => { // Should be quoted. execa(bin, ['.', flag, 'foo:bar']).then( () => t.fail(), - (/** @type {execa.ExecaReturnValue} */ error) => { + (/** @type {ExecaReturnValue} */ error) => { t.deepEqual( [error.exitCode, strip(error.stderr)], [1, expected], @@ -416,7 +420,7 @@ test('unified-args', (t) => { // Should be quoted. execa(bin, ['.', flag, './plugin.js=foo:bar']).then( () => t.fail(), - (/** @type {execa.ExecaReturnValue} */ error) => { + (/** @type {ExecaReturnValue} */ error) => { t.deepEqual( [error.exitCode, strip(error.stderr)], [1, expected], @@ -495,7 +499,7 @@ test('unified-args', (t) => { execa(bin, ['.', '--report']).then( () => t.fail(), - (/** @type {execa.ExecaReturnValue} */ error) => { + (/** @type {ExecaReturnValue} */ error) => { t.deepEqual( [error.exitCode, error.stderr], [1, 'Error: Missing value: --report specify reporter'], @@ -604,7 +608,7 @@ test('unified-args', (t) => { execa(bin, ['one.txt', 'two.txt', '--ignore-pattern', 'one.txt']).then( () => t.fail(), - (/** @type {execa.ExecaReturnValue} */ error) => { + (/** @type {ExecaReturnValue} */ error) => { t.deepEqual( [error.exitCode, strip(error.stderr)], [1, expected], @@ -659,7 +663,7 @@ test('unified-args', (t) => { setTimeout(seeYouLaterAlligator, delay) - function onsuccess(/** @type {execa.ExecaReturnValue} */ result) { + function onsuccess(/** @type {ExecaReturnValue} */ result) { resolved = true fs.unlinkSync(doc) t.deepEqual( @@ -714,7 +718,7 @@ test('unified-args', (t) => { setTimeout(seeYouLaterAlligator, delay) - function onsuccess(/** @type {execa.ExecaReturnValue} */ result) { + function onsuccess(/** @type {ExecaReturnValue} */ result) { resolved = true fs.unlinkSync(doc) @@ -748,7 +752,7 @@ test('unified-args', (t) => { execa(bin, ['-w']).then( () => t.fail(), - (/** @type {execa.ExecaReturnValue} */ error) => { + (/** @type {ExecaReturnValue} */ error) => { const actual = strip(error.stderr).split('\n').slice(0, 2).join('\n') t.deepEqual([error.exitCode, actual], [1, expected], 'should fail') @@ -764,7 +768,7 @@ test('unified-args', (t) => { execa(bin, ['.', '-u', './plugin.js']).then( () => t.fail(), - (/** @type {execa.ExecaReturnValue} */ error) => { + (/** @type {ExecaReturnValue} */ error) => { t.deepEqual( [error.exitCode, strip(error.stderr)], [1, expected],