Skip to content

fix: strict align config and ignore behavior - #6

Merged
ntnyq merged 10 commits into
mainfrom
fix/ignore-behavior
Jun 30, 2026
Merged

fix: strict align config and ignore behavior#6
ntnyq merged 10 commits into
mainfrom
fix/ignore-behavior

Conversation

@ntnyq

@ntnyq ntnyq commented Jun 30, 2026

Copy link
Copy Markdown
Owner

Summary by CodeRabbit

  • New Features

    • Added support for a broader set of config file formats and refreshed handling for config reloads.
    • Expanded default ignore behavior for more version-control folders and lockfiles.
  • Bug Fixes

    • Improved ignore-file precedence so explicit ignore settings behave more predictably.
    • Fixed loading of JavaScript/TypeScript config files that use default exports.
  • Documentation

    • Updated setup and configuration docs to better explain config discovery, ignore rules, and precedence.

@coderabbitai

coderabbitai Bot commented Jun 30, 2026

Copy link
Copy Markdown

Review Change Stack

Warning

Review limit reached

@ntnyq, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 26 minutes

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

How can I continue?

After more reviews become available, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews.

How do review limits work?

CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability.

For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 8dfb7ee9-1941-4727-97ff-2e7adcb88ff0

📥 Commits

Reviewing files that changed from the base of the PR and between cd609de and c324ca7.

📒 Files selected for processing (3)
  • README.md
  • src/config-file.ts
  • tests/load-config.test.ts
📝 Walkthrough

Walkthrough

Adds cache-bypassing fresh module loading to readConfigFromFile (with a new useCache option), replaces picomatch with the ignore library for config ignore-pattern matching, introduces matchIgnoreFileChain for sequential negation-aware gitignore/ignorePath evaluation, expands default ignored directories and lockfiles, adds rootOptions to EditorconfigData, bumps oxfmt peer dependency to >=0.57.0, and updates docs and tests throughout.

Changes

Core feature changes

Layer / File(s) Summary
Dependency and default constants update
package.json, src/constants.ts
Removes picomatch dependency, bumps oxfmt to ^0.57.0 in dev/peer deps, expands DEFAULT_IGNORED_DIRS with .sl/.hg, and adds many ecosystem lockfiles to DEFAULT_IGNORED_LOCKFILES.
Fresh/cache-bypass config file loading
src/config-file.ts, src/core.ts
Adds createRequire/pathToFileURL imports and internal helpers for mtime-based ESM cache busting, fresh .cjs require, and three-step .js loading. Wires useCache parameter through readConfigFromFile and loadTask.
Ignore chain refactor
src/ignore.ts
Replaces picomatch-based per-pattern matching with ignore-library compiled/cached matchers. Adds IgnoreFileEntry type and matchIgnoreFileChain for sequential negation-preserving multi-file evaluation. Refactors isOxfmtIgnored to use the chain for gitignore paths and explicit ignorePath entries.
EditorconfigData rootOptions and type docs
src/editorconfig.ts, src/types.ts
Adds rootOptions: EditorconfigOptions to EditorconfigData, updates JSDoc across editorconfig/ignore/load options to reflect new semantics.
Config loading tests
tests/load-config.test.ts
Adds parameterized useCache: false reload tests across TS/ESM/CJS formats, negative tests for missing/non-object default exports, and updates .cts fixture to ESM export default form.
Ignore resolution tests
tests/resolve-ignore.test.ts
Adds tests for .hg/.sl VCS dirs, expanded lockfiles, reworked ignorePath vs .prettierignore precedence, nested .gitignore negation, multi-ignorePath negation, and ignorePatterns directory semantics.
README, CI, and tooling updates
README.md, .github/workflows/*, .oxlintrc.jsonc, .vscode/settings.json, .agents/skills/bump-oxfmt/agents/openai.yaml
Updates README ignore/editorconfig/JS-config-format docs, bumps actions/checkout to v7 across all workflows, disables jsdoc/require-throws-type lint rule, adds Gopkg to cSpell, adds bump-oxfmt agent skill.

Estimated code review effort

🎯 4 (Complex) | ⏱️ ~60 minutes

Possibly related PRs

  • ntnyq/load-oxfmt-config#1: Initial .editorconfig support implementation directly related to the EditorconfigData/rootOptions and src/core.ts editorconfig merging changes here.
  • ntnyq/load-oxfmt-config#3: Prior ignore-resolution enhancements overlap with the matchIgnoreFileChain, isOxfmtIgnored refactor, and compiled ignore-pattern caching in this PR.
  • ntnyq/load-oxfmt-config#5: Previous cache-keying work in src/core.ts and src/ignore.ts is directly extended by this PR's useCache propagation and matcher caching.

Poem

🐇 Hop, hop, through the cache I leap,
Fresh modules loaded from their sleep,
No picomatch, just ignore rules,
Lockfiles expanded, better tools,
.hg and .sl join the ignored queue—
The rabbit's config always fresh and new! 🌿

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title is concise and clearly reflects the main changes to config loading and ignore behavior.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch fix/ignore-behavior

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.

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Actionable comments posted: 2

🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.

Inline comments:
In `@src/config-file.ts`:
- Around line 92-125: The cache-bypass logic in importNativeFreshModule and
requireFreshModule only refreshes the top-level config file, so imported helper
modules can still stay stale. Update the config loading flow used by
getFreshImportCacheKey, importNativeFreshModule, and requireFreshModule so that
useCache: false also bypasses cached dependencies: for CommonJS, clear the full
require dependency chain, and for native ESM, ensure child imports get
cache-busting treatment or are reloaded through the same fresh-import path.
- Around line 154-166: In importFreshJavaScriptConfigModule, the bare catch is
retrying all requireFreshModule failures, including config evaluation errors,
which can re-run a broken CommonJS config through importNativeFreshModule and
importJitiConfigModule. Narrow the fallback so it only catches loader/interop
compatibility cases from requireFreshModule, and rethrow ordinary execution
errors immediately. Keep the existing module detection and fallback flow, but
distinguish the failure type before deciding whether to retry.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: d2e3bf2e-151f-4b66-aeb6-2aa078be694b

📥 Commits

Reviewing files that changed from the base of the PR and between ab574e6 and cd609de.

⛔ Files ignored due to path filters (1)
  • pnpm-lock.yaml is excluded by !**/pnpm-lock.yaml
📒 Files selected for processing (17)
  • .agents/skills/bump-oxfmt/SKILL.md
  • .agents/skills/bump-oxfmt/agents/openai.yaml
  • .github/workflows/autofix.yml
  • .github/workflows/ci.yml
  • .github/workflows/release.yml
  • .oxlintrc.jsonc
  • .vscode/settings.json
  • README.md
  • package.json
  • src/config-file.ts
  • src/constants.ts
  • src/core.ts
  • src/editorconfig.ts
  • src/ignore.ts
  • src/types.ts
  • tests/load-config.test.ts
  • tests/resolve-ignore.test.ts

Comment thread src/config-file.ts
Comment thread src/config-file.ts
@ntnyq
ntnyq merged commit 5ae4913 into main Jun 30, 2026
12 checks passed
@ntnyq
ntnyq deleted the fix/ignore-behavior branch June 30, 2026 05:14
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.

1 participant