fix(core): fix bug loading of .redocly.lint-ignore.yaml in browser environments - #2489
Conversation
🦋 Changeset detectedLatest commit: 876d5ec The changes in this PR will be included in the next version bump. This PR includes changesets to release 3 packages
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 |
Coverage Report
File Coverage
|
||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
📦 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 |
|
📦 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 |
|
📦 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 |
|
📦 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 |
|
📦 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 |
|
📦 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 |
.redocly.lint-ignore.yaml in browser environments
|
📦 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 |
| 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'; |
There was a problem hiding this comment.
Do we need both isAbsoluteUrl and isAbsoluteUrlOrFileUrl?
Could you check if one of them is redundant?
There was a problem hiding this comment.
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
| 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>>>; |
There was a problem hiding this comment.
Why not just empty object literal?
There was a problem hiding this comment.
github-advanced-security says that is Prototype-polluting assignment and better use for this case Object.create(null) instead {}
|
📦 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 |
| export { Stats } from './rules/other/stats.js'; | ||
| export { | ||
| loadConfig, | ||
| loadIgnoreFile, |
There was a problem hiding this comment.
Do we reuse it somewhere else?
There was a problem hiding this comment.
In the language server, it should be added that ignoring works when there is no redocly.yaml.
There was a problem hiding this comment.
Strange, I thought it should just work automatically when using loadCogfig. Let's discuss that.
There was a problem hiding this comment.
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.
|
📦 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 |
|
📦 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 |
tatomyr
left a comment
There was a problem hiding this comment.
Left a minor comment. Otherwise looks good.
|
📦 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 |
What/Why/How?
Fixed loading of
.redocly.lint-ignore.yamlin browser environments (Reunite).Reference
#86
Related PR
Testing
Screenshots (optional)
Check yourself
Security