Match default export of plugin and `plugin` object of flat configs
Fixes #3212
The plugin's default export is not equal by reference to the plugin object defined on flat configs. This can cause issues for ESLint's plugin normalization in some scenarios. This PR changes the default export to equal the plugin object.
I've added tests for this change, and I also added missing tests for the flat config exports.
Codecov Report
:white_check_mark: All modified and coverable lines are covered by tests.
:white_check_mark: Project coverage is 95.77%. Comparing base (01c9eb0) to head (12d770c).
Additional details and impacted files
@@ Coverage Diff @@
## main #3213 +/- ##
===========================================
+ Coverage 82.25% 95.77% +13.51%
===========================================
Files 94 83 -11
Lines 4283 3691 -592
Branches 1478 1332 -146
===========================================
+ Hits 3523 3535 +12
+ Misses 760 156 -604
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.
:rocket: New features to boost your workflow:
- :snowflake: Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
- :package: JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.
Is there a way to progress with this PR? It blocks usage of default configs with flat structure.
cc @ljharb