Skip to content

Linter: ConfigStoreBuilder::from_oxlintrc called twice #16356

@overlookmotel

Description

@overlookmotel

I've labelled this as a bug, though I'm not sure if it actually is. But to my mind, it seems strange.

In a project with only 1 config file, ConfigStoreBuilder::from_oxlintrc gets called twice.

To reproduce

Add to top of from_oxlintrc method:

eprintln!("> from_oxlintrc");

Run oxlint tests with snapshot updates enabled:

cd apps/oxlint; pnpm run build-test && pnpm test -u; cd ../..

Each snapshot has 2 lines > from_oxlintrc.

The only exceptions are fixtures where there's an early error e.g. fixtures/import_error, where there's only 1 call.

When there's a nested config, e.g. fixtures/nested_config, there's 3 calls (not 4, so it's not calling twice for each config).

It's not related to JS plugins - 2 x calls in fixtures/built_in_no_errors, which doesn't use JS plugins.

Expected behavior?

If this is intentional, we'll need to change how options for JS plugins are stored. Currently they're stored twice each, which is wasteful.

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