From 54cb672b0e603d5ad707806d791ef72296880d3f Mon Sep 17 00:00:00 2001 From: AndreaPontrandolfo Date: Tue, 2 Jan 2024 20:51:34 +0100 Subject: [PATCH 1/7] added find-up Monorepo support Fixes #7 --- .vscode/settings.json | 4 +-- package.json | 3 +- pnpm-lock.yaml | 44 ++++++-------------------- src/index.ts | 30 +++++++++++++++--- workspace/index.temp.ts | 69 +++++++++++++++++++++++++++++++++++++++++ workspace/package.json | 11 +++++++ 6 files changed, 118 insertions(+), 43 deletions(-) create mode 100644 workspace/index.temp.ts create mode 100644 workspace/package.json diff --git a/.vscode/settings.json b/.vscode/settings.json index 795f401..aecd922 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -8,8 +8,8 @@ // Auto fix "editor.codeActionsOnSave": { - "source.fixAll.eslint": true, - "source.organizeImports": false + "source.fixAll.eslint": "explicit", + "source.organizeImports": "never" }, // Silent the stylistic rules in you IDE, but still auto fix them diff --git a/package.json b/package.json index f69c98f..a44309f 100644 --- a/package.json +++ b/package.json @@ -45,12 +45,13 @@ "lint": "eslint .", "prepublishOnly": "nr build", "release": "bumpp && npm publish", - "start": "esno src/index.ts", + "start": "esno src/workspace/index.temp.ts", "test": "vitest", "typecheck": "tsc --noEmit", "prepare": "simple-git-hooks" }, "dependencies": { + "find-up": "^7.0.0", "parse-gitignore": "^2.0.0" }, "devDependencies": { diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 2ca4b71..57ae59e 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -8,6 +8,9 @@ importers: .: dependencies: + find-up: + specifier: ^7.0.0 + version: 7.0.0 parse-gitignore: specifier: ^2.0.0 version: 2.0.0 @@ -58,6 +61,12 @@ importers: specifier: ^0.34.6 version: 0.34.6 + workspace: + dependencies: + esno: + specifier: ^4.0.0 + version: 4.0.0 + packages: /@aashutoshrathi/word-wrap@1.2.6: @@ -383,7 +392,6 @@ packages: cpu: [arm64] os: [android] requiresBuild: true - dev: true optional: true /@esbuild/android-arm64@0.19.2: @@ -419,7 +427,6 @@ packages: cpu: [arm] os: [android] requiresBuild: true - dev: true optional: true /@esbuild/android-arm@0.19.2: @@ -455,7 +462,6 @@ packages: cpu: [x64] os: [android] requiresBuild: true - dev: true optional: true /@esbuild/android-x64@0.19.2: @@ -491,7 +497,6 @@ packages: cpu: [arm64] os: [darwin] requiresBuild: true - dev: true optional: true /@esbuild/darwin-arm64@0.19.2: @@ -527,7 +532,6 @@ packages: cpu: [x64] os: [darwin] requiresBuild: true - dev: true optional: true /@esbuild/darwin-x64@0.19.2: @@ -563,7 +567,6 @@ packages: cpu: [arm64] os: [freebsd] requiresBuild: true - dev: true optional: true /@esbuild/freebsd-arm64@0.19.2: @@ -599,7 +602,6 @@ packages: cpu: [x64] os: [freebsd] requiresBuild: true - dev: true optional: true /@esbuild/freebsd-x64@0.19.2: @@ -635,7 +637,6 @@ packages: cpu: [arm64] os: [linux] requiresBuild: true - dev: true optional: true /@esbuild/linux-arm64@0.19.2: @@ -671,7 +672,6 @@ packages: cpu: [arm] os: [linux] requiresBuild: true - dev: true optional: true /@esbuild/linux-arm@0.19.2: @@ -707,7 +707,6 @@ packages: cpu: [ia32] os: [linux] requiresBuild: true - dev: true optional: true /@esbuild/linux-ia32@0.19.2: @@ -743,7 +742,6 @@ packages: cpu: [loong64] os: [linux] requiresBuild: true - dev: true optional: true /@esbuild/linux-loong64@0.19.2: @@ -779,7 +777,6 @@ packages: cpu: [mips64el] os: [linux] requiresBuild: true - dev: true optional: true /@esbuild/linux-mips64el@0.19.2: @@ -815,7 +812,6 @@ packages: cpu: [ppc64] os: [linux] requiresBuild: true - dev: true optional: true /@esbuild/linux-ppc64@0.19.2: @@ -851,7 +847,6 @@ packages: cpu: [riscv64] os: [linux] requiresBuild: true - dev: true optional: true /@esbuild/linux-riscv64@0.19.2: @@ -887,7 +882,6 @@ packages: cpu: [s390x] os: [linux] requiresBuild: true - dev: true optional: true /@esbuild/linux-s390x@0.19.2: @@ -923,7 +917,6 @@ packages: cpu: [x64] os: [linux] requiresBuild: true - dev: true optional: true /@esbuild/linux-x64@0.19.2: @@ -959,7 +952,6 @@ packages: cpu: [x64] os: [netbsd] requiresBuild: true - dev: true optional: true /@esbuild/netbsd-x64@0.19.2: @@ -995,7 +987,6 @@ packages: cpu: [x64] os: [openbsd] requiresBuild: true - dev: true optional: true /@esbuild/openbsd-x64@0.19.2: @@ -1031,7 +1022,6 @@ packages: cpu: [x64] os: [sunos] requiresBuild: true - dev: true optional: true /@esbuild/sunos-x64@0.19.2: @@ -1067,7 +1057,6 @@ packages: cpu: [arm64] os: [win32] requiresBuild: true - dev: true optional: true /@esbuild/win32-arm64@0.19.2: @@ -1103,7 +1092,6 @@ packages: cpu: [ia32] os: [win32] requiresBuild: true - dev: true optional: true /@esbuild/win32-ia32@0.19.2: @@ -1139,7 +1127,6 @@ packages: cpu: [x64] os: [win32] requiresBuild: true - dev: true optional: true /@esbuild/win32-x64@0.19.2: @@ -2355,7 +2342,6 @@ packages: '@esbuild/win32-arm64': 0.18.20 '@esbuild/win32-ia32': 0.18.20 '@esbuild/win32-x64': 0.18.20 - dev: true /esbuild@0.19.2: resolution: {integrity: sha512-G6hPax8UbFakEj3hWO0Vs52LQ8k3lnBhxZWomUJDxfz3rZTLqF5k/FCzuNdLx2RbpBiQQF9H9onlDDH1lZsnjg==} @@ -2800,7 +2786,6 @@ packages: hasBin: true dependencies: tsx: 4.6.1 - dev: true /espree@9.6.1: resolution: {integrity: sha512-oruZaFkjorTpF32kDSI5/75ViwGeZginGGy2NoOSg3Q9bnwlnmDm4HLnkl0RE3n+njDXR037aY1+x58Z/zFdwQ==} @@ -2924,7 +2909,6 @@ packages: locate-path: 7.2.0 path-exists: 5.0.0 unicorn-magic: 0.1.0 - dev: true /flat-cache@3.0.4: resolution: {integrity: sha512-dm9s5Pw7Jc0GvMYbshN6zchCA9RgQlzzEZX3vylR9IqFfS8XciblUXOKfW6SiuJ0e13eDYZoZV5wdrev7P3Nwg==} @@ -2976,7 +2960,6 @@ packages: engines: {node: ^8.16.0 || ^10.6.0 || >=11.0.0} os: [darwin] requiresBuild: true - dev: true optional: true /function-bind@1.1.1: @@ -3016,7 +2999,6 @@ packages: resolution: {integrity: sha512-wuMsz4leaj5hbGgg4IvDU0bqJagpftG5l5cXIAvo8uZrqn0NJqwtfupTN00VnkQJPcIRrxYrm1Ue24btpCha2A==} dependencies: resolve-pkg-maps: 1.0.0 - dev: true /giget@1.1.2: resolution: {integrity: sha512-HsLoS07HiQ5oqvObOI+Qb2tyZH4Gj5nYGfF9qQcZNrPw+uEFhdXtgJr01aO2pWadGHucajYDLxxbtQkm97ON2A==} @@ -3479,7 +3461,6 @@ packages: engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} dependencies: p-locate: 6.0.0 - dev: true /lodash.merge@4.6.2: resolution: {integrity: sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==} @@ -3812,7 +3793,6 @@ packages: engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} dependencies: yocto-queue: 1.0.0 - dev: true /p-locate@4.1.0: resolution: {integrity: sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==} @@ -3833,7 +3813,6 @@ packages: engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} dependencies: p-limit: 4.0.0 - dev: true /p-try@2.2.0: resolution: {integrity: sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==} @@ -3880,7 +3859,6 @@ packages: /path-exists@5.0.0: resolution: {integrity: sha512-RjhtfwJOxzcFmNOi6ltcbcu4Iu+FL3zEj83dk4kAS+fVpTxXLO1b38RvJgT/0QwvV/L3aY9TAnyv0EOqW4GoMQ==} engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} - dev: true /path-is-absolute@1.0.1: resolution: {integrity: sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==} @@ -4075,7 +4053,6 @@ packages: /resolve-pkg-maps@1.0.0: resolution: {integrity: sha512-seS2Tj26TBVOC2NIc2rOe2y2ZO7efxITtLZcGSOnHHNOQ7CkiUBfw0Iw2ck6xkIhPwLhKNLS8BO+hEpngQlqzw==} - dev: true /resolve@1.22.3: resolution: {integrity: sha512-P8ur/gp/AmbEzjr729bZnLjXK5Z+4P0zhIJgBgzqRih7hL7BOukHGtSTA3ACMY467GRFz3duQsi0bDZdR7DKdw==} @@ -4434,7 +4411,6 @@ packages: get-tsconfig: 4.7.2 optionalDependencies: fsevents: 2.3.3 - dev: true /type-check@0.4.0: resolution: {integrity: sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==} @@ -4528,7 +4504,6 @@ packages: /unicorn-magic@0.1.0: resolution: {integrity: sha512-lRfVq8fE8gz6QMBuDM6a+LO3IAzTi05H6gCVaUpir2E1Rwpo4ZUog45KpNXKC/Mn3Yb9UDuHumeFTo9iV/D9FQ==} engines: {node: '>=18'} - dev: true /unist-util-stringify-position@2.0.3: resolution: {integrity: sha512-3faScn5I+hy9VleOq/qNbAd6pAx7iH5jYBMS9I1HgQVijz/4mv5Bvw5iw1sC/90CODiKo81G/ps8AJrISn687g==} @@ -4827,4 +4802,3 @@ packages: /yocto-queue@1.0.0: resolution: {integrity: sha512-9bnSc/HEW2uRy67wc+T8UwauLuPJVn28jb+GtJY16iiKWyvmYJRXVT4UamsAEGQfPohgr2q4Tq0sQbQlxTfi1g==} engines: {node: '>=12.20'} - dev: true diff --git a/src/index.ts b/src/index.ts index 00de6c5..2a5f54f 100644 --- a/src/index.ts +++ b/src/index.ts @@ -1,4 +1,5 @@ import fs from 'node:fs' +import { findUpSync } from 'find-up' // @ts-expect-error missing types import parse from 'parse-gitignore' @@ -6,30 +7,49 @@ import parse from 'parse-gitignore' export interface FlatGitignoreOptions { files?: string | string[] strict?: boolean + fallbackToRoot?: boolean } export interface FlatConfigItem { ignores: string[] } +const GITIGNORE = '.gitignore' as const + export default function ignore(options: FlatGitignoreOptions = {}): FlatConfigItem { const ignores: string[] = [] const { - files: _files = '.gitignore', + files: _files = GITIGNORE, strict = true, + fallbackToRoot = true, } = options const files = Array.isArray(_files) ? _files : [_files] for (const file of files) { - let content: string + let content = '' try { content = fs.readFileSync(file, 'utf8') } catch (error) { - if (strict) - throw error - continue + const upperGitignoreFilePath = findUpSync(GITIGNORE) + if (fallbackToRoot) { + if (upperGitignoreFilePath) { + try { + content = fs.readFileSync(upperGitignoreFilePath, 'utf8') + } + catch (error) { + if (strict) + throw error + continue + } + } + } + if (!fallbackToRoot || !upperGitignoreFilePath) { + if (strict) + throw error + continue + } } const parsed = parse(`${content}\n`) const globs = parsed.globs() diff --git a/workspace/index.temp.ts b/workspace/index.temp.ts new file mode 100644 index 0000000..5eba47b --- /dev/null +++ b/workspace/index.temp.ts @@ -0,0 +1,69 @@ +import fs from 'node:fs' +import { findUpSync } from 'find-up' + +// @ts-expect-error missing types +import parse from 'parse-gitignore' + +export interface FlatGitignoreOptions { + files?: string | string[] + strict?: boolean + fallbackToRoot?: boolean +} + +export interface FlatConfigItem { + ignores: string[] +} + +const GITIGNORE = '.gitignore' as const + +export default function ignore(options: FlatGitignoreOptions = {}): FlatConfigItem { + const ignores: string[] = [] + + const { + files: _files = GITIGNORE, + strict = true, + fallbackToRoot = true, + } = options + const files = Array.isArray(_files) ? _files : [_files] + + for (const file of files) { + let content = '' + try { + content = fs.readFileSync(file, 'utf8') + } + catch (error) { + const upperGitignoreFilePath = findUpSync(GITIGNORE) + if (fallbackToRoot) { + if (upperGitignoreFilePath) { + try { + content = fs.readFileSync(upperGitignoreFilePath, 'utf8') + } + catch (error) { + if (strict) + throw error + continue + } + } + } + if (!fallbackToRoot || !upperGitignoreFilePath) { + if (strict) + throw error + continue + } + } + const parsed = parse(`${content}\n`) + const globs = parsed.globs() + for (const glob of globs) { + if (glob.type === 'ignore') + ignores.push(...glob.patterns) + else if (glob.type === 'unignore') + ignores.push(...glob.patterns.map((pattern: string) => `!${pattern}`)) + } + } + + return { + ignores, + } +} + +ignore() diff --git a/workspace/package.json b/workspace/package.json new file mode 100644 index 0000000..68f2edb --- /dev/null +++ b/workspace/package.json @@ -0,0 +1,11 @@ +{ + "name": "workspace", + "type": "module", + "private": true, + "scripts": { + "start": "esno ./index.temp.ts" + }, + "dependencies": { + "esno": "^4.0.0" + } +} From 2381af64c69893748ff5ff8b928035e0010cd1b1 Mon Sep 17 00:00:00 2001 From: AndreaPontrandolfo Date: Wed, 3 Jan 2024 17:11:53 +0100 Subject: [PATCH 2/7] chore: changed test script --- package.json | 4 +- pnpm-lock.yaml | 272 ++++++++++++++++++++++++++----------------------- 2 files changed, 147 insertions(+), 129 deletions(-) diff --git a/package.json b/package.json index a44309f..b36df49 100644 --- a/package.json +++ b/package.json @@ -46,7 +46,7 @@ "prepublishOnly": "nr build", "release": "bumpp && npm publish", "start": "esno src/workspace/index.temp.ts", - "test": "vitest", + "test": "vitest --pool=forks", "typecheck": "tsc --noEmit", "prepare": "simple-git-hooks" }, @@ -69,7 +69,7 @@ "typescript": "^5.3.2", "unbuild": "^2.0.0", "vite": "^5.0.4", - "vitest": "^0.34.6" + "vitest": "^1.1.1" }, "simple-git-hooks": { "pre-commit": "pnpm lint-staged" diff --git a/pnpm-lock.yaml b/pnpm-lock.yaml index 57ae59e..95742bd 100644 --- a/pnpm-lock.yaml +++ b/pnpm-lock.yaml @@ -17,7 +17,7 @@ importers: devDependencies: '@antfu/eslint-config': specifier: ^2.1.2 - version: 2.1.2(eslint@8.54.0)(typescript@5.3.2)(vitest@0.34.6) + version: 2.1.2(eslint@8.54.0)(typescript@5.3.2)(vitest@1.1.1) '@antfu/ni': specifier: ^0.21.12 version: 0.21.12 @@ -58,14 +58,8 @@ importers: specifier: ^5.0.4 version: 5.0.4(@types/node@20.10.1) vitest: - specifier: ^0.34.6 - version: 0.34.6 - - workspace: - dependencies: - esno: - specifier: ^4.0.0 - version: 4.0.0 + specifier: ^1.1.1 + version: 1.1.1(@types/node@20.10.1) packages: @@ -82,7 +76,7 @@ packages: '@jridgewell/trace-mapping': 0.3.17 dev: true - /@antfu/eslint-config@2.1.2(eslint@8.54.0)(typescript@5.3.2)(vitest@0.34.6): + /@antfu/eslint-config@2.1.2(eslint@8.54.0)(typescript@5.3.2)(vitest@1.1.1): resolution: {integrity: sha512-eOkXtRcj3pAqkdbqNYEBUgFKTcDYYwAAAnGEs+DTTcJJJReIlrPx4WJIE02whOsi+5oKcJ7EK/swS6PcdcCIog==} hasBin: true peerDependencies: @@ -110,7 +104,7 @@ packages: '@typescript-eslint/eslint-plugin': 6.13.1(@typescript-eslint/parser@6.13.1)(eslint@8.54.0)(typescript@5.3.2) '@typescript-eslint/parser': 6.13.1(eslint@8.54.0)(typescript@5.3.2) eslint: 8.54.0 - eslint-config-flat-gitignore: 0.1.1 + eslint-config-flat-gitignore: 0.1.2 eslint-plugin-antfu: 1.0.11(eslint@8.54.0) eslint-plugin-eslint-comments: 3.2.0(eslint@8.54.0) eslint-plugin-i: 2.29.0(@typescript-eslint/parser@6.13.1)(eslint@8.54.0) @@ -122,7 +116,7 @@ packages: eslint-plugin-perfectionist: 2.5.0(eslint@8.54.0)(typescript@5.3.2)(vue-eslint-parser@9.3.2) eslint-plugin-unicorn: 49.0.0(eslint@8.54.0) eslint-plugin-unused-imports: 3.0.0(@typescript-eslint/eslint-plugin@6.13.1)(eslint@8.54.0) - eslint-plugin-vitest: 0.3.10(@typescript-eslint/eslint-plugin@6.13.1)(eslint@8.54.0)(typescript@5.3.2)(vitest@0.34.6) + eslint-plugin-vitest: 0.3.10(@typescript-eslint/eslint-plugin@6.13.1)(eslint@8.54.0)(typescript@5.3.2)(vitest@1.1.1) eslint-plugin-vue: 9.19.2(eslint@8.54.0) eslint-plugin-yml: 1.10.0(eslint@8.54.0) globals: 13.23.0 @@ -166,11 +160,11 @@ packages: resolution: {integrity: sha512-pvFiLP2BeOKA/ZOS6jxx4XhKzdVLHDhGlFEaZ2flWWYf2xOqVniqpk38I04DFRyz+L0ASggl7SkItTc+ZLju4w==} dev: true - /@babel/code-frame@7.22.13: - resolution: {integrity: sha512-XktuhWlJ5g+3TJXc5upd9Ks1HutSArik6jf2eAjYFyIOf4ej3RN+184cZbzDvbPnuTJIUhPKKJE3cIsYTiAT3w==} + /@babel/code-frame@7.23.5: + resolution: {integrity: sha512-CgH3s1a96LipHCmSUmYFPwY7MNx8C3avkq7i4Wl3cfa662ldtUe4VM1TPXX70pfmrlWTb6jLqTYrZyT2ZTJBgA==} engines: {node: '>=6.9.0'} dependencies: - '@babel/highlight': 7.22.13 + '@babel/highlight': 7.23.4 chalk: 2.4.2 dev: true @@ -184,7 +178,7 @@ packages: engines: {node: '>=6.9.0'} dependencies: '@ampproject/remapping': 2.2.0 - '@babel/code-frame': 7.22.13 + '@babel/code-frame': 7.23.5 '@babel/generator': 7.22.10 '@babel/helper-compilation-targets': 7.22.10 '@babel/helper-module-transforms': 7.22.9(@babel/core@7.22.11) @@ -261,7 +255,7 @@ packages: '@babel/helper-module-imports': 7.22.5 '@babel/helper-simple-access': 7.22.5 '@babel/helper-split-export-declaration': 7.22.6 - '@babel/helper-validator-identifier': 7.22.5 + '@babel/helper-validator-identifier': 7.22.20 dev: true /@babel/helper-simple-access@7.22.5: @@ -309,12 +303,12 @@ packages: - supports-color dev: true - /@babel/highlight@7.22.13: - resolution: {integrity: sha512-C/BaXcnnvBCmHTpz/VGZ8jgtE2aYlW4hxDhseJAWZb7gqGM/qtCK6iZUb0TyKFf7BOUsBH7Q7fkRsDRhg1XklQ==} + /@babel/highlight@7.23.4: + resolution: {integrity: sha512-acGdbYSfp2WheJoJm/EBBBLh/ID8KDc64ISZ9DYtBmC8/Q204PZJLHyzeB5qMzJ5trcOkybd78M4x2KWsUq++A==} engines: {node: '>=6.9.0'} requiresBuild: true dependencies: - '@babel/helper-validator-identifier': 7.22.5 + '@babel/helper-validator-identifier': 7.22.20 chalk: 2.4.2 js-tokens: 4.0.0 dev: true @@ -336,7 +330,7 @@ packages: resolution: {integrity: sha512-X7yV7eiwAxdj9k94NEylvbVHLiVG1nvzCV2EAowhxLTwODV1jl9UzZ48leOC0sH7OnuHrIkllaBgneUykIcZaw==} engines: {node: '>=6.9.0'} dependencies: - '@babel/code-frame': 7.22.13 + '@babel/code-frame': 7.23.5 '@babel/parser': 7.22.13 '@babel/types': 7.22.11 dev: true @@ -345,7 +339,7 @@ packages: resolution: {integrity: sha512-mzAenteTfomcB7mfPtyi+4oe5BZ6MXxWcn4CX+h4IRJ+OOGXBrWU6jDQavkQI9Vuc5P+donFabBfFCcmWka9lQ==} engines: {node: '>=6.9.0'} dependencies: - '@babel/code-frame': 7.22.13 + '@babel/code-frame': 7.23.5 '@babel/generator': 7.22.10 '@babel/helper-environment-visitor': 7.22.5 '@babel/helper-function-name': 7.22.5 @@ -392,6 +386,7 @@ packages: cpu: [arm64] os: [android] requiresBuild: true + dev: true optional: true /@esbuild/android-arm64@0.19.2: @@ -427,6 +422,7 @@ packages: cpu: [arm] os: [android] requiresBuild: true + dev: true optional: true /@esbuild/android-arm@0.19.2: @@ -462,6 +458,7 @@ packages: cpu: [x64] os: [android] requiresBuild: true + dev: true optional: true /@esbuild/android-x64@0.19.2: @@ -497,6 +494,7 @@ packages: cpu: [arm64] os: [darwin] requiresBuild: true + dev: true optional: true /@esbuild/darwin-arm64@0.19.2: @@ -532,6 +530,7 @@ packages: cpu: [x64] os: [darwin] requiresBuild: true + dev: true optional: true /@esbuild/darwin-x64@0.19.2: @@ -567,6 +566,7 @@ packages: cpu: [arm64] os: [freebsd] requiresBuild: true + dev: true optional: true /@esbuild/freebsd-arm64@0.19.2: @@ -602,6 +602,7 @@ packages: cpu: [x64] os: [freebsd] requiresBuild: true + dev: true optional: true /@esbuild/freebsd-x64@0.19.2: @@ -637,6 +638,7 @@ packages: cpu: [arm64] os: [linux] requiresBuild: true + dev: true optional: true /@esbuild/linux-arm64@0.19.2: @@ -672,6 +674,7 @@ packages: cpu: [arm] os: [linux] requiresBuild: true + dev: true optional: true /@esbuild/linux-arm@0.19.2: @@ -707,6 +710,7 @@ packages: cpu: [ia32] os: [linux] requiresBuild: true + dev: true optional: true /@esbuild/linux-ia32@0.19.2: @@ -742,6 +746,7 @@ packages: cpu: [loong64] os: [linux] requiresBuild: true + dev: true optional: true /@esbuild/linux-loong64@0.19.2: @@ -777,6 +782,7 @@ packages: cpu: [mips64el] os: [linux] requiresBuild: true + dev: true optional: true /@esbuild/linux-mips64el@0.19.2: @@ -812,6 +818,7 @@ packages: cpu: [ppc64] os: [linux] requiresBuild: true + dev: true optional: true /@esbuild/linux-ppc64@0.19.2: @@ -847,6 +854,7 @@ packages: cpu: [riscv64] os: [linux] requiresBuild: true + dev: true optional: true /@esbuild/linux-riscv64@0.19.2: @@ -882,6 +890,7 @@ packages: cpu: [s390x] os: [linux] requiresBuild: true + dev: true optional: true /@esbuild/linux-s390x@0.19.2: @@ -917,6 +926,7 @@ packages: cpu: [x64] os: [linux] requiresBuild: true + dev: true optional: true /@esbuild/linux-x64@0.19.2: @@ -952,6 +962,7 @@ packages: cpu: [x64] os: [netbsd] requiresBuild: true + dev: true optional: true /@esbuild/netbsd-x64@0.19.2: @@ -987,6 +998,7 @@ packages: cpu: [x64] os: [openbsd] requiresBuild: true + dev: true optional: true /@esbuild/openbsd-x64@0.19.2: @@ -1022,6 +1034,7 @@ packages: cpu: [x64] os: [sunos] requiresBuild: true + dev: true optional: true /@esbuild/sunos-x64@0.19.2: @@ -1057,6 +1070,7 @@ packages: cpu: [arm64] os: [win32] requiresBuild: true + dev: true optional: true /@esbuild/win32-arm64@0.19.2: @@ -1092,6 +1106,7 @@ packages: cpu: [ia32] os: [win32] requiresBuild: true + dev: true optional: true /@esbuild/win32-ia32@0.19.2: @@ -1127,6 +1142,7 @@ packages: cpu: [x64] os: [win32] requiresBuild: true + dev: true optional: true /@esbuild/win32-x64@0.19.2: @@ -1228,8 +1244,8 @@ packages: wrap-ansi-cjs: /wrap-ansi@7.0.0 dev: true - /@jest/schemas@29.6.0: - resolution: {integrity: sha512-rxLjXyJBTL4LQeJW3aKo0M/+GkCOXsO+8i9Iu7eDb6KwtP65ayoDsitrdPBtujxQ88k4wI2FNYfa6TOGwSn6cQ==} + /@jest/schemas@29.6.3: + resolution: {integrity: sha512-mo5j5X+jIZmJQveBKeS/clAueipV7KgiX1vMgCxam1RNYiqE1w62n0/tJJnHtjW8ZHcQco5gY85jA3mi0L+nSA==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: '@sinclair/typebox': 0.27.8 @@ -1561,16 +1577,6 @@ packages: - typescript dev: true - /@types/chai-subset@1.3.3: - resolution: {integrity: sha512-frBecisrNGz+F4T6bcc+NLeolfiojh5FxW2klu669+8BARtyQv2C/GkNW6FUodVe4BroGMP/wER/YDGc7rEllw==} - dependencies: - '@types/chai': 4.3.5 - dev: true - - /@types/chai@4.3.5: - resolution: {integrity: sha512-mEo1sAde+UCE6b2hxn332f1g1E8WfYRu6p5SvTKr2ZKC1f7gFJXk4h5PyGP9Dt6gCaG8y8XhwnXWC6Iy2cmBng==} - dev: true - /@types/estree@1.0.0: resolution: {integrity: sha512-WulqXMDUTYAXCjZnk6JtIHPigp55cVtDgDrO2gHRwhyJto21+1zbVCtOYB2L1F9w4qCQ0rOGWBnBe0FNTiEJIQ==} dev: true @@ -1742,42 +1748,42 @@ packages: resolution: {integrity: sha512-zuVdFrMJiuCDQUMCzQaD6KL28MjnqqN8XnAqiEq9PNm/hCPTSGfrXCOfwj1ow4LFb/tNymJPwsNbVePc1xFqrQ==} dev: true - /@vitest/expect@0.34.6: - resolution: {integrity: sha512-QUzKpUQRc1qC7qdGo7rMK3AkETI7w18gTCUrsNnyjjJKYiuUB9+TQK3QnR1unhCnWRC0AbKv2omLGQDF/mIjOw==} + /@vitest/expect@1.1.1: + resolution: {integrity: sha512-Qpw01C2Hyb3085jBkOJLQ7HRX0Ncnh2qV4p+xWmmhcIUlMykUF69zsnZ1vPmAjZpomw9+5tWEGOQ0GTfR8U+kA==} dependencies: - '@vitest/spy': 0.34.6 - '@vitest/utils': 0.34.6 + '@vitest/spy': 1.1.1 + '@vitest/utils': 1.1.1 chai: 4.3.10 dev: true - /@vitest/runner@0.34.6: - resolution: {integrity: sha512-1CUQgtJSLF47NnhN+F9X2ycxUP0kLHQ/JWvNHbeBfwW8CzEGgeskzNnHDyv1ieKTltuR6sdIHV+nmR6kPxQqzQ==} + /@vitest/runner@1.1.1: + resolution: {integrity: sha512-8HokyJo1SnSi3uPFKfWm/Oq1qDwLC4QDcVsqpXIXwsRPAg3gIDh8EbZ1ri8cmQkBxdOu62aOF9B4xcqJhvt4xQ==} dependencies: - '@vitest/utils': 0.34.6 - p-limit: 4.0.0 + '@vitest/utils': 1.1.1 + p-limit: 5.0.0 pathe: 1.1.1 dev: true - /@vitest/snapshot@0.34.6: - resolution: {integrity: sha512-B3OZqYn6k4VaN011D+ve+AA4whM4QkcwcrwaKwAbyyvS/NB1hCWjFIBQxAQQSQir9/RtyAAGuq+4RJmbn2dH4w==} + /@vitest/snapshot@1.1.1: + resolution: {integrity: sha512-WnMHjv4VdHLbFGgCdVVvyRkRPnOKN75JJg+LLTdr6ah7YnL75W+7CTIMdzPEPzaDxA8r5yvSVlc1d8lH3yE28w==} dependencies: - magic-string: 0.30.3 + magic-string: 0.30.5 pathe: 1.1.1 - pretty-format: 29.6.1 + pretty-format: 29.7.0 dev: true - /@vitest/spy@0.34.6: - resolution: {integrity: sha512-xaCvneSaeBw/cz8ySmF7ZwGvL0lBjfvqc1LpQ/vcdHEvpLn3Ff1vAvjw+CoGn0802l++5L/pxb7whwcWAw+DUQ==} + /@vitest/spy@1.1.1: + resolution: {integrity: sha512-hDU2KkOTfFp4WFFPWwHFauddwcKuGQ7gF6Un/ZZkCogoAiTMN7/7YKvUDbywPZZ754iCQGjdUmXN3t4k0jm1IQ==} dependencies: - tinyspy: 2.1.1 + tinyspy: 2.2.0 dev: true - /@vitest/utils@0.34.6: - resolution: {integrity: sha512-IG5aDD8S6zlvloDsnzHw0Ut5xczlF+kv2BOTo+iXfPr54Yhi5qbVOgGB1hZaVq4iJ4C/MZ2J0y15IlsV/ZcI0A==} + /@vitest/utils@1.1.1: + resolution: {integrity: sha512-E9LedH093vST/JuBSyHLFMpxJKW3dLhe/flUSPFedoyj4wKiFX7Jm8gYLtOIiin59dgrssfmFv0BJ1u8P/LC/A==} dependencies: - diff-sequences: 29.4.3 - loupe: 2.3.6 - pretty-format: 29.6.1 + diff-sequences: 29.6.3 + loupe: 2.3.7 + pretty-format: 29.7.0 dev: true /acorn-jsx@5.3.2(acorn@8.10.0): @@ -1788,8 +1794,8 @@ packages: acorn: 8.10.0 dev: true - /acorn-walk@8.2.0: - resolution: {integrity: sha512-k+iyHEuPgSw6SbuDpGQM+06HQUa04DZ3o+F6CSzXMvvI5KMvnaEqXe+YVe555R9nn6GPt404fos4wcgpw12SDA==} + /acorn-walk@8.3.1: + resolution: {integrity: sha512-TgUZgYvqZprrl7YldZNoa9OciCAyZR+Ejm9eXzKCmjsF5IKp/wgQ7Z/ZpjpGTIUPwrHQIcYeI8qDh4PsEwxMbw==} engines: {node: '>=0.4.0'} dev: true @@ -1805,6 +1811,12 @@ packages: hasBin: true dev: true + /acorn@8.11.3: + resolution: {integrity: sha512-Y9rRfJG5jcKOE0CLisYbojUjIrIEE7AGMzA/Sm4BslANhbS+cDMpgBdcPT91oJ7OuJ9hYJBx59RjbhxVnrF8Xg==} + engines: {node: '>=0.4.0'} + hasBin: true + dev: true + /agent-base@6.0.2: resolution: {integrity: sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==} engines: {node: '>= 6.0.0'} @@ -2005,7 +2017,7 @@ packages: check-error: 1.0.3 deep-eql: 4.1.3 get-func-name: 2.0.2 - loupe: 2.3.6 + loupe: 2.3.7 pathval: 1.1.1 type-detect: 4.0.8 dev: true @@ -2231,8 +2243,8 @@ packages: resolution: {integrity: sha512-FJ9RDpf3GicEBvzI3jxc2XhHzbqD8p4ANw/1kPsFBfTvP1b7Gn/Lg1vO7R9J4IVgoMbyUmFrFGZafJ1hPZpvlg==} dev: true - /diff-sequences@29.4.3: - resolution: {integrity: sha512-ofrBgwpPhCD85kMKtE9RYFFq6OC1A89oW2vvgWZNCwxrUpRUILopY7lsYyMDSjc8g6U6aiO0Qubg6r4Wgt5ZnA==} + /diff-sequences@29.6.3: + resolution: {integrity: sha512-EjePK1srD3P08o2j4f0ExnylqRs5B9tJjcp9t1krH2qRi8CCdsYfwe9JgSLurFBWwq4uOlipzfk5fHNvwFKr8Q==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dev: true @@ -2342,6 +2354,7 @@ packages: '@esbuild/win32-arm64': 0.18.20 '@esbuild/win32-ia32': 0.18.20 '@esbuild/win32-x64': 0.18.20 + dev: true /esbuild@0.19.2: resolution: {integrity: sha512-G6hPax8UbFakEj3hWO0Vs52LQ8k3lnBhxZWomUJDxfz3rZTLqF5k/FCzuNdLx2RbpBiQQF9H9onlDDH1lZsnjg==} @@ -2427,8 +2440,8 @@ packages: eslint: 8.54.0 dev: true - /eslint-config-flat-gitignore@0.1.1: - resolution: {integrity: sha512-ysq0QpN63+uaxE67U0g0HeCweIpv8Ztp7yvm0nYiM2TBalRIG6KQLO5J6lAz2gkA8KVis/QsJppe+BR5VigtWQ==} + /eslint-config-flat-gitignore@0.1.2: + resolution: {integrity: sha512-PcBsqtd5QHEZH4ROvpnRN4EP0qcHh9voCCHgtyHxnJZHGspJREcZn7oPqRG/GfWt9m3C0fkC2l5CuBtMig2wXQ==} dependencies: parse-gitignore: 2.0.0 dev: true @@ -2660,7 +2673,7 @@ packages: eslint-rule-composer: 0.3.0 dev: true - /eslint-plugin-vitest@0.3.10(@typescript-eslint/eslint-plugin@6.13.1)(eslint@8.54.0)(typescript@5.3.2)(vitest@0.34.6): + /eslint-plugin-vitest@0.3.10(@typescript-eslint/eslint-plugin@6.13.1)(eslint@8.54.0)(typescript@5.3.2)(vitest@1.1.1): resolution: {integrity: sha512-08lj4rdhZHYyHk+Py2nJ7SlE6arP8GNfGXl9jVqhe9s5JoZIGiBpIkLGX+VNBiB6vXTn56H6Ant7Koc6XzRjtQ==} engines: {node: 14.x || >= 16} peerDependencies: @@ -2676,7 +2689,7 @@ packages: '@typescript-eslint/eslint-plugin': 6.13.1(@typescript-eslint/parser@6.13.1)(eslint@8.54.0)(typescript@5.3.2) '@typescript-eslint/utils': 6.13.1(eslint@8.54.0)(typescript@5.3.2) eslint: 8.54.0 - vitest: 0.34.6 + vitest: 1.1.1(@types/node@20.10.1) transitivePeerDependencies: - supports-color - typescript @@ -2786,6 +2799,7 @@ packages: hasBin: true dependencies: tsx: 4.6.1 + dev: true /espree@9.6.1: resolution: {integrity: sha512-oruZaFkjorTpF32kDSI5/75ViwGeZginGGy2NoOSg3Q9bnwlnmDm4HLnkl0RE3n+njDXR037aY1+x58Z/zFdwQ==} @@ -2837,7 +2851,7 @@ packages: human-signals: 5.0.0 is-stream: 3.0.0 merge-stream: 2.0.0 - npm-run-path: 5.1.0 + npm-run-path: 5.2.0 onetime: 6.0.0 signal-exit: 4.1.0 strip-final-newline: 3.0.0 @@ -2960,6 +2974,7 @@ packages: engines: {node: ^8.16.0 || ^10.6.0 || >=11.0.0} os: [darwin] requiresBuild: true + dev: true optional: true /function-bind@1.1.1: @@ -2999,6 +3014,7 @@ packages: resolution: {integrity: sha512-wuMsz4leaj5hbGgg4IvDU0bqJagpftG5l5cXIAvo8uZrqn0NJqwtfupTN00VnkQJPcIRrxYrm1Ue24btpCha2A==} dependencies: resolve-pkg-maps: 1.0.0 + dev: true /giget@1.1.2: resolution: {integrity: sha512-HsLoS07HiQ5oqvObOI+Qb2tyZH4Gj5nYGfF9qQcZNrPw+uEFhdXtgJr01aO2pWadGHucajYDLxxbtQkm97ON2A==} @@ -3429,11 +3445,6 @@ packages: wrap-ansi: 8.1.0 dev: true - /local-pkg@0.4.3: - resolution: {integrity: sha512-SFppqq5p42fe2qcZQqqEOiVRXl+WCP1MdT6k7BDEW1j++sp5fIY+/fdRQitvKgB5BrBcmrs5m/L0v2FrU5MY1g==} - engines: {node: '>=14'} - dev: true - /local-pkg@0.5.0: resolution: {integrity: sha512-ok6z3qlYyCDS4ZEU27HaU6x/xZa9Whf8jD4ptH5UZTQYZVYeb9bnZ3ojVhiJNLiXK1Hfc0GNbLXcmZ5plLDDBg==} engines: {node: '>=14'} @@ -3481,8 +3492,8 @@ packages: wrap-ansi: 8.1.0 dev: true - /loupe@2.3.6: - resolution: {integrity: sha512-RaPMZKiMy8/JruncMU5Bt6na1eftNoo++R4Y+N2FrxkDVTrGvcyzFTsaGif4QTeKESheMGegbhw6iUAq+5A8zA==} + /loupe@2.3.7: + resolution: {integrity: sha512-zSMINGVYkdpYSOBmLi0D1Uo7JU9nVdQKrHxC8eYlV+9YKK9WePqAlL7lSlorG/U2Fw1w0hTBmaa/jrQ3UbPHtA==} dependencies: get-func-name: 2.0.2 dev: true @@ -3519,6 +3530,13 @@ packages: '@jridgewell/sourcemap-codec': 1.4.15 dev: true + /magic-string@0.30.5: + resolution: {integrity: sha512-7xlpfBaQaP/T6Vh8MO/EqXSW5En6INHEvEXQiuff7Gku0PWjU3uf6w/j9o7O+SpB5fOAkrI5HeoNgwjEO0pFsA==} + engines: {node: '>=12'} + dependencies: + '@jridgewell/sourcemap-codec': 1.4.15 + dev: true + /mdast-util-from-markdown@0.8.5: resolution: {integrity: sha512-2hkTXtYYnr+NubD/g6KGBS/0mFmBcifAsI0yIWRiRo0PjVs6SSOSOdtzbp6kSGnShDN6G5aWZpKQ2lWRy27mWQ==} dependencies: @@ -3670,10 +3688,10 @@ packages: /mlly@1.4.2: resolution: {integrity: sha512-i/Ykufi2t1EZ6NaPLdfnZk2AX8cs0d+mTzVKuPfqPKPatxLApaBoxJQ9x1/uckXtrS/U5oisPMDkNs0yQTaBRg==} dependencies: - acorn: 8.10.0 + acorn: 8.11.3 pathe: 1.1.1 pkg-types: 1.0.3 - ufo: 1.3.1 + ufo: 1.3.2 dev: true /mri@1.2.0: @@ -3725,8 +3743,8 @@ packages: engines: {node: '>=0.10.0'} dev: true - /npm-run-path@5.1.0: - resolution: {integrity: sha512-sJOdmRGrY2sjNTRMbSvluQqg+8X7ZK61yvzBEIDhz4f8z1TZFYABsqjjCBd/0PUNE9M6QDgHJXQkGUEm7Q+l9Q==} + /npm-run-path@5.2.0: + resolution: {integrity: sha512-W4/tgAXFqFA0iL7fk0+uQ3g7wkL8xJmx3XdK0VGb4cHW//eZTtKGvFBBoRKVTpY7n6ze4NL9ly7rgXcHufqXKg==} engines: {node: ^12.20.0 || ^14.13.1 || >=16.0.0} dependencies: path-key: 4.0.0 @@ -3794,6 +3812,13 @@ packages: dependencies: yocto-queue: 1.0.0 + /p-limit@5.0.0: + resolution: {integrity: sha512-/Eaoq+QyLSiXQ4lyYV23f14mZRQcXnxfHrN0vCai+ak9G0pp9iEQukIIZq5NccEvwRB8PUnZT0KsOoDCINS1qQ==} + engines: {node: '>=18'} + dependencies: + yocto-queue: 1.0.0 + dev: true + /p-locate@4.1.0: resolution: {integrity: sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==} engines: {node: '>=8'} @@ -3845,7 +3870,7 @@ packages: resolution: {integrity: sha512-ayCKvm/phCGxOkYRSCM82iDwct8/EonSEgCSxWxD7ve6jHggsFl4fZVQBPRNgQoKiuV/odhFrGzQXZwbifC8Rg==} engines: {node: '>=8'} dependencies: - '@babel/code-frame': 7.22.13 + '@babel/code-frame': 7.23.5 error-ex: 1.3.2 json-parse-even-better-errors: 2.3.1 lines-and-columns: 1.2.4 @@ -3965,11 +3990,11 @@ packages: engines: {node: ^14.13.1 || >=16.0.0} dev: true - /pretty-format@29.6.1: - resolution: {integrity: sha512-7jRj+yXO0W7e4/tSJKoR7HRIHLPPjtNaUGG2xxKQnGvPNRkgWcQ0AZX6P4KBRJN4FcTBWb3sa7DVUJmocYuoog==} + /pretty-format@29.7.0: + resolution: {integrity: sha512-Pdlw/oPxN+aXdmM9R00JVC9WVFoCLTKJvDVLgmJ+qAffBMxsV85l/Lu7sNx4zSzPyoL2euImuEwHhOXdEgNFZQ==} engines: {node: ^14.15.0 || ^16.10.0 || >=18.0.0} dependencies: - '@jest/schemas': 29.6.0 + '@jest/schemas': 29.6.3 ansi-styles: 5.2.0 react-is: 18.2.0 dev: true @@ -4053,6 +4078,7 @@ packages: /resolve-pkg-maps@1.0.0: resolution: {integrity: sha512-seS2Tj26TBVOC2NIc2rOe2y2ZO7efxITtLZcGSOnHHNOQ7CkiUBfw0Iw2ck6xkIhPwLhKNLS8BO+hEpngQlqzw==} + dev: true /resolve@1.22.3: resolution: {integrity: sha512-P8ur/gp/AmbEzjr729bZnLjXK5Z+4P0zhIJgBgzqRih7hL7BOukHGtSTA3ACMY467GRFz3duQsi0bDZdR7DKdw==} @@ -4115,7 +4141,7 @@ packages: rollup: 3.28.1 typescript: 5.3.2 optionalDependencies: - '@babel/code-frame': 7.22.13 + '@babel/code-frame': 7.23.5 dev: true /rollup@3.28.1: @@ -4267,8 +4293,8 @@ packages: resolution: {integrity: sha512-1XMJE5fQo1jGH6Y/7ebnwPOBEkIEnT4QF32d5R1+VXdXveM0IBMJt8zfaxX1P3QhVwrYe+576+jkANtSS2mBbw==} dev: true - /std-env@3.3.3: - resolution: {integrity: sha512-Rz6yejtVyWnVjC1RFvNmYL10kgjC49EOghxWn0RFqlCHGFpQx+Xe7yW3I4ceK1SGrWIGMjD5Kbue8W/udkbMJg==} + /std-env@3.7.0: + resolution: {integrity: sha512-JPbdCEQLj1w5GilpiHAx3qJvFndqybBysA3qUOnznweH4QbNYUsW/ea8QzSrnh0vNsezMMw5bcVool8lM0gwzg==} dev: true /string-argv@0.3.2: @@ -4325,10 +4351,10 @@ packages: engines: {node: '>=8'} dev: true - /strip-literal@1.0.1: - resolution: {integrity: sha512-QZTsipNpa2Ppr6v1AmJHESqJ3Uz247MUS0OjrnnZjFAvEoWqxuyFuXn2xLgMtRnijJShAa1HL0gtJyUs7u7n3Q==} + /strip-literal@1.3.0: + resolution: {integrity: sha512-PugKzOsyXpArk0yWmUwqOZecSO0GH0bPoctLcqNDH9J04pVW3lflYE0ujElBGTloevcxF5MofAOZ7C5l2b+wLg==} dependencies: - acorn: 8.10.0 + acorn: 8.11.3 dev: true /supports-color@5.5.0: @@ -4367,17 +4393,17 @@ packages: resolution: {integrity: sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw==} dev: true - /tinybench@2.5.0: - resolution: {integrity: sha512-kRwSG8Zx4tjF9ZiyH4bhaebu+EDz1BOx9hOigYHlUW4xxI/wKIUQUqo018UlU4ar6ATPBsaMrdbKZ+tmPdohFA==} + /tinybench@2.5.1: + resolution: {integrity: sha512-65NKvSuAVDP/n4CqH+a9w2kTlLReS9vhsAP06MWx+/89nMinJyB2icyl58RIcqCmIggpojIGeuJGhjU1aGMBSg==} dev: true - /tinypool@0.7.0: - resolution: {integrity: sha512-zSYNUlYSMhJ6Zdou4cJwo/p7w5nmAH17GRfU/ui3ctvjXFErXXkruT4MWW6poDeXgCaIBlGLrfU6TbTXxyGMww==} + /tinypool@0.8.1: + resolution: {integrity: sha512-zBTCK0cCgRROxvs9c0CGK838sPkeokNGdQVUUwHAbynHFlmyJYj825f/oRs528HaIJ97lo0pLIlDUzwN+IorWg==} engines: {node: '>=14.0.0'} dev: true - /tinyspy@2.1.1: - resolution: {integrity: sha512-XPJL2uSzcOyBMky6OFrusqWlzfFrXtE0hPuMgW8A2HmaqrPo4ZQHRN/V0QXN3FSjKxpsbRrFc5LI7KOwBsT1/w==} + /tinyspy@2.2.0: + resolution: {integrity: sha512-d2eda04AN/cPOR89F7Xv5bK/jrQEhmcLFe6HFldoeO9AJtps+fqEnh486vnT/8y4bw38pSyxDcTCAq+Ks2aJTg==} engines: {node: '>=14.0.0'} dev: true @@ -4411,6 +4437,7 @@ packages: get-tsconfig: 4.7.2 optionalDependencies: fsevents: 2.3.3 + dev: true /type-check@0.4.0: resolution: {integrity: sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==} @@ -4454,8 +4481,8 @@ packages: resolution: {integrity: sha512-TrY6DsjTQQgyS3E3dBaOXf0TpPD8u9FVrVYmKVegJuFw51n/YB9XPt+U6ydzFG5ZIN7+DIjPbNmXoBj9esYhgQ==} dev: true - /ufo@1.3.1: - resolution: {integrity: sha512-uY/99gMLIOlJPwATcMVYfqDSxUR9//AUcgZMzwfSTJPDKzA1S8mX4VLqa+fiAtveraQUBCz4FFcwVZBGbwBXIw==} + /ufo@1.3.2: + resolution: {integrity: sha512-o+ORpgGwaYQXgqGDwd+hkS4PuZ3QnmqMMxRuajK/a38L6fTpcE5GPIfrf+L/KemFzfUpeUQc1rRS1iDBozvnFA==} dev: true /unbuild@2.0.0(typescript@5.3.2): @@ -4559,14 +4586,13 @@ packages: spdx-expression-parse: 3.0.1 dev: true - /vite-node@0.34.6(@types/node@20.10.1): - resolution: {integrity: sha512-nlBMJ9x6n7/Amaz6F3zJ97EBwR2FkzhBRxF5e+jE6LA3yi6Wtc2lyTij1OnDMIr34v5g/tVQtsVAzhT0jc5ygA==} - engines: {node: '>=v14.18.0'} + /vite-node@1.1.1(@types/node@20.10.1): + resolution: {integrity: sha512-2bGE5w4jvym5v8llF6Gu1oBrmImoNSs4WmRVcavnG2me6+8UQntTqLiAMFyiAobp+ZXhj5ZFhI7SmLiFr/jrow==} + engines: {node: ^18.0.0 || >=20.0.0} hasBin: true dependencies: cac: 6.7.14 debug: 4.3.4 - mlly: 1.4.0 pathe: 1.1.1 picocolors: 1.0.0 vite: 5.0.4(@types/node@20.10.1) @@ -4617,22 +4643,22 @@ packages: fsevents: 2.3.3 dev: true - /vitest@0.34.6: - resolution: {integrity: sha512-+5CALsOvbNKnS+ZHMXtuUC7nL8/7F1F2DnHGjSsszX8zCjWSSviphCb/NuS9Nzf4Q03KyyDRBAXhF/8lffME4Q==} - engines: {node: '>=v14.18.0'} + /vitest@1.1.1(@types/node@20.10.1): + resolution: {integrity: sha512-Ry2qs4UOu/KjpXVfOCfQkTnwSXYGrqTbBZxw6reIYEFjSy1QUARRg5pxiI5BEXy+kBVntxUYNMlq4Co+2vD3fQ==} + engines: {node: ^18.0.0 || >=20.0.0} hasBin: true peerDependencies: '@edge-runtime/vm': '*' - '@vitest/browser': '*' - '@vitest/ui': '*' + '@types/node': ^18.0.0 || >=20.0.0 + '@vitest/browser': ^1.0.0 + '@vitest/ui': ^1.0.0 happy-dom: '*' jsdom: '*' - playwright: '*' - safaridriver: '*' - webdriverio: '*' peerDependenciesMeta: '@edge-runtime/vm': optional: true + '@types/node': + optional: true '@vitest/browser': optional: true '@vitest/ui': @@ -4641,36 +4667,28 @@ packages: optional: true jsdom: optional: true - playwright: - optional: true - safaridriver: - optional: true - webdriverio: - optional: true dependencies: - '@types/chai': 4.3.5 - '@types/chai-subset': 1.3.3 '@types/node': 20.10.1 - '@vitest/expect': 0.34.6 - '@vitest/runner': 0.34.6 - '@vitest/snapshot': 0.34.6 - '@vitest/spy': 0.34.6 - '@vitest/utils': 0.34.6 - acorn: 8.10.0 - acorn-walk: 8.2.0 + '@vitest/expect': 1.1.1 + '@vitest/runner': 1.1.1 + '@vitest/snapshot': 1.1.1 + '@vitest/spy': 1.1.1 + '@vitest/utils': 1.1.1 + acorn-walk: 8.3.1 cac: 6.7.14 chai: 4.3.10 debug: 4.3.4 - local-pkg: 0.4.3 - magic-string: 0.30.3 + execa: 8.0.1 + local-pkg: 0.5.0 + magic-string: 0.30.5 pathe: 1.1.1 picocolors: 1.0.0 - std-env: 3.3.3 - strip-literal: 1.0.1 - tinybench: 2.5.0 - tinypool: 0.7.0 + std-env: 3.7.0 + strip-literal: 1.3.0 + tinybench: 2.5.1 + tinypool: 0.8.1 vite: 5.0.4(@types/node@20.10.1) - vite-node: 0.34.6(@types/node@20.10.1) + vite-node: 1.1.1(@types/node@20.10.1) why-is-node-running: 2.2.2 transitivePeerDependencies: - less From d7782007d9601629513cc253f6379dd8fc136211 Mon Sep 17 00:00:00 2001 From: AndreaPontrandolfo Date: Wed, 3 Jan 2024 17:12:19 +0100 Subject: [PATCH 3/7] docs: updated readme with fallbackToRoot option --- README.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/README.md b/README.md index 0560fc6..e6a4adb 100644 --- a/README.md +++ b/README.md @@ -48,6 +48,14 @@ gitignore({ }) ``` +By default, if no `.gitignore` is found in the cwd then this plugin will keep searching in the upper folders, until it find one or reach the root folder. This behaviour is useful in monorepo scenarios. This can be disabled by setting the `fallbackToRoot` option to `false`. + +```js +gitignore({ + fallbackToRoot: false +}) +``` + ## Sponsors

