From bc489b48ad28109f8efb51e02a1182df123101fa Mon Sep 17 00:00:00 2001 From: LitoMore Date: Thu, 21 Apr 2022 17:07:10 +0800 Subject: [PATCH] Bump dev dependencies (#207) Co-authored-by: Sindre Sorhus --- .github/workflows/main.yml | 6 ++++-- index.d.ts | 1 + index.js | 2 ++ package.json | 8 ++++---- test/allow-unkonwn-flags.js | 2 +- test/fixtures/fixture-required-function.js | 10 +++------- test/fixtures/fixture.js | 1 + test/is-required-flag.js | 2 +- test/test.js | 7 ++++--- 9 files changed, 21 insertions(+), 18 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 441975c..d50ada6 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -10,10 +10,12 @@ jobs: fail-fast: false matrix: node-version: + - 18 - 16 + - 14 steps: - - uses: actions/checkout@v2 - - uses: actions/setup-node@v2 + - uses: actions/checkout@v3 + - uses: actions/setup-node@v3 with: node-version: ${{ matrix.node-version }} - run: npm install diff --git a/index.d.ts b/index.d.ts index 00054f6..401530e 100644 --- a/index.d.ts +++ b/index.d.ts @@ -197,6 +197,7 @@ export interface Options { //} ``` */ + // eslint-disable-next-line @typescript-eslint/ban-types readonly booleanDefault?: boolean | null | undefined; /** diff --git a/index.js b/index.js index b255b73..fc7e24f 100644 --- a/index.js +++ b/index.js @@ -1,4 +1,5 @@ import {dirname} from 'node:path'; +import process from 'node:process'; import {fileURLToPath} from 'node:url'; import buildParserOptions from 'minimist-options'; import parseArguments from 'yargs-parser'; @@ -99,6 +100,7 @@ const validateFlags = (flags, options) => { } }; +/* eslint complexity: off */ const meow = (helpText, options = {}) => { if (typeof helpText !== 'string') { options = helpText; diff --git a/package.json b/package.json index 6651c14..d972dc0 100644 --- a/package.json +++ b/package.json @@ -57,11 +57,11 @@ }, "devDependencies": { "ava": "^3.15.0", - "execa": "^5.1.1", + "execa": "^6.1.0", "indent-string": "^5.0.0", - "read-pkg": "^6.0.0", - "tsd": "^0.17.0", - "xo": "^0.41.0" + "read-pkg": "^7.1.0", + "tsd": "^0.20.0", + "xo": "^0.48.0" }, "xo": { "rules": { diff --git a/test/allow-unkonwn-flags.js b/test/allow-unkonwn-flags.js index 609a161..5008a82 100644 --- a/test/allow-unkonwn-flags.js +++ b/test/allow-unkonwn-flags.js @@ -1,7 +1,7 @@ import path from 'node:path'; import {fileURLToPath} from 'node:url'; import test from 'ava'; -import execa from 'execa'; +import {execa} from 'execa'; const __dirname = path.dirname(fileURLToPath(import.meta.url)); const fixtureAllowUnknownFlags = path.join(__dirname, 'fixtures', 'fixture-allow-unknown-flags.js'); diff --git a/test/fixtures/fixture-required-function.js b/test/fixtures/fixture-required-function.js index 2f2cc7d..833f8b6 100755 --- a/test/fixtures/fixture-required-function.js +++ b/test/fixtures/fixture-required-function.js @@ -23,13 +23,9 @@ const cli = meow({ }, shouldError: { type: 'boolean', - isRequired: (flags, _) => { - if (flags.allowError) { - return 'should error'; - } - - return false; - }, + isRequired: (flags, _) => + flags.allowError ? 'should error' : false + , }, }, }); diff --git a/test/fixtures/fixture.js b/test/fixtures/fixture.js index 44200bb..f7adc0e 100755 --- a/test/fixtures/fixture.js +++ b/test/fixtures/fixture.js @@ -1,4 +1,5 @@ #!/usr/bin/env node +import process from 'node:process'; import meow from '../../index.js'; const cli = meow({ diff --git a/test/is-required-flag.js b/test/is-required-flag.js index 75279fd..25f3c61 100644 --- a/test/is-required-flag.js +++ b/test/is-required-flag.js @@ -1,7 +1,7 @@ import path from 'node:path'; import {fileURLToPath} from 'node:url'; import test from 'ava'; -import execa from 'execa'; +import {execa} from 'execa'; const __dirname = path.dirname(fileURLToPath(import.meta.url)); const fixtureRequiredPath = path.join(__dirname, 'fixtures', 'fixture-required.js'); diff --git a/test/test.js b/test/test.js index 54308d9..b9e7fa7 100644 --- a/test/test.js +++ b/test/test.js @@ -1,9 +1,10 @@ import path from 'node:path'; +import process from 'node:process'; import {fileURLToPath} from 'node:url'; import test from 'ava'; import indentString from 'indent-string'; -import execa from 'execa'; -import {readPackageAsync} from 'read-pkg'; +import {execa} from 'execa'; +import {readPackage} from 'read-pkg'; import meow from '../index.js'; const __dirname = path.dirname(fileURLToPath(import.meta.url)); @@ -55,7 +56,7 @@ test('support help shortcut', t => { }); test('spawn cli and show version', async t => { - const pkg = await readPackageAsync(); + const pkg = await readPackage(); const {stdout} = await execa(fixturePath, ['--version']); t.is(stdout, pkg.version); });