Skip to content

fix(core): fix bug loading of .redocly.lint-ignore.yaml in browser environments - #2489

Merged
kanoru3101 merged 40 commits into
mainfrom
fix/ignore-file-for-browser
Jan 21, 2026
Merged

fix(core): fix bug loading of .redocly.lint-ignore.yaml in browser environments#2489
kanoru3101 merged 40 commits into
mainfrom
fix/ignore-file-for-browser

Conversation

@kanoru3101

@kanoru3101 kanoru3101 commented Jan 7, 2026

Copy link
Copy Markdown
Contributor

What/Why/How?

Fixed loading of .redocly.lint-ignore.yaml in browser environments (Reunite).

Reference

#86
Related PR

Testing

Screenshots (optional)

Check yourself

  • Code changed? - Tested with Redoc/Realm/Reunite (internal)
  • All new/updated code is covered by tests
  • New package installed? - Tested in different environments (browser/node)
  • Documentation update considered

Security

  • The security impact of the change has been considered
  • Code follows company security practices and guidelines

@changeset-bot

changeset-bot Bot commented Jan 7, 2026

Copy link
Copy Markdown

🦋 Changeset detected

Latest commit: 876d5ec

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 3 packages
Name Type
@redocly/openapi-core Patch
@redocly/cli Patch
@redocly/respect-core Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@kanoru3101 kanoru3101 self-assigned this Jan 7, 2026
@github-actions

github-actions Bot commented Jan 7, 2026

Copy link
Copy Markdown
Contributor

Coverage Report

Status Category Percentage Covered / Total
🔵 Lines 78.6% (🎯 78%) 6203 / 7891
🔵 Statements 78.03% (🎯 78%) 6408 / 8212
🔵 Functions 81.98% (🎯 81%) 1265 / 1543
🔵 Branches 70.39% (🎯 70%) 4256 / 6046
File Coverage
File Stmts Branches Functions Lines Uncovered Lines
Changed Files
packages/core/src/ref-utils.ts 90% 97.72% 94.73% 91.66% 10, 51, 75-76
packages/core/src/config/config.ts 65.07% 65.94% 77.5% 65.68% 190-214, 240, 244, 248-266, 298, 316-336, 415-445
packages/core/src/config/load.ts 87.5% 69.56% 100% 90.32% 34, 59, 83, 126
Generated in workflow #8370 for commit 876d5ec by the Vitest Coverage Report Action

@github-actions

github-actions Bot commented Jan 7, 2026

Copy link
Copy Markdown
Contributor
CLI Version Mean Time ± Std Dev (s) Relative Performance (Lower is Faster)
cli-latest 3.415s ± 0.032s ▓ 1.00x (Fastest)
cli-next 3.450s ± 0.032s ▓ 1.01x

@kanoru3101 kanoru3101 added the snapshot Create experimental release PR label Jan 7, 2026
@github-actions

github-actions Bot commented Jan 7, 2026

Copy link
Copy Markdown
Contributor

📦 A new experimental 🧪 version v0.0.0-snapshot.1767804621 of Redocly CLI has been published for testing.

Install with NPM:

npm install @redocly/cli@0.0.0-snapshot.1767804621
# or
npm install @redocly/openapi-core@0.0.0-snapshot.1767804621
# or
npm install @redocly/respect-core@0.0.0-snapshot.1767804621

⚠️ Note: This is a development build and may contain unstable features.

@kanoru3101 kanoru3101 added snapshot Create experimental release PR and removed snapshot Create experimental release PR labels Jan 7, 2026
@github-actions

github-actions Bot commented Jan 7, 2026

Copy link
Copy Markdown
Contributor

📦 A new experimental 🧪 version v0.0.0-snapshot.1767807792 of Redocly CLI has been published for testing.

Install with NPM:

npm install @redocly/cli@0.0.0-snapshot.1767807792
# or
npm install @redocly/openapi-core@0.0.0-snapshot.1767807792
# or
npm install @redocly/respect-core@0.0.0-snapshot.1767807792

⚠️ Note: This is a development build and may contain unstable features.

@kanoru3101 kanoru3101 added snapshot Create experimental release PR and removed snapshot Create experimental release PR labels Jan 8, 2026
@github-actions

github-actions Bot commented Jan 8, 2026

