Commit Graph

6 Commits

Author SHA1 Message Date
camc314 fdd4c92791 refactor(oxlint,oxfmt): share config discovery code (#21642) 2026-04-23 10:12:18 +00:00
leaysgur 6f49fada82 fix(oxfmt): Respect nested config.ignorePatterns (#21489)
Previously, `ignorePatterns` could not skip directories in `filter_entry()` because doing so might hide nested configs beneath them.

This PR pre-scans config locations before the walk, so `filter_entry()` can safely skip `ignorePatterns` directories that have no nested config beneath them.

With all configs known upfront, the walk also resolves each file's scope dynamically from a pre-loaded scope map, replacing the sequential child-scope walks (`run_child_scope()` recursion) with a single parallel walk.

The pre-scan also preserves current streaming architecture (walk → channel → format workers), keeping format workers busy sooner than a batch-collect alternative would.
2026-04-16 08:10:30 +00:00
leaysgur c9b4db9ff7 test(oxfmt): Rework test/cli tests (#21463)
Switch to a fixture-based testing approach, similar to apps/oxlint.
2026-04-15 09:13:40 +00:00
leaysgur 16713d58cd feat(oxfmt/cli): Support per-directory config (#21103)
Fixes #19509

Initially, I thought about sharing the implementation with Oxlint, but finally I  decided not to do it due to constraints and structural differences.

- Strategy
  - Oxlint: Collects all file paths into memory upfront
    - for cross-module analysis?
    - then filters by `ignorePatterns` afterward
  - Oxfmt: Streams files to the formatter as they are discovered while walking
    - Scope-based walk resolves config at walk time, avoiding a separate post-walk filtering pass
- Config
  - Oxlint: There is a difference in what can be configured in the root config versus the rest
  - Oxfmt: No difference
2026-04-15 01:26:50 +00:00
leaysgur 172fc072f3 feat(oxfmt): .js/.ts config file support (#20135)
Fixes #19711, also resolves some of the demands for nested configs.
2026-03-11 04:34:48 +00:00
leaysgur 1a02f6ee8c test(oxfmt): Arrange test files and directries (#17822)
Sorry for the large diff! 🙇🏻

But it's mostly just file relocations (and path updates).
Details on the changes are also documented in [`AGENTS.md`](https://github.com/oxc-project/oxc/pull/17822/changes#diff-b9a8ddc83e0b93133df7274e37b5fcdaec808090721eec2194782fe968819e69), so please refer to that file.

TL;DR: I wanted to colocate test cases and fixtures in the same directory.
2026-01-09 15:11:35 +00:00