Skip to content

Conversation

@zubhav
Copy link
Contributor

@zubhav zubhav commented Apr 2, 2025

Fixes #10173

When extending configuration files in Oxlint, plugins from the extended config were not being properly inherited, which caused rules requiring those plugins to be filtered out. This was encountered in issue #10173 where rules like vitest/no-focused-tests were being ignored even when the vitest plugin was defined in a base configuration.

The issue occurred because in the implementation of from_oxlintrc. The following changes were made:

Modified plugin inheritance logic in from_oxlintrc:

  • Now checks if the child configuration has explicitly specified plugins
  • If the child has default plugins (not explicitly specified), it inherits from the parent
  • If the child has explicitly specified plugins, it combines them with the parent's plugins (like ESLint)
  • Empty plugin arrays are treated as explicit specifications

Added tests to verify the behavior:

  • Tests for empty configurations
  • Tests for configurations with empty plugin arrays
  • Tests for configurations with explicitly specified plugins
  • Tests for configurations that extend other configurations

This ensures that when rules are added from an extended config, the necessary plugins are already enabled, so the rules won't be filtered out in the build step.

cc @camchenry

@graphite-app
Copy link
Contributor

graphite-app bot commented Apr 2, 2025

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 hot fixes, skip the queue and merge this PR next

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.

@github-actions github-actions bot added A-linter Area - Linter C-bug Category - Bug labels Apr 2, 2025
@Boshen Boshen requested a review from camchenry April 2, 2025 06:39
@zubhav zubhav closed this Apr 2, 2025
@zubhav zubhav reopened this Apr 4, 2025
@camchenry
Copy link
Member

Haven't had a chance to review this yet, but I will take a look next time I am able.

@camchenry camchenry self-assigned this Apr 4, 2025
Copy link
Member

@camchenry camchenry left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

These tests look good, but let's refactor it to not need an extra dependency, to help keep things simpler

@codspeed-hq
Copy link

codspeed-hq bot commented Apr 5, 2025

CodSpeed Instrumentation Performance Report

Merging #10174 will not alter performance

Comparing zubhav:fix-10173-extended-config-plugin-inheritance (08aa912) with main (81867c4)

Summary

✅ 36 untouched benchmarks

@zubhav zubhav requested a review from camchenry April 7, 2025 05:06
@zubhav
Copy link
Contributor Author

zubhav commented Apr 7, 2025

@camchenry Could you also take a look at #10157 please? Its another fix for nested config

Copy link
Member

@camchenry camchenry left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the updates!

@camchenry camchenry added the 0-merge Merge with Graphite Merge Queue label Apr 8, 2025
@graphite-app
Copy link
Contributor

graphite-app bot commented Apr 8, 2025

Merge activity

  • Apr 8, 12:00 AM EDT: @zubhav we removed the merge queue label because we could not find a Graphite account associated with your GitHub profile.

You must have a Graphite account in order to use the merge queue. Create an account and try again using this link

  • Apr 9, 12:39 AM EDT: @zubhav we removed the merge queue label because we could not find a Graphite account associated with your GitHub profile.

You must have a Graphite account in order to use the merge queue. Create an account and try again using this link

@graphite-app graphite-app bot removed the 0-merge Merge with Graphite Merge Queue label Apr 8, 2025
@zubhav
Copy link
Contributor Author

zubhav commented Apr 8, 2025

@camchenry Could you help with the graphite-app comment above? I've configured the account so I'm guessing we'll need to re-add the label. Thanks!

@camchenry camchenry added the 0-merge Merge with Graphite Merge Queue label Apr 9, 2025
@graphite-app graphite-app bot removed the 0-merge Merge with Graphite Merge Queue label Apr 9, 2025
@camchenry camchenry merged commit e000f60 into oxc-project:main Apr 9, 2025
25 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A-linter Area - Linter C-bug Category - Bug

Projects

None yet

Development

Successfully merging this pull request may close these issues.

linter: extended configs do not inherit plugins from parent config

2 participants