Copy link
Copy Markdown
Contributor

📦 A new experimental 🧪 version v0.0.0-snapshot.1767866050 of Redocly CLI has been published for testing.

Install with NPM:

npm install @redocly/cli@0.0.0-snapshot.1767866050
# or
npm install @redocly/openapi-core@0.0.0-snapshot.1767866050
# or
npm install @redocly/respect-core@0.0.0-snapshot.1767866050

⚠️ Note: This is a development build and may contain unstable features.

@kanoru3101 kanoru3101 added snapshot Create experimental release PR and removed snapshot Create experimental release PR labels Jan 8, 2026
@github-actions

github-actions Bot commented Jan 8, 2026

Copy link
Copy Markdown
Contributor

📦 A new experimental 🧪 version v0.0.0-snapshot.1767870619 of Redocly CLI has been published for testing.

Install with NPM:

npm install @redocly/cli@0.0.0-snapshot.1767870619
# or
npm install @redocly/openapi-core@0.0.0-snapshot.1767870619
# or
npm install @redocly/respect-core@0.0.0-snapshot.1767870619

⚠️ Note: This is a development build and may contain unstable features.

@kanoru3101 kanoru3101 added snapshot Create experimental release PR and removed snapshot Create experimental release PR labels Jan 8, 2026
@github-actions

github-actions Bot commented Jan 8, 2026

Copy link
Copy Markdown
Contributor

📦 A new experimental 🧪 version v0.0.0-snapshot.1767871282 of Redocly CLI has been published for testing.

Install with NPM:

npm install @redocly/cli@0.0.0-snapshot.1767871282
# or
npm install @redocly/openapi-core@0.0.0-snapshot.1767871282
# or
npm install @redocly/respect-core@0.0.0-snapshot.1767871282

⚠️ Note: This is a development build and may contain unstable features.

@kanoru3101 kanoru3101 added snapshot Create experimental release PR and removed snapshot Create experimental release PR labels Jan 8, 2026
@github-actions

github-actions Bot commented Jan 8, 2026

Copy link
Copy Markdown
Contributor

📦 A new experimental 🧪 version v0.0.0-snapshot.1767882364 of Redocly CLI has been published for testing.

Install with NPM:

npm install @redocly/cli@0.0.0-snapshot.1767882364
# or
npm install @redocly/openapi-core@0.0.0-snapshot.1767882364
# or
npm install @redocly/respect-core@0.0.0-snapshot.1767882364

⚠️ Note: This is a development build and may contain unstable features.

@kanoru3101 kanoru3101 changed the title fix: update lint-ignore logic fix(core): update lint-ignore logic for reunite Jan 8, 2026
@kanoru3101 kanoru3101 changed the title fix(core): update lint-ignore logic for reunite fix(core): update loading of .redocly.lint-ignore.yaml in browser environments Jan 8, 2026
@kanoru3101 kanoru3101 added snapshot Create experimental release PR and removed snapshot Create experimental release PR labels Jan 19, 2026
@github-actions

Copy link
Copy Markdown
Contributor

📦 A new experimental 🧪 version v0.0.0-snapshot.1768846401 of Redocly CLI has been published for testing.

Install with NPM:

npm install @redocly/cli@0.0.0-snapshot.1768846401
# or
npm install @redocly/openapi-core@0.0.0-snapshot.1768846401
# or
npm install @redocly/respect-core@0.0.0-snapshot.1768846401

⚠️ Note: This is a development build and may contain unstable features.

Comment thread packages/core/src/config/config.ts Outdated
Comment thread packages/core/src/config/config.ts Outdated
import { specVersions } from '../detect-spec.js';
import { getResolveConfig } from './get-resolve-config.js';
import { isAbsoluteUrl } from '../ref-utils.js';
import { isAbsoluteUrl, isAbsoluteUrlOrFileUrl, resolvePath } from '../ref-utils.js';

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we need both isAbsoluteUrl and isAbsoluteUrlOrFileUrl?
Could you check if one of them is redundant?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I moved the logic from isAbsoluteUrlOrFileUrl to isAbsoluteUrl, and it seems to work fine. Tested on Reunite, VSCE (also Windows), and ran tests on CLI

