Skip to content

Oxlint nested .oxlintrc.json is not applied when it runs oxlint from workspace root. #22867

@emosheeep

Description

@emosheeep

Environment

  • oxlint: 1.67.0
  • VS Code extension: oxc.oxc-vscode
  • OS: Linux

Repository structure

repo/
├── package.json
├── node_modules/
│   └── @byted-image/oxlint/
│       └── configs/
│           └── ts.json
└── packages/
    └── lv-infra-plugins/
        ├── .oxlintrc.json
        └── rule-test.ts

packages/lv-infra-plugins/.oxlintrc.json:

{
  "extends": [
    "../../node_modules/@byted-image/oxlint/configs/ts.json"
  ],
  "ignorePatterns": [
    "types/**"
  ]
}

The extended config enables oxc/no-const-enum.

packages/lv-infra-plugins/rule-test.ts:

const enum Enum {
  A = 'A',
  B = 'B',
  C = 'C',
}

Reproduction

1. Run Oxlint from the package directory

cd packages/lv-infra-plugins
oxlint rule-test.ts --format json

oxc/no-const-enum is reported.

2. Run Oxlint from the repo root with the same file path

oxlint packages/lv-infra-plugins/rule-test.ts --format json

oxc/no-const-enum is not reported.

3. Run Oxlint from the repo root with explicit config

oxlint \
  -c packages/lv-infra-plugins/.oxlintrc.json \
  packages/lv-infra-plugins/rule-test.ts \
  --format json

oxc/no-const-enum is reported.

4. Open the file in VS Code

Open packages/lv-infra-plugins/rule-test.ts with the oxc.oxc-vscode extension enabled.

oxc/no-const-enum is not reported in the editor, matching the root CLI behavior.

Expected behavior

The same file should produce the same diagnostics in these cases:

  1. package directory CLI
  2. repo root CLI
  3. VS Code extension

In this example, oxc/no-const-enum should be reported consistently.

Metadata

Metadata

Assignees

Labels

Type

Priority

None yet

Effort

None yet

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions