From 3b594ddf0b91ffd3e0a7a20e7c2059c1136e9367 Mon Sep 17 00:00:00 2001 From: Harshit Singh Date: Fri, 3 Apr 2026 17:53:40 +0530 Subject: [PATCH 01/12] fix: enhance linting process to preserve existing files --- .../cli/src/__tests__/commands/lint.test.ts | 23 +++++++++++- packages/cli/src/commands/lint.ts | 35 +++++++++++++------ 2 files changed, 47 insertions(+), 11 deletions(-) diff --git a/packages/cli/src/__tests__/commands/lint.test.ts b/packages/cli/src/__tests__/commands/lint.test.ts index f91469d653..8fa2f8c9e8 100644 --- a/packages/cli/src/__tests__/commands/lint.test.ts +++ b/packages/cli/src/__tests__/commands/lint.test.ts @@ -114,7 +114,7 @@ describe('handleLint', () => { ); }); - it('should call mergedConfig with clear ignore if `generate-ignore-file` argv', async () => { + it('should call forAlias when `generate-ignore-file` argv is set', async () => { await commandWrapper(handleLint)({ ...argvMock, 'generate-ignore-file': true }); expect(configFixture.forAlias).toHaveBeenCalledWith(undefined); }); @@ -151,6 +151,27 @@ describe('handleLint', () => { expect(configFixture.skipPreprocessors).toHaveBeenCalledWith(['preprocessor']); }); + it('should preserve existing ignore entries for unrelated files when `generate-ignore-file` is used', async () => { + const otherFileAbsRef = '/some/other/api.yaml'; + configFixture.ignore = { + [otherFileAbsRef]: { 'some-rule': new Set(['#/paths/~1foo']) }, + }; + vi.mocked(lint).mockResolvedValueOnce([ + { + ruleId: 'operation-operationId', + severity: 1, + message: 'Missing operationId', + location: [ + { source: { absoluteRef: '/absolute/openapi.yaml' }, pointer: '#/paths/~1bar' }, + ], + suggest: [], + ignored: false, + } as any, + ]); + await commandWrapper(handleLint)({ ...argvMock, 'generate-ignore-file': true }); + expect(configFixture.ignore[otherFileAbsRef]).toBeDefined(); + }); + it('should call formatProblems and getExecutionTime with argv', async () => { vi.mocked(lint).mockResolvedValueOnce(['problem'] as any); await commandWrapper(handleLint)({ ...argvMock, 'max-problems': 2, format: 'stylish' }); diff --git a/packages/cli/src/commands/lint.ts b/packages/cli/src/commands/lint.ts index 1ecf062c03..1d3839a7eb 100644 --- a/packages/cli/src/commands/lint.ts +++ b/packages/cli/src/commands/lint.ts @@ -1,6 +1,7 @@ import { formatProblems, getTotals, + isAbsoluteUrl, lint, lintConfig, pluralize, @@ -8,9 +9,11 @@ import { logger, type Config, type Exact, + type NormalizedProblem, type OutputFormat, } from '@redocly/openapi-core'; import { blue, gray } from 'colorette'; +import { resolve as resolvePath } from 'node:path'; import { performance } from 'perf_hooks'; import type { Arguments } from 'yargs'; @@ -51,14 +54,13 @@ export async function handleLint({ exitWithError('No APIs were provided.'); } - if (argv['generate-ignore-file']) { - config.ignore = {}; // clear ignore - } const totals: Totals = { errors: 0, warnings: 0, ignored: 0 }; let totalIgnored = 0; + const ignoreFileResults: NormalizedProblem[] = []; + const lintedAbsRefs = new Set(); // TODO: use shared externalRef resolver, blocked by preprocessors now as they can mutate documents - for (const { path, alias } of apis) { + for (const { path: apiPath, alias } of apis) { try { const startedAt = performance.now(); const aliasConfig = config.forAlias(alias); @@ -76,15 +78,15 @@ export async function handleLint({ ); } if (alias === undefined) { - logger.info(gray(`validating ${formatPath(path)}...\n`)); + logger.info(gray(`validating ${formatPath(apiPath)}...\n`)); } else { logger.info( - gray(`validating ${formatPath(path)} using lint rules for api '${alias}'...\n`) + gray(`validating ${formatPath(apiPath)} using lint rules for api '${alias}'...\n`) ); } const results = await lint({ - ref: path, + ref: apiPath, config: aliasConfig, collectSpecData, }); @@ -95,8 +97,9 @@ export async function handleLint({ totals.ignored += fileTotals.ignored; if (argv['generate-ignore-file']) { + lintedAbsRefs.add(isAbsoluteUrl(apiPath) ? apiPath : resolvePath(apiPath)); for (const m of results) { - config.addIgnore(m); + ignoreFileResults.push(m); totalIgnored++; } } else { @@ -110,13 +113,25 @@ export async function handleLint({ } const elapsed = getExecutionTime(startedAt); - logger.info(gray(`${formatPath(path)}: validated in ${elapsed}\n\n`)); + logger.info(gray(`${formatPath(apiPath)}: validated in ${elapsed}\n\n`)); } catch (e) { - handleError(e, path); + handleError(e, apiPath); } } if (argv['generate-ignore-file']) { + for (const m of ignoreFileResults) { + const loc = m.location?.[0]; + if (loc?.pointer !== undefined) { + lintedAbsRefs.add(loc.source.absoluteRef); + } + } + for (const absRef of lintedAbsRefs) { + delete config.ignore[absRef]; + } + for (const m of ignoreFileResults) { + config.addIgnore(m); + } config.saveIgnore(); logger.info( `Generated ignore file with ${totalIgnored} ${pluralize('problem', totalIgnored)}.\n\n` From 03cddeda329a116f39c86357eb7bec6ad70a0771 Mon Sep 17 00:00:00 2001 From: Harshit Singh Date: Mon, 6 Apr 2026 16:04:39 +0530 Subject: [PATCH 02/12] feat: address comment and added test for one file --- .../cli/src/__tests__/commands/lint.test.ts | 53 +++++++++++++++---- 1 file changed, 43 insertions(+), 10 deletions(-) diff --git a/packages/cli/src/__tests__/commands/lint.test.ts b/packages/cli/src/__tests__/commands/lint.test.ts index 8fa2f8c9e8..4ba3fee5d0 100644 --- a/packages/cli/src/__tests__/commands/lint.test.ts +++ b/packages/cli/src/__tests__/commands/lint.test.ts @@ -8,6 +8,7 @@ import { loadConfig, } from '@redocly/openapi-core'; import { blue } from 'colorette'; +import { resolve } from 'node:path'; import { performance } from 'perf_hooks'; import { type MockInstance } from 'vitest'; import { type Arguments } from 'yargs'; @@ -151,25 +152,57 @@ describe('handleLint', () => { expect(configFixture.skipPreprocessors).toHaveBeenCalledWith(['preprocessor']); }); - it('should preserve existing ignore entries for unrelated files when `generate-ignore-file` is used', async () => { - const otherFileAbsRef = '/some/other/api.yaml'; + it('should update only the linted file entries and preserve ignore entries for other files', async () => { + const barAbsRef = resolve('ignore-bar.yaml'); + const fooAbsRef = resolve('ignore-foo.yaml'); + configFixture.ignore = { - [otherFileAbsRef]: { 'some-rule': new Set(['#/paths/~1foo']) }, + [barAbsRef]: { + 'no-empty-servers': new Set(['#/servers']), + 'operation-summary': new Set(['#/paths/~1items/get/summary']), + }, + [fooAbsRef]: { + 'no-empty-servers': new Set(['#/servers']), + }, }; + + vi.mocked(configFixture.addIgnore).mockImplementation((problem: any) => { + const loc = problem.location[0]; + if (loc.pointer === undefined) return; + const fileIgnore = (configFixture.ignore[loc.source.absoluteRef] = + configFixture.ignore[loc.source.absoluteRef] || {}); + const ruleIgnore = (fileIgnore[problem.ruleId] = fileIgnore[problem.ruleId] || new Set()); + ruleIgnore.add(loc.pointer); + }); + vi.mocked(lint).mockResolvedValueOnce([ { - ruleId: 'operation-operationId', + ruleId: 'no-empty-servers', severity: 1, - message: 'Missing operationId', - location: [ - { source: { absoluteRef: '/absolute/openapi.yaml' }, pointer: '#/paths/~1bar' }, - ], + message: 'Servers must not be empty', + location: [{ source: { absoluteRef: barAbsRef }, pointer: '#/servers' }], suggest: [], ignored: false, } as any, ]); - await commandWrapper(handleLint)({ ...argvMock, 'generate-ignore-file': true }); - expect(configFixture.ignore[otherFileAbsRef]).toBeDefined(); + + await commandWrapper(handleLint)({ + ...argvMock, + apis: ['ignore-bar.yaml'], + 'generate-ignore-file': true, + }); + + expect(configFixture.ignore[fooAbsRef]).toEqual({ + 'no-empty-servers': new Set(['#/servers']), + }); + + expect(configFixture.ignore[barAbsRef]).toEqual({ + 'no-empty-servers': new Set(['#/servers']), + }); + + expect(configFixture.saveIgnore).toHaveBeenCalled(); + + configFixture.ignore = {}; }); it('should call formatProblems and getExecutionTime with argv', async () => { From 14a60257215b216ad46f12f3076154d87f082a5c Mon Sep 17 00:00:00 2001 From: Harshit Singh Date: Mon, 6 Apr 2026 18:50:36 +0530 Subject: [PATCH 03/12] fix: added changeset and fix failing test --- .changeset/rotten-wombats-cry.md | 5 +++++ 1 file changed, 5 insertions(+) create mode 100644 .changeset/rotten-wombats-cry.md diff --git a/.changeset/rotten-wombats-cry.md b/.changeset/rotten-wombats-cry.md new file mode 100644 index 0000000000..62aa0f2338 --- /dev/null +++ b/.changeset/rotten-wombats-cry.md @@ -0,0 +1,5 @@ +--- +"@redocly/cli": major +--- + +redocly lint api1.yaml --generate-ignore-file updates only entries related to api1.yaml and its referenced files From 5533608519cb82cb6644d7ad81c64b25ab2dc4e3 Mon Sep 17 00:00:00 2001 From: Harshit Singh Date: Mon, 6 Apr 2026 21:59:40 +0530 Subject: [PATCH 04/12] fix: address comments and simplify logic --- packages/cli/src/commands/lint.ts | 24 ++++-------------------- 1 file changed, 4 insertions(+), 20 deletions(-) diff --git a/packages/cli/src/commands/lint.ts b/packages/cli/src/commands/lint.ts index 1d3839a7eb..5aefb8e6ae 100644 --- a/packages/cli/src/commands/lint.ts +++ b/packages/cli/src/commands/lint.ts @@ -9,7 +9,6 @@ import { logger, type Config, type Exact, - type NormalizedProblem, type OutputFormat, } from '@redocly/openapi-core'; import { blue, gray } from 'colorette'; @@ -56,8 +55,6 @@ export async function handleLint({ const totals: Totals = { errors: 0, warnings: 0, ignored: 0 }; let totalIgnored = 0; - const ignoreFileResults: NormalizedProblem[] = []; - const lintedAbsRefs = new Set(); // TODO: use shared externalRef resolver, blocked by preprocessors now as they can mutate documents for (const { path: apiPath, alias } of apis) { @@ -97,9 +94,10 @@ export async function handleLint({ totals.ignored += fileTotals.ignored; if (argv['generate-ignore-file']) { - lintedAbsRefs.add(isAbsoluteUrl(apiPath) ? apiPath : resolvePath(apiPath)); + const apiAbsRef = isAbsoluteUrl(apiPath) ? apiPath : resolvePath(apiPath); + delete config.ignore[apiAbsRef]; for (const m of results) { - ignoreFileResults.push(m); + config.addIgnore(m); totalIgnored++; } } else { @@ -120,22 +118,8 @@ export async function handleLint({ } if (argv['generate-ignore-file']) { - for (const m of ignoreFileResults) { - const loc = m.location?.[0]; - if (loc?.pointer !== undefined) { - lintedAbsRefs.add(loc.source.absoluteRef); - } - } - for (const absRef of lintedAbsRefs) { - delete config.ignore[absRef]; - } - for (const m of ignoreFileResults) { - config.addIgnore(m); - } config.saveIgnore(); - logger.info( - `Generated ignore file with ${totalIgnored} ${pluralize('problem', totalIgnored)}.\n\n` - ); + logger.info(`Explicitly ignored ${totalIgnored} ${pluralize('problem', totalIgnored)}.\n\n`); } else { printLintTotals(totals, apis.length); } From 5946b8bc8db4f348fb12d215df676278e51c61f7 Mon Sep 17 00:00:00 2001 From: Harshit Singh Date: Mon, 6 Apr 2026 22:28:37 +0530 Subject: [PATCH 05/12] fix: changeset to minor --- .changeset/rotten-wombats-cry.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.changeset/rotten-wombats-cry.md b/.changeset/rotten-wombats-cry.md index 62aa0f2338..8e017df896 100644 --- a/.changeset/rotten-wombats-cry.md +++ b/.changeset/rotten-wombats-cry.md @@ -1,5 +1,5 @@ --- -"@redocly/cli": major +"@redocly/cli": minor --- redocly lint api1.yaml --generate-ignore-file updates only entries related to api1.yaml and its referenced files From c47dc8f364db0968bde8beca84be067215d4c6d1 Mon Sep 17 00:00:00 2001 From: Harshit Singh Date: Tue, 7 Apr 2026 14:48:23 +0530 Subject: [PATCH 06/12] fix: apply suggestion by comment left --- .changeset/rotten-wombats-cry.md | 2 +- packages/cli/src/commands/lint.ts | 16 ++++++++-------- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/.changeset/rotten-wombats-cry.md b/.changeset/rotten-wombats-cry.md index 8e017df896..c6561b2702 100644 --- a/.changeset/rotten-wombats-cry.md +++ b/.changeset/rotten-wombats-cry.md @@ -2,4 +2,4 @@ "@redocly/cli": minor --- -redocly lint api1.yaml --generate-ignore-file updates only entries related to api1.yaml and its referenced files +Changed lint behavior with the `--generate-ignore-file` option — now it updates only the entries related to the file being linted, leaving other files' entries untouched. diff --git a/packages/cli/src/commands/lint.ts b/packages/cli/src/commands/lint.ts index 5aefb8e6ae..4fbd2e5268 100644 --- a/packages/cli/src/commands/lint.ts +++ b/packages/cli/src/commands/lint.ts @@ -12,7 +12,7 @@ import { type OutputFormat, } from '@redocly/openapi-core'; import { blue, gray } from 'colorette'; -import { resolve as resolvePath } from 'node:path'; +import { resolve } from 'node:path'; import { performance } from 'perf_hooks'; import type { Arguments } from 'yargs'; @@ -57,7 +57,7 @@ export async function handleLint({ let totalIgnored = 0; // TODO: use shared externalRef resolver, blocked by preprocessors now as they can mutate documents - for (const { path: apiPath, alias } of apis) { + for (const { path, alias } of apis) { try { const startedAt = performance.now(); const aliasConfig = config.forAlias(alias); @@ -75,15 +75,15 @@ export async function handleLint({ ); } if (alias === undefined) { - logger.info(gray(`validating ${formatPath(apiPath)}...\n`)); + logger.info(gray(`validating ${formatPath(path)}...\n`)); } else { logger.info( - gray(`validating ${formatPath(apiPath)} using lint rules for api '${alias}'...\n`) + gray(`validating ${formatPath(path)} using lint rules for api '${alias}'...\n`) ); } const results = await lint({ - ref: apiPath, + ref: path, config: aliasConfig, collectSpecData, }); @@ -94,7 +94,7 @@ export async function handleLint({ totals.ignored += fileTotals.ignored; if (argv['generate-ignore-file']) { - const apiAbsRef = isAbsoluteUrl(apiPath) ? apiPath : resolvePath(apiPath); + const apiAbsRef = isAbsoluteUrl(path) ? path : resolve(path); delete config.ignore[apiAbsRef]; for (const m of results) { config.addIgnore(m); @@ -111,9 +111,9 @@ export async function handleLint({ } const elapsed = getExecutionTime(startedAt); - logger.info(gray(`${formatPath(apiPath)}: validated in ${elapsed}\n\n`)); + logger.info(gray(`${formatPath(path)}: validated in ${elapsed}\n\n`)); } catch (e) { - handleError(e, apiPath); + handleError(e, path); } } From f753a2a59492c2845597fa612c75ee299a12a17a Mon Sep 17 00:00:00 2001 From: Harshit Singh Date: Tue, 7 Apr 2026 15:01:58 +0530 Subject: [PATCH 07/12] fix: shift logic to config --- packages/cli/src/commands/lint.ts | 5 +---- packages/core/src/config/config.ts | 6 ++++++ 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/packages/cli/src/commands/lint.ts b/packages/cli/src/commands/lint.ts index 4fbd2e5268..d0dc4a5c63 100644 --- a/packages/cli/src/commands/lint.ts +++ b/packages/cli/src/commands/lint.ts @@ -1,7 +1,6 @@ import { formatProblems, getTotals, - isAbsoluteUrl, lint, lintConfig, pluralize, @@ -12,7 +11,6 @@ import { type OutputFormat, } from '@redocly/openapi-core'; import { blue, gray } from 'colorette'; -import { resolve } from 'node:path'; import { performance } from 'perf_hooks'; import type { Arguments } from 'yargs'; @@ -94,8 +92,7 @@ export async function handleLint({ totals.ignored += fileTotals.ignored; if (argv['generate-ignore-file']) { - const apiAbsRef = isAbsoluteUrl(path) ? path : resolve(path); - delete config.ignore[apiAbsRef]; + config.clearIgnoreForRef(path); for (const m of results) { config.addIgnore(m); totalIgnored++; diff --git a/packages/core/src/config/config.ts b/packages/core/src/config/config.ts index 837525353f..7ef6647bbe 100755 --- a/packages/core/src/config/config.ts +++ b/packages/core/src/config/config.ts @@ -166,6 +166,12 @@ export class Config { ); } + clearIgnoreForRef(ref: string) { + const dir = this.configPath ? path.dirname(this.configPath) : process.cwd(); + const absRef = isAbsoluteUrl(ref) ? ref : path.resolve(dir, ref); + delete this.ignore[absRef]; + } + saveIgnore() { const dir = this.configPath ? path.dirname(this.configPath) : process.cwd(); const ignoreFile = path.join(dir, IGNORE_FILE); From c0a229d31835bc3a7bf496d917b2192b3ada3a4c Mon Sep 17 00:00:00 2001 From: Harshit Singh Date: Tue, 7 Apr 2026 15:52:13 +0530 Subject: [PATCH 08/12] fix: updated commands docs --- docs/@v2/commands/lint.md | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/docs/@v2/commands/lint.md b/docs/@v2/commands/lint.md index 0135402116..dcbf109f79 100644 --- a/docs/@v2/commands/lint.md +++ b/docs/@v2/commands/lint.md @@ -352,7 +352,7 @@ This option is useful when you have an API design standard, but have some except It allows for highly granular control. {% admonition type="warning" %} -This command overwrites an existing ignore file. +This command updates ignore entries only for the API descriptions passed to the command. Existing entries for other API descriptions are preserved. {% /admonition %} The following command runs `lint` and adds all the errors to an ignore file: @@ -369,6 +369,14 @@ Generated ignore file with 3 problems. The errors in the ignore file `.redocly.lint-ignore.yaml` are ignored when the `lint` command is run. +if you run: + +```bash +redocly lint api1.yaml --generate-ignore-file +``` + +only ignore entries related to `api1.yaml` are updated. Ignore entries for other API descriptions remain unchanged. + To generate an ignore file for multiple API descriptions, pass them as arguments: ```bash From 4d84631099df6d511dbb51b57d56997b52624399 Mon Sep 17 00:00:00 2001 From: Harshit Singh Date: Wed, 8 Apr 2026 13:17:51 +0530 Subject: [PATCH 09/12] fix: failing typecheck test --- packages/cli/src/__tests__/fixtures/config.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/cli/src/__tests__/fixtures/config.ts b/packages/cli/src/__tests__/fixtures/config.ts index bf22eaa163..2611e20238 100644 --- a/packages/cli/src/__tests__/fixtures/config.ts +++ b/packages/cli/src/__tests__/fixtures/config.ts @@ -11,6 +11,7 @@ export const configFixture: Config = { }, configPath: undefined, addIgnore: vi.fn(), + clearIgnoreForRef: vi.fn(), skipRules: vi.fn(), skipPreprocessors: vi.fn(), saveIgnore: vi.fn(), From 18b1e453665fc231e4861f282669b42f97c1a1be Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jacek=20=C5=81=C4=99kawa?= <164185257+JLekawa@users.noreply.github.com> Date: Wed, 8 Apr 2026 12:53:11 +0200 Subject: [PATCH 10/12] Apply suggestions from code review MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Jacek Łękawa <164185257+JLekawa@users.noreply.github.com> --- .changeset/rotten-wombats-cry.md | 4 +++- docs/@v2/commands/lint.md | 10 +++------- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/.changeset/rotten-wombats-cry.md b/.changeset/rotten-wombats-cry.md index c6561b2702..d9817fbace 100644 --- a/.changeset/rotten-wombats-cry.md +++ b/.changeset/rotten-wombats-cry.md @@ -2,4 +2,6 @@ "@redocly/cli": minor --- -Changed lint behavior with the `--generate-ignore-file` option — now it updates only the entries related to the file being linted, leaving other files' entries untouched. +Changed `lint` behavior with the `--generate-ignore-file` option. +Now `lint` updates only the entries related to the file being linted. +Other files' entries are unchanged. diff --git a/docs/@v2/commands/lint.md b/docs/@v2/commands/lint.md index dcbf109f79..7a5c4fa693 100644 --- a/docs/@v2/commands/lint.md +++ b/docs/@v2/commands/lint.md @@ -352,7 +352,8 @@ This option is useful when you have an API design standard, but have some except It allows for highly granular control. {% admonition type="warning" %} -This command updates ignore entries only for the API descriptions passed to the command. Existing entries for other API descriptions are preserved. +This command updates ignore entries only for the API descriptions passed to the command. +Existing entries for other API descriptions are preserved. {% /admonition %} The following command runs `lint` and adds all the errors to an ignore file: @@ -369,13 +370,8 @@ Generated ignore file with 3 problems. The errors in the ignore file `.redocly.lint-ignore.yaml` are ignored when the `lint` command is run. -if you run: +If you run: -```bash -redocly lint api1.yaml --generate-ignore-file -``` - -only ignore entries related to `api1.yaml` are updated. Ignore entries for other API descriptions remain unchanged. To generate an ignore file for multiple API descriptions, pass them as arguments: From 034532a1d6a6217b8dfbd2685f932c80028ea2c2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jacek=20=C5=81=C4=99kawa?= <164185257+JLekawa@users.noreply.github.com> Date: Wed, 8 Apr 2026 14:41:09 +0200 Subject: [PATCH 11/12] Update lint.md --- docs/@v2/commands/lint.md | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/docs/@v2/commands/lint.md b/docs/@v2/commands/lint.md index 7a5c4fa693..5dd93dc239 100644 --- a/docs/@v2/commands/lint.md +++ b/docs/@v2/commands/lint.md @@ -372,6 +372,12 @@ The errors in the ignore file `.redocly.lint-ignore.yaml` are ignored when the ` If you run: +```bash +redocly lint api1.yaml --generate-ignore-file +``` + +Only the ignore entries related to api1.yaml are updated. +Ignore entries for other API descriptions remain unchanged. To generate an ignore file for multiple API descriptions, pass them as arguments: From c7cad69fb1d23f9e15e92163a74c06a4818599a2 Mon Sep 17 00:00:00 2001 From: Harshit Singh Date: Wed, 8 Apr 2026 21:25:06 +0530 Subject: [PATCH 12/12] fix: Failing test --- packages/cli/src/__tests__/commands/lint.test.ts | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/packages/cli/src/__tests__/commands/lint.test.ts b/packages/cli/src/__tests__/commands/lint.test.ts index 4ba3fee5d0..1106f38f0a 100644 --- a/packages/cli/src/__tests__/commands/lint.test.ts +++ b/packages/cli/src/__tests__/commands/lint.test.ts @@ -166,6 +166,11 @@ describe('handleLint', () => { }, }; + vi.mocked(configFixture.clearIgnoreForRef).mockImplementation((ref: string) => { + const absRef = resolve(ref); + delete configFixture.ignore[absRef]; + }); + vi.mocked(configFixture.addIgnore).mockImplementation((problem: any) => { const loc = problem.location[0]; if (loc.pointer === undefined) return;