Comment thread packages/core/src/config/config.ts Outdated
ignore: Record<string, Record<string, string[]>>,
ignorePath: string
): Record<string, Record<string, Set<string>>> {
const adapted = Object.create(null) as Record<string, Record<string, Set<string>>>;

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why not just empty object literal?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

github-advanced-security says that is Prototype-polluting assignment and better use for this case Object.create(null) instead {}

Comment thread packages/core/src/config/config.ts Outdated
Comment thread packages/core/src/config/config.ts Outdated
Comment thread packages/core/src/config/load.ts Outdated
Comment thread packages/core/src/config/load.ts Outdated
@kanoru3101 kanoru3101 added snapshot Create experimental release PR and removed snapshot Create experimental release PR labels Jan 20, 2026
@github-actions

Copy link
Copy Markdown
Contributor

📦 A new experimental 🧪 version v0.0.0-snapshot.1768930882 of Redocly CLI has been published for testing.

Install with NPM:

npm install @redocly/cli@0.0.0-snapshot.1768930882
# or
npm install @redocly/openapi-core@0.0.0-snapshot.1768930882
# or
npm install @redocly/respect-core@0.0.0-snapshot.1768930882

⚠️ Note: This is a development build and may contain unstable features.

@kanoru3101
kanoru3101 requested a review from tatomyr January 20, 2026 19:41
export { Stats } from './rules/other/stats.js';
export {
loadConfig,
loadIgnoreFile,

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we reuse it somewhere else?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In the language server, it should be added that ignoring works when there is no redocly.yaml.

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Strange, I thought it should just work automatically when using loadCogfig. Let's discuss that.

@kanoru3101 kanoru3101 Jan 21, 2026

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is used in language-server to create a default configuration when we don't have redocly.yaml. There, we use createConfig and must send the result of loadIgnoreFile to createConfig; if we don't, the ignore file will not work.

Comment thread packages/core/src/config/load.ts Outdated
Comment thread packages/core/src/config/config.ts Outdated
@kanoru3101 kanoru3101 added snapshot Create experimental release PR and removed snapshot Create experimental release PR labels Jan 21, 2026
@github-actions

Copy link
Copy Markdown
Contributor

📦 A new experimental 🧪 version v0.0.0-snapshot.1768998038 of Redocly CLI has been published for testing.

Install with NPM:

npm install @redocly/cli@0.0.0-snapshot.1768998038
# or
npm install @redocly/openapi-core@0.0.0-snapshot.1768998038
# or
npm install @redocly/respect-core@0.0.0-snapshot.1768998038

⚠️ Note: This is a development build and may contain unstable features.

@kanoru3101 kanoru3101 added snapshot Create experimental release PR and removed snapshot Create experimental release PR labels Jan 21, 2026
@github-actions

Copy link
Copy Markdown
Contributor

📦 A new experimental 🧪 version v0.0.0-snapshot.1769001200 of Redocly CLI has been published for testing.

Install with NPM:

npm install @redocly/cli@0.0.0-snapshot.1769001200
# or
npm install @redocly/openapi-core@0.0.0-snapshot.1769001200
# or
npm install @redocly/respect-core@0.0.0-snapshot.1769001200

⚠️ Note: This is a development build and may contain unstable features.

@kanoru3101
kanoru3101 requested a review from tatomyr January 21, 2026 13:38

@tatomyr tatomyr left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Left a minor comment. Otherwise looks good.

Comment thread packages/core/src/config/config.ts Outdated
@kanoru3101 kanoru3101 added snapshot Create experimental release PR and removed snapshot Create experimental release PR labels Jan 21, 2026
@github-actions

Copy link
Copy Markdown
Contributor

📦 A new experimental 🧪 version v0.0.0-snapshot.1769016804 of Redocly CLI has been published for testing.

Install with NPM:

npm install @redocly/cli@0.0.0-snapshot.1769016804
# or
npm install @redocly/openapi-core@0.0.0-snapshot.1769016804
# or
npm install @redocly/respect-core@0.0.0-snapshot.1769016804

⚠️ Note: This is a development build and may contain unstable features.

@kanoru3101
kanoru3101 merged commit 3d3794a into main Jan 21, 2026
47 checks passed
@kanoru3101
kanoru3101 deleted the fix/ignore-file-for-browser branch January 21, 2026 18:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

snapshot Create experimental release PR

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants