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

feat: add import order sorting via prettier #1392

Merged
merged 26 commits into from
May 17, 2023

Conversation

FinnDore
Copy link
Contributor

Closes #1332

βœ… Checklist

  • I have followed every step in the contributing guide (updated 2022-10-06).
  • The PR title follows the convention we established conventional-commit
  • I performed a functional test on my final commit

Changelog

Added @ianvs/prettier-plugin-sort-import to the cli, docs and generated cta apps


Screenshots

it also seems to format code blocks which is cool
image

πŸ’―

@changeset-bot
Copy link

changeset-bot bot commented Apr 29, 2023

⚠️ No Changeset found

Latest commit: ab01b4d

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

This PR includes no changesets

When changesets are added to this PR, you'll see the packages that this PR includes changesets for and the associated semver types

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@vercel
Copy link

vercel bot commented Apr 29, 2023

The latest updates on your projects. Learn more about Vercel for Git β†—οΈŽ

Name Status Preview Comments Updated (UTC)
create-t3-app βœ… Ready (Inspect) Visit Preview πŸ’¬ Add feedback May 16, 2023 6:11pm

@github-actions
Copy link
Contributor

github-actions bot commented Apr 29, 2023

Hey t3-oss/translators!

This PR contains changes to your language. Please review the changes ❀️.

@FinnDore
Copy link
Contributor Author

need to actually test this on a generated app

@github-actions github-actions bot added πŸ“Œ area: cli Relates to the CLI πŸ“Œ area: t3-app Relates to the generated T3 App πŸ“š documentation Improvements or additions to documentation labels Apr 29, 2023
@FinnDore
Copy link
Contributor Author

FinnDore commented Apr 29, 2023

image

Slight mis calculation, the base cta app does not actually include prettier....

we dont just want this to be available if you chose tailwind, however iirc the choice was made not to include prettier by default.

@iAverages
Copy link
Contributor

Slight mis calculation, the base cta app does not actually include prettier....
we dont just want this to be available if you chose tailwind, however iirc the choice was made not to include prettier by default.

It should be pretty easy to add an option for prettier since it just needs installing + a single config. None of the other files change. I think that would probably be the best option here if installing it by default is a no go.

@c-ehrlich
Copy link
Member

IMO we should have this either everywhere or nowhere. Limiting it to apps with Tailwind makes no sense. This would obviously mean including Prettier with all apps, but I think it might be worth it.

So I see three options:

  1. Don't implement this
  2. Ship a minimal prettier config to everyone
  3. Add an option in the CLI that gives an opinionated prettier+eslint config

@juliusmarminge
Copy link
Member

I think i vote 3

@FinnDore
Copy link
Contributor Author

FinnDore commented May 1, 2023

What would change about the eslint config? The default cta one has served my just fine tbh

@juliusmarminge
Copy link
Member

juliusmarminge commented May 1, 2023

What would change about the eslint config? The default cta one has served my just fine tbh

It would be either on or off i guess? Maybe add the prettier eslint config

We can add this too i think #1197

@FinnDore
Copy link
Contributor Author

FinnDore commented May 1, 2023

yeah that sounds good. will have a crack and we can see if its any good. A bit dubious of adding to many options.

@vercel
Copy link

vercel bot commented May 5, 2023

@FinnDore is attempting to deploy a commit to the t3-oss Team on Vercel.

A member of the Team first needs to authorize it.

@FinnDore
Copy link
Contributor Author

FinnDore commented May 5, 2023

Think its done ( disregarding the sea of lint errors ). Im debating wether it should be prettierAndStrictEslint rather than strictPrettierAndEslint. or even if there should be two options?

I welcome thaughts.

@FinnDore
Copy link
Contributor Author

Removed the require.resolve from the tailwind prettier config as im not sure why it was needed, seems to work, somone lmk if its actually needed

@FinnDore
Copy link
Contributor Author

Tested this all and i think its good to go now. although i thought that 4 days ago so im ready to be proven wrong.

@juliusmarminge
Copy link
Member

Instead of having this as an installer next to the other pacakges, do you tihnk it'd be better to have like

? What pacakges would you like...
  o nextAuth
  ...

? Would you like to enable a more opinionated eslint+prettier setup?
  x yes o no

@FinnDore
Copy link
Contributor Author

Good shout, maybe the wording should different though as it sounds like a more strict prettier config is added aswell which is wrong

@FinnDore
Copy link
Contributor Author

I should probably update the ci aswell....

@FinnDore
Copy link
Contributor Author

cant tell if ive borked the e2e workflow file or if it need approval to run since ive changes it

@juliusmarminge
Copy link
Member

Merging to intermediate branch to release a canary

@juliusmarminge juliusmarminge merged commit e1a5245 into t3-oss:finn/prettier May 17, 2023
4 of 6 checks passed
juliusmarminge added a commit that referenced this pull request May 17, 2023
juliusmarminge added a commit that referenced this pull request May 17, 2023
@juliusmarminge
Copy link
Member

juliusmarminge commented May 17, 2023

bruh - based the intermediate branch off the wrong thing...

can you reopen πŸ˜„

open against the branch finn/eslint-prettier

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
πŸ“Œ area: ci Relates to CI / GitHub Actions πŸ“Œ area: cli Relates to the CLI πŸ“Œ area: t3-app Relates to the generated T3 App πŸ“š documentation Improvements or additions to documentation
Projects
None yet
Development

Successfully merging this pull request may close these issues.

feat: Opinionated import order
5 participants