Skip to content

fix(oxlint/cli): load root config by searching up parent directories#22272

Merged
graphite-app[bot] merged 1 commit into
mainfrom
05-09-fix_oxlint_cli_load_root_config_by_searching_up_parent_directories
May 11, 2026
Merged

fix(oxlint/cli): load root config by searching up parent directories#22272
graphite-app[bot] merged 1 commit into
mainfrom
05-09-fix_oxlint_cli_load_root_config_by_searching_up_parent_directories

Conversation

@Sysix

@Sysix Sysix commented May 9, 2026

Copy link
Copy Markdown
Member

Allow users to run oxlint in a sub package, when the monorepo has a base config.

Example:
cd project/packages/pack-a && oxlint

Now it detects the config from project/.oxlintrc.json, aligning how the LSP side works.
Aligns too how oxfmt searches config path.

closes #21533
found in voidzero-dev/vite-plus#1378 (comment)

@github-actions github-actions Bot added A-linter Area - Linter A-cli Area - CLI A-editor Area - Editor and Language Server labels May 9, 2026

Sysix commented May 9, 2026

Copy link
Copy Markdown
Member Author

How to use the Graphite Merge Queue

Add either label to this PR to merge it via the merge queue:

  • 0-merge - adds this PR to the back of the merge queue
  • hotfix - for urgent changes, fast-track this PR to the front of the merge queue

You must have a Graphite account in order to use the merge queue. Sign up using this link.

An organization admin has enabled the Graphite Merge Queue in this repository.

Please do not merge from GitHub as this will restart CI on PRs being processed by the merge queue.

This stack of pull requests is managed by Graphite. Learn more about stacking.

@Sysix Sysix force-pushed the 05-09-fix_oxlint_cli_load_root_config_by_searching_up_parent_directories branch from ffb00da to ca12e68 Compare May 9, 2026 12:43
@github-actions github-actions Bot added the A-linter-plugins Area - Linter JS plugins label May 9, 2026
@Sysix Sysix marked this pull request as ready for review May 9, 2026 12:46
@camc314 camc314 added the 0-merge Merge with Graphite Merge Queue label May 11, 2026

camc314 commented May 11, 2026

Copy link
Copy Markdown
Contributor

Merge activity

…22272)

Allow users to run `oxlint` in a sub package, when the monorepo has a base config.

Example:
`cd project/packages/pack-a && oxlint`

Now it detects the config from `project/.oxlintrc.json`, aligning how the LSP side works.
Aligns too how oxfmt searches config path.

closes #21533
found in voidzero-dev/vite-plus#1378 (comment)
@graphite-app graphite-app Bot force-pushed the 05-09-fix_oxlint_cli_load_root_config_by_searching_up_parent_directories branch from ca12e68 to 6b50f23 Compare May 11, 2026 08:09
@graphite-app graphite-app Bot merged commit 6b50f23 into main May 11, 2026
26 checks passed
@graphite-app graphite-app Bot removed the 0-merge Merge with Graphite Merge Queue label May 11, 2026
@graphite-app graphite-app Bot deleted the 05-09-fix_oxlint_cli_load_root_config_by_searching_up_parent_directories branch May 11, 2026 08:13
camc314 added a commit that referenced this pull request May 11, 2026
# Oxlint
### 💥 BREAKING CHANGES

- 00ce512 oxlint/lsp: [**BREAKING**] Don't fix suggestions on fixAll
code actions & command (#22195) (Sysix)

### 🚀 Features

- 0eeceaf linter/no-unused-vars: Rename parameter with initializer
(#22308) (camc314)
- fa0232b linter/no-unused-vars: Add param rename suggestion (#22285)
(Ryota Misumi)
- ae59305 linter/promise/no-promise-in-callback: Add
`exemptDeclarations` option (#22275) (Mikhail Baev)
- 60bed4a linter: Extends `no-redundant-roles` and
`prefer-tag-over-role` support roles (#22069) (mehm8128)
- 545c80f linter/eslint: Implement `prefer-regex-literals` rule (#22192)
(Mikhail Baev)
- cf86d7a linter: Bulk suppression (#19328) (Said Atrahouch)
- 23abd22 linter/jsx-a11y: Implement
no-noninteractive-element-to-interactive-role (#21264) (Pedro Tainha)
- fbb8f22 linter: Support `ignores` in overrides (#22148) (camc314)
- 5a4414d oxlint/lsp: Support `rulesCustomization` lsp option (#21858)
(Sysix)

### 🐛 Bug Fixes

- 610f4c7 linter/no-unused-vars: Avoid renaming captured vars (#22310)
(camc314)
- 6b50f23 oxlint/cli: Load root config by searching up parent
directories (#22272) (Sysix)
- 31a5de7 linter: Rename override `ignores` to `excludeFiles` (#22283)
(camc314)
- 26d5d7b linter: Add missing vitest/valid-describe-callback
functionality (#22279) (camchenry)
- 784530f linter: `valid-title`: detect `String.raw` strings (#22271)
(Sysix)
- 080d90e linter: Move `no-debugger` fix to suggestion (#22256) (Sysix)
- 25b7017 linter: Undocument override `ignores` option (#22213)
(camc314)
- 7bb00dd linter: Fix role-has-required-aria-props (#22097) (mehm8128)
- d25279e linter/disable-directives: Improve parsing of names,
descriptions (#22184) (camc314)
- a59e447 linter/disable-directives: Ignore invalid enable suffixes
(#22179) (camc314)
- aafef0f ci: Disable bulk supression test on big endian (#22175)
(camc314)
- 281daec linter/vue/define-props-destructuring: Add
`only-when-assigned` config opt (#22142) (camc314)
- 46ab679 linter/plugins: Trim leading newline for partial sources
(#20928) (bab)
- 29ff6d9 linter: Update docs for no_alias_methods rule to be
Vitest-specific and add toThrowError alias (#22129) (camchenry)

### ⚡ Performance

- 9414bee linter/role-has-required-aria-props: Avoid intermediate vec
(#22212) (camc314)
- 3883ea3 linter/no-useless-escape: Drop unnecessary Vec collect
(#22171) (connorshea)
- 42c3029 linter/check-property-names: Replace split-collect-pop-join
with rfind (#22172) (connorshea)
- 9551d53 linter: Remove unnecessary Vec collect in CFG edge traversal
(#22167) (connorshea)
- 26fa2fc linter/aria-role: Remove unnecessary string allocations in run
method (#22168) (connorshea)
- c9ce045 linter/getter-return: Remove unnecessary Vec collect in CFG
edge traversal (#22166) (connorshea)
- 72bd846 linter/no-this-in-sfc: Reorder cheap name check, avoid String
allocation (#22164) (connorshea)

### 📚 Documentation

- 4da212a linter/no-unused-vars: Add docs to
`rename_unused_function_parameter` (#22311) (camc314)
- 27c4628 linter/forbid-dom-props: Escape jsx examples in lint rule docs
(#22254) (4MBL)
- 3f81147 linter: Improve the `react/jsx-key` rule docs. (#22162)
(connorshea)
- 07f03cc linter/consistent-return: Add note about `noImplicitReturns`
coverage (#22156) (camc314)
- 7c1e049 oxlint/lsp: Improve autogenerated lsp docs (#22154) (Sysix)
- 87b3e38 linter: Update docs to be vitest-specific for
consistent-test-it (#22128) (camchenry)
# Oxfmt
### 💥 BREAKING CHANGES

- 5c6c390 oxfmt: [**BREAKING**] Respect more git ignore options, align
with Oxlint (#22210) (leaysgur)

### 🚀 Features

- 6e8e818 oxfmt: Experimental .svelte support (#21700) (leaysgur)

### 🐛 Bug Fixes

- e2a20b6 formatter: Add space after commas in import attributes
(#22274) (Leonabcd123)

### ⚡ Performance

- b756682 oxfmt: Optimize nested config prescan (#22232) (Jovi De
Croock)
- f14e81e formatter/sort_imports: Skip sort for single import runs
(#22204) (leaysgur)
- 32255b1 formatter: Process `ImportDeclaration`s in a run (#22079)
(overlookmotel)

### 📚 Documentation

- 4da6f4c formatter: Correct comment (#22217) (overlookmotel)
- ef3507d formatter/sort_imports: Refresh docs (#22203) (leaysgur)

Co-authored-by: Cameron <cameron.clark@hey.com>
frolic added a commit to tldraw/tldraw that referenced this pull request May 27, 2026
The worktree config bug was fixed upstream in oxlint 1.64 (oxc-project/oxc#22272
"load root config by searching up parent directories"). Bumping from 1.58 to 1.66
resolves it at the source, so the `--disable-nested-config` workaround added in
the previous commit is no longer needed and is reverted here.

Verified by re-running `oxlint <file>` from inside `.claude/worktrees/<name>/`
with the plain `oxlint` command (no flag): exits 0, no parse error. Full repo
`oxlint .` also passes on 1.66.
pull Bot pushed a commit to limerencel/tldraw that referenced this pull request May 29, 2026
…raw#8945)

In order to let pre-commit hooks run cleanly from inside git worktrees,
this PR bumps `oxlint` from 1.58.0 to 1.66.0.

### The bug

When a worktree lives under the main repo (for example
`.claude/worktrees/<name>/`), oxlint 1.58 walks up from the file being
linted, finds the worktree's `.oxlintrc.json`, and then keeps walking
and also finds the main repo's `.oxlintrc.json`. It treats one of the
two identical configs as a "nested" config and rejects
`options.typeAware`:

```
The `options.typeAware` option is only supported in the root config,
but it was found in /Users/.../.oxlintrc.json
```

The net effect: the lint-staged step in `.husky/pre-commit` blows up for
every commit made from inside a worktree, regardless of what the diff
is, which forces contributors (and Claude Code agents) to use `git
commit --no-verify`.

### The fix

Upstream fixed this in oxlint 1.64 —
[oxc-project/oxc#22272](oxc-project/oxc#22272)
("load root config by searching up parent directories"). Bumping to 1.66
(latest available in our registry mirror) picks up the fix at the
source. No config or script changes needed.

The earlier commit on this branch added a `--disable-nested-config`
workaround flag to `lint-staged` and `internal/scripts/lint.ts`; the
follow-up commit reverts it now that the bump makes it unnecessary.

### Change type

- [x] `other`

### Test plan

1. `git worktree add .claude/worktrees/test-worktree`
2. `cd .claude/worktrees/test-worktree && yarn install`
3. `yarn oxlint packages/tldraw/src/lib/ui/hooks/useClipboardEvents.ts`
— exits 0, no `options.typeAware` parse error.
4. Make any trivial change inside the worktree, `git add` it, and `git
commit` (without `--no-verify`) — pre-commit hook completes cleanly.

### Code changes

| Section        | LOC change   |
| -------------- | ------------ |
| Config/tooling | +85 / -85    |

(`package.json` +1 / -1, `yarn.lock` +84 / -84.)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-cli Area - CLI A-editor Area - Editor and Language Server A-linter Area - Linter A-linter-plugins Area - Linter JS plugins

Projects

None yet

Development

Successfully merging this pull request may close these issues.

oxlint/cli: search base config upwards current cwd

2 participants