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: migrate prettier auto endofline to LF as it's the default #2145

Merged
merged 2 commits into from
Mar 22, 2024

Conversation

eMerzh
Copy link
Contributor

@eMerzh eMerzh commented Mar 20, 2024

Summary

I tried to migrate from prettier, and the migration failed because of unsupported option

#2138

Test Plan

you can migrate a prettierrc like this

{
	"printWidth": 120,
	"useTabs": true,
	"tabWidth": 2,
	"singleQuote": true,
	"semi": false,
	"trailingComma": "all",
	"bracketSameLine": false,
	"arrowParens": "avoid",
	"endOfLine": "auto"
}

I KNOW that auto won't be supported, but i think it's better for the UX to continue the flow with the best option possible instead of stopping in error

feel free to close if you disagree

@github-actions github-actions bot added the A-CLI Area: CLI label Mar 20, 2024
Copy link

netlify bot commented Mar 20, 2024

Deploy Preview for biomejs ready!

Name Link
🔨 Latest commit 8da4aa1
🔍 Latest deploy log https://app.netlify.com/sites/biomejs/deploys/65fd3c348c9a520008ee3bc8
😎 Deploy Preview https://deploy-preview-2145--biomejs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.
Lighthouse
Lighthouse
1 paths audited
Performance: 100 (🟢 up 4 from production)
Accessibility: 97 (no change from production)
Best Practices: 100 (no change from production)
SEO: 93 (no change from production)
PWA: -
View the detailed breakdown and full score reports

To edit notification comments on pull requests, go to your Netlify site configuration.

@arendjr
Copy link
Contributor

arendjr commented Mar 20, 2024

I think it’s a sensible approach. Just wondering if we should log a warning. What do you think, @ematipico ?

@ematipico
Copy link
Member

Yeah I think we should log a warning at least.

@eMerzh
Copy link
Contributor Author

eMerzh commented Mar 21, 2024

hum... as a nooob in rust i'm not really sure how should i do that...
not print like an animal right? I saw the console thingy but unsure how to trickel it down the transmformation 🤔
if someone could give a hint i can do that (or someone push it and i 🤓 )

@ematipico
Copy link
Member

@eMerzh I'll give you some pointers soon :)

@ematipico
Copy link
Member

Here

let prettier_configuration = deserialized.into_deserialized();
if let Some(prettier_configuration) = prettier_configuration {

You'll have to read the value of prettier_configuration.end_of_line and check it is equals to the new value you added. If so, than you should add something like this:

console.log(markup! {
	<Warn>"Warning message here"</Warn>
});

I leave the contents of the message to you

@eMerzh
Copy link
Contributor Author

eMerzh commented Mar 21, 2024

oh ok, as simple... :)
thanks for the help 🙌 ... i pushed an attempt then :)

@Sec-ant
Copy link
Member

Sec-ant commented Mar 22, 2024

LGTM. Thank you! Do you mind adding a changelog entry? You can check the instructions in CONTRIBUTING.md.

@Sec-ant
Copy link
Member

Sec-ant commented Mar 22, 2024

You'll also have to run just gen-web afterwards so the changelog file on website can be updated as well. :)

@eMerzh
Copy link
Contributor Author

eMerzh commented Mar 22, 2024

aaarg ...omg sorry sorry 😅

@github-actions github-actions bot added the A-Website Area: website label Mar 22, 2024
@Sec-ant
Copy link
Member

Sec-ant commented Mar 22, 2024

aaarg ...omg sorry sorry 😅

No worries! I tweaked a few places and added a test. Hope you don't mind.

@ematipico ematipico merged commit 3c389ba into biomejs:main Mar 22, 2024
12 checks passed
ematipico pushed a commit that referenced this pull request Mar 22, 2024
Co-authored-by: Ze-Zheng Wu <zezhengwu@proton.me>
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-Website Area: website
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants