Skip to content

linter: options.typeAware linter error when using nested oxlint.config.ts in monorepo #19932

@kavsingh

Description

@kavsingh

What version of Oxlint are you using?

1.51.0

What command did you run?

oxlint via npm workspaces script

What does your .oxlintrc.json (or oxlint.config.ts) config file look like?

a repro setup can be found here: https://github.com/kavsingh/oxlint-nested-tsconfig-typeaware-repro

the linked npm workspaces monorepo sets up

  • a base configuration at oxlint.config.ts, which sets typeAware to true as per these docs
  • a nested package configuration at packages/a/oxlint.config.ts as per these docs
  • a lint script in the root package.json which runs npm run lint --workspaces

oxlint.config.ts at repo root

import { defineConfig } from "oxlint";

export default defineConfig({ options: { typeAware: true } });

oxlint.config.ts in workspace package

import { defineConfig } from "oxlint";

import base from "../../oxlint.config.ts";

export default defineConfig({ extends: [base] });

What happened?

❯ npm run lint

results in:

> oxlint-nested-tsconfig-typeaware-repro@1.0.0 lint
> npm run lint --workspaces


> a@1.0.0 lint
> oxlint

Failed to parse oxlint configuration file.

  × The `options.typeAware` option is only supported in the root config, but it was found in /[PATH_TO]/oxlint-nested-tsconfig-typeaware-repro/oxlint.config.ts.
  help: Move `options.typeAware` to the root configuration file.

npm error Lifecycle script `lint` failed with error:
npm error code 1
npm error path /[PATH_TO]/oxlint-nested-tsconfig-typeaware-repro/packages/a
npm error workspace a@1.0.0
npm error location /[PATH_TO]/oxlint-nested-tsconfig-typeaware-repro/packages/a
npm error command failed
npm error command sh -c oxlint

for this setup of extending a base oxlint.config.ts, is the base configuration at the repo root taken to be the "root configuration"? if i move options: { typeAware: true } to the workspace package's config at packages/a/oxlint.config.ts, then npm run lint works. maybe this is expected and just needs documentation (or more likely, i have misread the documentation)?

note - i don't see any in-ide config errors as mentioned in #19930

thanks!

Metadata

Metadata

Assignees

No one assigned

    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