From 9f09293e0402101cff7697022210e807fc5f5304 Mon Sep 17 00:00:00 2001 From: AndreaPontrandolfo Date: Wed, 3 Jan 2024 17:14:38 +0100 Subject: [PATCH 4/7] feat: modified test with fallbackToRoot option --- test/index.test.ts | 6 +-- test/workspace/workspace.test.ts | 54 +++++++++++++++++++++++++ workspace/index.temp.ts | 69 -------------------------------- workspace/package.json | 11 ----- 4 files changed, 57 insertions(+), 83 deletions(-) create mode 100644 test/workspace/workspace.test.ts delete mode 100644 workspace/index.temp.ts delete mode 100644 workspace/package.json diff --git a/test/index.test.ts b/test/index.test.ts index 30aee15..07c7875 100644 --- a/test/index.test.ts +++ b/test/index.test.ts @@ -3,7 +3,7 @@ import ignore from '../src/index' describe('should', () => { it('exported', () => { - expect(ignore()) + expect(ignore({ fallbackToRoot: false })) .toMatchInlineSnapshot(` { "ignores": [ @@ -37,12 +37,12 @@ describe('should', () => { }) it('strict (default) throw', () => { - expect(() => ignore({ files: 'not-exists' })) + expect(() => ignore({ files: 'not-exists', fallbackToRoot: false })) .toThrow() }) it('not strict skip missing file', () => { - expect(ignore({ files: 'not-exists', strict: false })) + expect(ignore({ files: 'not-exists', strict: false, fallbackToRoot: false })) .toMatchInlineSnapshot(` { "ignores": [], diff --git a/test/workspace/workspace.test.ts b/test/workspace/workspace.test.ts new file mode 100644 index 0000000..717d360 --- /dev/null +++ b/test/workspace/workspace.test.ts @@ -0,0 +1,54 @@ +import { describe, expect, it } from 'vitest' +import ignore from '../../src/index' + +describe('should', () => { + process.chdir('test/workspace') + + it('exported', () => { + expect(ignore({ fallbackToRoot: true })) + .toMatchInlineSnapshot(` + { + "ignores": [ + ".cache", + "**/.cache/**", + ".DS_Store", + "**/.DS_Store/**", + ".idea", + "**/.idea/**", + "*.log", + "**/*.log/**", + "*.tgz", + "**/*.tgz/**", + "coverage", + "**/coverage/**", + "dist", + "**/dist/**", + "lib-cov", + "**/lib-cov/**", + "logs", + "**/logs/**", + "node_modules", + "**/node_modules/**", + "temp", + "**/temp/**", + "!temp/.gitkeep", + "!temp/.gitkeep/**", + ], + } + `) + }) + + it('strict (default) throw', () => { + expect(() => ignore({ files: 'not-exists', fallbackToRoot: false })) + .toThrow() + }) + + it('not strict skip missing file', () => { + expect(ignore({ files: 'not-exists', strict: false, fallbackToRoot: false })) + .toMatchInlineSnapshot(` + { + "ignores": [], + } + `) + }) +}) diff --git a/workspace/index.temp.ts b/workspace/index.temp.ts deleted file mode 100644 index 5eba47b..0000000 --- a/workspace/index.temp.ts +++ /dev/null @@ -1,69 +0,0 @@ -import fs from 'node:fs' -import { findUpSync } from 'find-up' - -// @ts-expect-error missing types -import parse from 'parse-gitignore' - -export interface FlatGitignoreOptions { - files?: string | string[] - strict?: boolean - fallbackToRoot?: boolean -} - -export interface FlatConfigItem { - ignores: string[] -} - -const GITIGNORE = '.gitignore' as const - -export default function ignore(options: FlatGitignoreOptions = {}): FlatConfigItem { - const ignores: string[] = [] - - const { - files: _files = GITIGNORE, - strict = true, - fallbackToRoot = true, - } = options - const files = Array.isArray(_files) ? _files : [_files] - - for (const file of files) { - let content = '' - try { - content = fs.readFileSync(file, 'utf8') - } - catch (error) { - const upperGitignoreFilePath = findUpSync(GITIGNORE) - if (fallbackToRoot) { - if (upperGitignoreFilePath) { - try { - content = fs.readFileSync(upperGitignoreFilePath, 'utf8') - } - catch (error) { - if (strict) - throw error - continue - } - } - } - if (!fallbackToRoot || !upperGitignoreFilePath) { - if (strict) - throw error - continue - } - } - const parsed = parse(`${content}\n`) - const globs = parsed.globs() - for (const glob of globs) { - if (glob.type === 'ignore') - ignores.push(...glob.patterns) - else if (glob.type === 'unignore') - ignores.push(...glob.patterns.map((pattern: string) => `!${pattern}`)) - } - } - - return { - ignores, - } -} - -ignore() diff --git a/workspace/package.json b/workspace/package.json deleted file mode 100644 index 68f2edb..0000000 --- a/workspace/package.json +++ /dev/null @@ -1,11 +0,0 @@ -{ - "name": "workspace", - "type": "module", - "private": true, - "scripts": { - "start": "esno ./index.temp.ts" - }, - "dependencies": { - "esno": "^4.0.0" - } -} From 075bb87e9b062e5527dc4a6296d97001c971a827 Mon Sep 17 00:00:00 2001 From: AndreaPontrandolfo Date: Wed, 3 Jan 2024 18:41:44 +0100 Subject: [PATCH 5/7] feat: added more tests --- src/index.ts | 3 +- test/index.test.ts | 4 +- test/workspace-with-gitignore.test.ts | 56 +++++++++++++++++++ test/workspace-with-gitignore/.gitignore | 1 + ...ts => workspace-without-gitignore.test.ts} | 24 ++++++-- test/workspace-without-gitignore/.gitkeep | 0 6 files changed, 80 insertions(+), 8 deletions(-) create mode 100644 test/workspace-with-gitignore.test.ts create mode 100644 test/workspace-with-gitignore/.gitignore rename test/{workspace/workspace.test.ts => workspace-without-gitignore.test.ts} (66%) create mode 100644 test/workspace-without-gitignore/.gitkeep diff --git a/src/index.ts b/src/index.ts index 2a5f54f..aab41d1 100644 --- a/src/index.ts +++ b/src/index.ts @@ -32,8 +32,9 @@ export default function ignore(options: FlatGitignoreOptions = {}): FlatConfigIt content = fs.readFileSync(file, 'utf8') } catch (error) { - const upperGitignoreFilePath = findUpSync(GITIGNORE) + let upperGitignoreFilePath if (fallbackToRoot) { + upperGitignoreFilePath = findUpSync(GITIGNORE) if (upperGitignoreFilePath) { try { content = fs.readFileSync(upperGitignoreFilePath, 'utf8') diff --git a/test/index.test.ts b/test/index.test.ts index 07c7875..c015350 100644 --- a/test/index.test.ts +++ b/test/index.test.ts @@ -1,8 +1,8 @@ import { describe, expect, it } from 'vitest' import ignore from '../src/index' -describe('should', () => { - it('exported', () => { +describe('should execute tests in root folder', () => { + it('should find a gitignore file', () => { expect(ignore({ fallbackToRoot: false })) .toMatchInlineSnapshot(` { diff --git a/test/workspace-with-gitignore.test.ts b/test/workspace-with-gitignore.test.ts new file mode 100644 index 0000000..cd7a85c --- /dev/null +++ b/test/workspace-with-gitignore.test.ts @@ -0,0 +1,56 @@ +import { describe, expect, it } from 'vitest' +import ignore from '../src/index' + +describe('should execute tests in test/workspace-with-gitignore', () => { + process.chdir('test/workspace-with-gitignore') + + it('should find a gitignore file', () => { + expect(ignore()) + .toMatchInlineSnapshot(` + { + "ignores": [ + "gitignoretest", + "**/gitignoretest/**", + ], + } + `) + }) + + it('strict (default) throw', () => { + expect(() => ignore({ files: 'not-exists', fallbackToRoot: false })) + .toThrow() + }) + + it('not strict skip missing file', () => { + expect(ignore({ files: 'not-exists', strict: false, fallbackToRoot: false })) + .toMatchInlineSnapshot(` + { + "ignores": [], + } + `) + }) + + it('should find a gitignore file in cwd', () => { + expect(ignore({ fallbackToRoot: false })) + .toMatchInlineSnapshot(` + { + "ignores": [ + "gitignoretest", + "**/gitignoretest/**", + ], + } + `) + }) + + it('dont fallback to root, strict and return empty array', () => { + expect(ignore({ strict: false, fallbackToRoot: false })) + .toMatchInlineSnapshot(` + { + "ignores": [ + "gitignoretest", + "**/gitignoretest/**", + ], + } + `) + }) +}) diff --git a/test/workspace-with-gitignore/.gitignore b/test/workspace-with-gitignore/.gitignore new file mode 100644 index 0000000..ee0c43f --- /dev/null +++ b/test/workspace-with-gitignore/.gitignore @@ -0,0 +1 @@ +gitignoretest \ No newline at end of file diff --git a/test/workspace/workspace.test.ts b/test/workspace-without-gitignore.test.ts similarity index 66% rename from test/workspace/workspace.test.ts rename to test/workspace-without-gitignore.test.ts index 717d360..33d0328 100644 --- a/test/workspace/workspace.test.ts +++ b/test/workspace-without-gitignore.test.ts @@ -1,11 +1,11 @@ import { describe, expect, it } from 'vitest' -import ignore from '../../src/index' +import ignore from '../src/index' -describe('should', () => { - process.chdir('test/workspace') +describe('should execute tests in test/workspace-without-gitignore', () => { + process.chdir('test/workspace-without-gitignore') - it('exported', () => { - expect(ignore({ fallbackToRoot: true })) + it('should find a gitignore file', () => { + expect(ignore()) .toMatchInlineSnapshot(` { "ignores": [ @@ -51,4 +51,18 @@ describe('should', () => { } `) }) + + it('dont fallback to root, strict and throw error', () => { + expect(() => ignore({ fallbackToRoot: false })) + .toThrow() + }) + + it('dont fallback to root, no strict and return empty array', () => { + expect(ignore({ strict: false, fallbackToRoot: false })) + .toMatchInlineSnapshot(` + { + "ignores": [], + } + `) + }) }) diff --git a/test/workspace-without-gitignore/.gitkeep b/test/workspace-without-gitignore/.gitkeep new file mode 100644 index 0000000..e69de29 From a2a14cd0b68d0cae04cde093df0015703507d7e8 Mon Sep 17 00:00:00 2001 From: AndreaPontrandolfo Date: Wed, 3 Jan 2024 19:15:48 +0100 Subject: [PATCH 6/7] fix: reverted start script changes --- .vscode/settings.json | 4 ++-- package.json | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.vscode/settings.json b/.vscode/settings.json index aecd922..795f401 100644 --- a/.vscode/settings.json +++ b/.vscode/settings.json @@ -8,8 +8,8 @@ // Auto fix "editor.codeActionsOnSave": { - "source.fixAll.eslint": "explicit", - "source.organizeImports": "never" + "source.fixAll.eslint": true, + "source.organizeImports": false }, // Silent the stylistic rules in you IDE, but still auto fix them diff --git a/package.json b/package.json index b36df49..62bacd0 100644 --- a/package.json +++ b/package.json @@ -45,7 +45,7 @@ "lint": "eslint .", "prepublishOnly": "nr build", "release": "bumpp && npm publish", - "start": "esno src/workspace/index.temp.ts", + "start": "esno src/index.ts", "test": "vitest --pool=forks", "typecheck": "tsc --noEmit", "prepare": "simple-git-hooks" From c7cee03555527a7133b8ef36e88e21f404e59a9d Mon Sep 17 00:00:00 2001 From: Anthony Fu Date: Mon, 8 Jan 2024 16:33:39 +0100 Subject: [PATCH 7/7] chore: update --- README.md | 4 +-- src/index.ts | 45 ++++++++++++------------ test/index.test.ts | 6 ++-- test/workspace-with-gitignore.test.ts | 8 ++--- test/workspace-without-gitignore.test.ts | 8 ++--- 5 files changed, 36 insertions(+), 35 deletions(-) diff --git a/README.md b/README.md index 3a586ea..5af1008 100644 --- a/README.md +++ b/README.md @@ -48,11 +48,11 @@ gitignore({ }) ``` -By default, if no `.gitignore` is found in the cwd then this plugin will keep searching in the upper folders, until it find one or reach the root folder. This behaviour is useful in monorepo scenarios. This can be disabled by setting the `fallbackToRoot` option to `false`. +By default, this plugin will try to look up the directory tree and match the first `.gitignore` file. You can disable this by setting the `root` option to `true`, or specify the `files` option to a specific path. ```js gitignore({ - fallbackToRoot: false + root: true }) ``` diff --git a/src/index.ts b/src/index.ts index aab41d1..a19b974 100644 --- a/src/index.ts +++ b/src/index.ts @@ -5,9 +5,22 @@ import { findUpSync } from 'find-up' import parse from 'parse-gitignore' export interface FlatGitignoreOptions { + /** + * Path to `.gitignore` files, or files with compatible formats like `.eslintignore`. + */ files?: string | string[] + /** + * Throw an error if gitignore file not found. + */ strict?: boolean - fallbackToRoot?: boolean + /** + * Mark the current working directory as the root directory, + * disable searching for `.gitignore` files in parent directories. + * + * This option is not effective when `files` is explicitly specified. + * @default false + */ + root?: boolean } export interface FlatConfigItem { @@ -20,10 +33,11 @@ export default function ignore(options: FlatGitignoreOptions = {}): FlatConfigIt const ignores: string[] = [] const { - files: _files = GITIGNORE, + root = false, + files: _files = root ? GITIGNORE : findUpSync(GITIGNORE) || [], strict = true, - fallbackToRoot = true, } = options + const files = Array.isArray(_files) ? _files : [_files] for (const file of files) { @@ -32,25 +46,9 @@ export default function ignore(options: FlatGitignoreOptions = {}): FlatConfigIt content = fs.readFileSync(file, 'utf8') } catch (error) { - let upperGitignoreFilePath - if (fallbackToRoot) { - upperGitignoreFilePath = findUpSync(GITIGNORE) - if (upperGitignoreFilePath) { - try { - content = fs.readFileSync(upperGitignoreFilePath, 'utf8') - } - catch (error) { - if (strict) - throw error - continue - } - } - } - if (!fallbackToRoot || !upperGitignoreFilePath) { - if (strict) - throw error - continue - } + if (strict) + throw error + continue } const parsed = parse(`${content}\n`) const globs = parsed.globs() @@ -62,6 +60,9 @@ export default function ignore(options: FlatGitignoreOptions = {}): FlatConfigIt } } + if (strict && files.length === 0) + throw new Error('No .gitignore file found') + return { ignores, } diff --git a/test/index.test.ts b/test/index.test.ts index c015350..bf44118 100644 --- a/test/index.test.ts +++ b/test/index.test.ts @@ -3,7 +3,7 @@ import ignore from '../src/index' describe('should execute tests in root folder', () => { it('should find a gitignore file', () => { - expect(ignore({ fallbackToRoot: false })) + expect(ignore({ root: true })) .toMatchInlineSnapshot(` { "ignores": [ @@ -37,12 +37,12 @@ describe('should execute tests in root folder', () => { }) it('strict (default) throw', () => { - expect(() => ignore({ files: 'not-exists', fallbackToRoot: false })) + expect(() => ignore({ files: 'not-exists', root: true })) .toThrow() }) it('not strict skip missing file', () => { - expect(ignore({ files: 'not-exists', strict: false, fallbackToRoot: false })) + expect(ignore({ files: 'not-exists', strict: false, root: true })) .toMatchInlineSnapshot(` { "ignores": [], diff --git a/test/workspace-with-gitignore.test.ts b/test/workspace-with-gitignore.test.ts index cd7a85c..59c334a 100644 --- a/test/workspace-with-gitignore.test.ts +++ b/test/workspace-with-gitignore.test.ts @@ -17,12 +17,12 @@ describe('should execute tests in test/workspace-with-gitignore', () => { }) it('strict (default) throw', () => { - expect(() => ignore({ files: 'not-exists', fallbackToRoot: false })) + expect(() => ignore({ files: 'not-exists', root: true })) .toThrow() }) it('not strict skip missing file', () => { - expect(ignore({ files: 'not-exists', strict: false, fallbackToRoot: false })) + expect(ignore({ files: 'not-exists', strict: false, root: true })) .toMatchInlineSnapshot(` { "ignores": [], @@ -31,7 +31,7 @@ describe('should execute tests in test/workspace-with-gitignore', () => { }) it('should find a gitignore file in cwd', () => { - expect(ignore({ fallbackToRoot: false })) + expect(ignore({ root: true })) .toMatchInlineSnapshot(` { "ignores": [ @@ -43,7 +43,7 @@ describe('should execute tests in test/workspace-with-gitignore', () => { }) it('dont fallback to root, strict and return empty array', () => { - expect(ignore({ strict: false, fallbackToRoot: false })) + expect(ignore({ strict: false, root: true })) .toMatchInlineSnapshot(` { "ignores": [ diff --git a/test/workspace-without-gitignore.test.ts b/test/workspace-without-gitignore.test.ts index 33d0328..dbfc040 100644 --- a/test/workspace-without-gitignore.test.ts +++ b/test/workspace-without-gitignore.test.ts @@ -39,12 +39,12 @@ describe('should execute tests in test/workspace-without-gitignore', () => { }) it('strict (default) throw', () => { - expect(() => ignore({ files: 'not-exists', fallbackToRoot: false })) + expect(() => ignore({ files: 'not-exists', root: true })) .toThrow() }) it('not strict skip missing file', () => { - expect(ignore({ files: 'not-exists', strict: false, fallbackToRoot: false })) + expect(ignore({ files: 'not-exists', strict: false, root: true })) .toMatchInlineSnapshot(` { "ignores": [], @@ -53,12 +53,12 @@ describe('should execute tests in test/workspace-without-gitignore', () => { }) it('dont fallback to root, strict and throw error', () => { - expect(() => ignore({ fallbackToRoot: false })) + expect(() => ignore({ root: true })) .toThrow() }) it('dont fallback to root, no strict and return empty array', () => { - expect(ignore({ strict: false, fallbackToRoot: false })) + expect(ignore({ strict: false, root: true })) .toMatchInlineSnapshot(` { "ignores": [],