Skip to content

Conversation

@JounQin
Copy link
Member

@JounQin JounQin commented Sep 24, 2025

close IDP-1316

Summary by CodeRabbit

  • Bug Fixes

    • The lint command now correctly ignores internal routes when the --ignore flag is used, preventing unintended files from being linted.
  • Chores

    • Added a changeset for a patch release of @alauda/doom documenting the fix.

Copilot AI review requested due to automatic review settings September 24, 2025 03:57
@changeset-bot
Copy link

changeset-bot bot commented Sep 24, 2025

🦋 Changeset detected

Latest commit: 88e3d2a

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

This PR includes changesets to release 1 package
Name Type
@alauda/doom 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 Sep 24, 2025

Note

Other AI code review bot(s) detected

CodeRabbit has detected other AI code review bot(s) in this pull request and will avoid duplicating their findings in the review comments. This may lead to a less comprehensive review.

Walkthrough

Adds a conditional ESLint ignorePatterns based on globalOptions.ignore to exclude config.internalRoutes during lint runs, and introduces a changeset documenting this bug fix for a patch release.

Changes

Cohort / File(s) Summary
CLI Lint Behavior
packages/doom/src/cli/lint.ts
When globalOptions.ignore is truthy, pass ignorePatterns: config.internalRoutes to ESLint; otherwise, leave undefined. Adjusts which files are linted.
Release/Docs (Changeset)
.changeset/late-bees-draw.md
Adds changeset for a patch release noting the bug fix: ignore internalRoutes when --ignore is enabled.

Sequence Diagram(s)

sequenceDiagram
  actor User
  participant CLI as CLI (doom)
  participant Lint as lint.ts
  participant ESLint as ESLint

  User->>CLI: doom lint [--ignore]
  CLI->>Lint: runLint(globalOptions, config)
  alt globalOptions.ignore is true
    Note over Lint,ESLint: Set ignorePatterns = config.internalRoutes
    Lint->>ESLint: new ESLint({ ignorePatterns: internalRoutes, ... })
  else globalOptions.ignore is false
    Note over Lint,ESLint: No ignorePatterns override
    Lint->>ESLint: new ESLint({ ... })
  end
  ESLint-->>Lint: Lint results
  Lint-->>CLI: Report
  CLI-->>User: Output
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related PRs

Suggested labels

bug

Poem

I twitch my whiskers at routes to skip,
With a flag I flip, I make them slip.
Internal paths, now out of sight,
The linter hops where code is right.
Patch released—thump-thump, hooray!
Clean burrows for commits today. 🐇✨

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title Check ✅ Passed The title succinctly and accurately summarizes the primary change: ensuring internalRoutes are ignored when the --ignore option is enabled, which matches the code change in packages/doom/src/cli/lint.ts and the new changeset; it is concise, specific, and free of noise, so a reviewer scanning history will understand the main intent.
Docstring Coverage ✅ Passed No functions found in the changes. Docstring coverage check skipped.
✨ Finishing touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix/lint_ignore_internal

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

Comment @coderabbitai help to get the list of available commands and usage tips.

Signed-off-by: JounQin <admin@1stg.me>
Copy link
Contributor

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 fixes a bug where internal routes were not being properly ignored when the --ignore flag was enabled in the lint command.

  • Adds conditional logic to respect the --ignore flag by setting ignorePatterns in ESLint configuration
  • Uses config.internalRoutes as the ignore patterns when the global ignore option is true

Tip: Customize your code reviews with copilot-instructions.md. Create the file or learn how to get started.

@pkg-pr-new
Copy link

pkg-pr-new bot commented Sep 24, 2025

Open in StackBlitz

yarn add https://pkg.pr.new/@alauda/doom@182.tgz
yarn add https://pkg.pr.new/@alauda/doom-export@182.tgz

commit: 88e3d2a

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

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 72e9219 and 88e3d2a.

📒 Files selected for processing (2)
  • .changeset/late-bees-draw.md (1 hunks)
  • packages/doom/src/cli/lint.ts (1 hunks)
🔇 Additional comments (2)
packages/doom/src/cli/lint.ts (1)

39-39: Validate internalRoutes format (array/string) and relative paths

Echoing Copilot’s note: ensure config.internalRoutes is string or string[] and paths are correct relative to cwd (docsDir).

.changeset/late-bees-draw.md (1)

1-6: Changeset LGTM

Clear, scoped patch note aligned with the code change.

@JounQin JounQin merged commit 71926d0 into main Sep 24, 2025
16 checks passed
@JounQin JounQin deleted the fix/lint_ignore_internal branch September 24, 2025 04:07
github-actions bot pushed a commit that referenced this pull request Sep 24, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants