Skip to content

linter: plugins inside overrides don't get applied #10394

@Miodec

Description

@Miodec

What version of Oxlint are you using?

0.16.6

What command did you run?

oxlint ., vsc extension does the same

What does your .oxlintrc.json config file look like?

{
  "extends": ["../packages/oxlint-config/index.json"],
  "overrides": [
    {
      "files": ["__tests__/**"],
      "plugins": ["jest", "vitest"],
      "rules": {
        // "no-unused-vars": "off"
      }
    }
  ]
}

The contents of the oxlint-config/index.json don't matter in this case but here you go:

{
  "ignorePatterns": ["node_modules", "dist", "coverage", "build"],
  "categories": {
    "correctness": "error",
    "suspicious": "error",
    "perf": "error"
  },
  "plugins": ["typescript", "unicorn", "oxc", "import", "node", "promise"],
  "rules": {
    "no-unused-vars": [
      "error",
      {
        "argsIgnorePattern": "^(_|e|event)",
        "caughtErrorsIgnorePattern": "^(_|e|error)",
        "varsIgnorePattern": "^_"
      }
    ],
    "no-await-in-loop": "allow",
    "consistent-function-scoping": "off",
    "prefer-add-event-listener": "off",
    "no-unsafe-optional-chaining": "off",
    "no-new": "off",
    "no-new-array": "off",
    "no-useless-spread": "off",
    "no-unneeded-ternary": "off",
    "no-async-endpoint-handlers": "off",
    "no-this-alias": "off"
  }
}

What happened?

When trying to setup overrides for my test files, i wanted to enable the jest and vitest plugins for test files. I noticed that adding plugins inside overrides does nothing - it only works when added to the root of the config file. I verified the override is being applied correctly by disabling the no-unused-vars rule as a quick test.

Plugins in overrides, not working
Image

Verified override is being applied by disabling no-unused-vars
Image

jest plugin working when added to the root
Image

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