Skip to content

Conversation

@JounQin
Copy link
Collaborator

@JounQin JounQin commented Jun 5, 2025

close #386

Summary by CodeRabbit

  • Bug Fixes
    • Updated the URL used to load the JSON schema catalog, ensuring continued access to the latest schema definitions.
  • Refactor
    • Improved type safety and code clarity by refining type usage and import organization without changing functionality.

@JounQin JounQin requested a review from Copilot June 5, 2025 00:00
@JounQin JounQin added bug Something isn't working upstream issue labels Jun 5, 2025
@changeset-bot
Copy link

changeset-bot bot commented Jun 5, 2025

🦋 Changeset detected

Latest commit: ae6ef8f

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

This PR includes changesets to release 1 package
Name Type
eslint-plugin-json-schema-validator 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

@coderabbitai
Copy link

coderabbitai bot commented Jun 5, 2025

Walkthrough

The changes update the URL used to fetch the schemastore JSON schema catalog in the no-invalid rule implementation and add a changeset file documenting this fix for the eslint-plugin-json-schema-validator package. Additionally, minor type safety improvements and import reordering were made in utility functions without changing core logic.

Changes

File(s) Change Summary
src/rules/no-invalid.ts Updated CATALOG_URL constant to new schemastore catalog URL.
.changeset/eight-timers-tickle.md Added changeset file documenting the patch update and its reason.
src/utils/ast/js/utils.ts Removed ESLint disables, reordered imports, improved type safety, updated return types, and added TS expect-error comments for Vue AST typings compatibility.

Assessment against linked issues

Objective Addressed Explanation
Update schemastore catalog URL to fix 404 error (#386)

Suggested reviewers

  • ota-meshi

Warning

There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure.

🔧 ESLint

If the error stems from missing dependencies, add them to the package.json file. For unrecoverable errors (e.g., due to private dependencies), disable the tool in the CodeRabbit configuration.

src/utils/ast/js/utils.ts

Oops! Something went wrong! :(

ESLint: 9.28.0

Error: Cannot find module '/node_modules/eslint-plugin-json-schema-validator/lib/index.js'. Please verify that the package.json has a valid "main" entry
at tryPackage (node:internal/modules/cjs/loader:515:19)
at Module._findPath (node:internal/modules/cjs/loader:800:18)
at Module._resolveFilename (node:internal/modules/cjs/loader:1391:27)
at defaultResolveImpl (node:internal/modules/cjs/loader:1061:19)
at resolveForCJSWithHooks (node:internal/modules/cjs/loader:1066:22)
at Module._load (node:internal/modules/cjs/loader:1215:37)
at TracingChannel.traceSync (node:diagnostics_channel:322:14)
at wrapModuleLoad (node:internal/modules/cjs/loader:235:24)
at Module.require (node:internal/modules/cjs/loader:1491:12)
at require (node:internal/modules/helpers:135:16)

src/rules/no-invalid.ts

Oops! Something went wrong! :(

ESLint: 9.28.0

Error: Cannot find module '/node_modules/eslint-plugin-json-schema-validator/lib/index.js'. Please verify that the package.json has a valid "main" entry
at tryPackage (node:internal/modules/cjs/loader:515:19)
at Module._findPath (node:internal/modules/cjs/loader:800:18)
at Module._resolveFilename (node:internal/modules/cjs/loader:1391:27)
at defaultResolveImpl (node:internal/modules/cjs/loader:1061:19)
at resolveForCJSWithHooks (node:internal/modules/cjs/loader:1066:22)
at Module._load (node:internal/modules/cjs/loader:1215:37)
at TracingChannel.traceSync (node:diagnostics_channel:322:14)
at wrapModuleLoad (node:internal/modules/cjs/loader:235:24)
at Module.require (node:internal/modules/cjs/loader:1491:12)
at require (node:internal/modules/helpers:135:16)


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between a850ec5 and ae6ef8f.

📒 Files selected for processing (2)
  • src/rules/no-invalid.ts (1 hunks)
  • src/utils/ast/js/utils.ts (4 hunks)
✅ Files skipped from review due to trivial changes (2)
  • src/rules/no-invalid.ts
  • src/utils/ast/js/utils.ts
⏰ Context from checks skipped due to timeout of 90000ms (1)
  • GitHub Check: test (windows-latest, 22.x)
✨ Finishing Touches
  • 📝 Generate Docstrings

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments.

CodeRabbit Commands (Invoked using PR comments)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR updates the schemastore catalog URL to use the new endpoint.

  • Updated the constant value of CATALOG_URL in src/rules/no-invalid.ts to reflect the new URL.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

🧹 Nitpick comments (1)
.changeset/eight-timers-tickle.md (1)

1-6: Nit: Spelling error in changeset summary
The changeset title reads “fix: update schemastore catlog url” – “catlog” should be “catalog.” Please correct the typo.

📜 Review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 327e06f and a850ec5.

📒 Files selected for processing (2)
  • .changeset/eight-timers-tickle.md (1 hunks)
  • src/rules/no-invalid.ts (1 hunks)
🧰 Additional context used
🪛 GitHub Actions: CI
src/rules/no-invalid.ts

[error] 420-420: TypeError: Error while loading rule 'json-schema-validator/no-invalid': catalog.schemas is not iterable. Occurred during linting of tests/fixtures/integrations/eslint-plugin/legacy-config-test01/src/test.js.


[error] 420-420: TypeError: Error while loading rule 'json-schema-validator/no-invalid': catalog.schemas is not iterable. Occurred during linting of tests/fixtures/integrations/eslint-plugin/flat-config-test01/src/test.js.


[error] 420-420: TypeError: Error while loading rule 'rule-to-test/no-invalid': catalog.schemas is not iterable. Occurred during linting of tests/fixtures/rules/no-invalid/valid/vue-test/test02-input.vue.


[error] 420-420: TypeError: Error while loading rule 'rule-to-test/no-invalid': catalog.schemas is not iterable. Occurred during linting of tests/fixtures/rules/no-invalid/invalid/vue-test/test01-input.vue.

@JounQin JounQin merged commit de55f01 into main Jun 5, 2025
12 checks passed
@JounQin JounQin deleted the JounQin-patch-1 branch June 5, 2025 00:38
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working upstream issue

Projects

None yet

Development

Successfully merging this pull request may close these issues.

catalog.json 404ing

2 participants