Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(project): change how extends should be applied #516

Merged
merged 2 commits into from
Oct 13, 2023

Conversation

ematipico
Copy link
Member

Summary

Closes #343

When I implemented the feature, I implemented it with an incorrect assumption, where extends would override the current configuration.

Instead, extends should be computed first, and then on top of the result, we should apply the options of biome.json file.

To achieve this, I had to create a new method called merge_if_not_default. This was needed to avoid default values overriding what was computed from the extends.

Test Plan

I added a new test case, similar to the one of the issue that is closed. The snapshot shows that Biome format the code that correct options.

@ematipico ematipico temporarily deployed to Website deployment October 12, 2023 14:24 — with GitHub Actions Inactive
@github-actions github-actions bot added A-CLI Area: CLI A-Project Area: project A-Linter Area: linter A-Tooling Area: internal tools L-JavaScript Language: JavaScript and super languages labels Oct 12, 2023
@ematipico ematipico force-pushed the fix/extends-wrong-assumption branch from 449f22f to 2685c21 Compare October 12, 2023 14:24
@github-actions github-actions bot added A-Website Area: website A-Changelog Area: changelog labels Oct 12, 2023
@ematipico ematipico temporarily deployed to Website deployment October 12, 2023 14:26 — with GitHub Actions Inactive
@github-actions
Copy link
Contributor

Parser conformance results on

js/262

Test result main count This PR count Difference
Total 48863 48863 0
Passed 47808 47808 0
Failed 1055 1055 0
Panics 0 0 0
Coverage 97.84% 97.84% 0.00%

jsx/babel

Test result main count This PR count Difference
Total 40 40 0
Passed 37 37 0
Failed 3 3 0
Panics 0 0 0
Coverage 92.50% 92.50% 0.00%

symbols/microsoft

Test result main count This PR count Difference
Total 6212 6212 0
Passed 2030 2030 0
Failed 4182 4182 0
Panics 0 0 0
Coverage 32.68% 32.68% 0.00%

ts/babel

Test result main count This PR count Difference
Total 639 639 0
Passed 571 571 0
Failed 68 68 0
Panics 0 0 0
Coverage 89.36% 89.36% 0.00%

ts/microsoft

Test result main count This PR count Difference
Total 17224 17224 0
Passed 13123 13123 0
Failed 4101 4101 0
Panics 0 0 0
Coverage 76.19% 76.19% 0.00%

@ematipico ematipico force-pushed the fix/extends-wrong-assumption branch from 2685c21 to e478634 Compare October 12, 2023 14:55
@ematipico ematipico temporarily deployed to Website deployment October 12, 2023 14:55 — with GitHub Actions Inactive
@ematipico ematipico merged commit 7bfb323 into main Oct 13, 2023
18 checks passed
@ematipico ematipico deleted the fix/extends-wrong-assumption branch October 13, 2023 10:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
A-Changelog Area: changelog A-CLI Area: CLI A-Linter Area: linter A-Project Area: project A-Tooling Area: internal tools A-Website Area: website L-JavaScript Language: JavaScript and super languages
Projects
None yet
Development

Successfully merging this pull request may close these issues.

🐛 extends option not extending
1 participant