-
Notifications
You must be signed in to change notification settings - Fork 1.1k
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
juliusmarminge
merged 26 commits into
t3-oss:finn/prettier
from
FinnDore:prettier-import-order
May 17, 2023
Merged
Changes from 1 commit
Commits
Show all changes
26 commits
Select commit
Hold shift + click to select a range
b0f3b8b
added import order sorting
FinnDore d816992
cli format
FinnDore 1149c08
format www
FinnDore 882177e
.
FinnDore 760614a
done?
FinnDore d955bc2
lint
FinnDore 28ced02
we do a little reverse
FinnDore ff5643f
fixed format:check writing
FinnDore 75f09f9
smoll changes
FinnDore 8fbb67d
Merge commit '1e4c2d352e9b42e0f48c98980714c5334bfd06d7' into prettier…
FinnDore 68bd141
split out installers
FinnDore 4ee772f
removed eslint from base project
FinnDore 01de8cd
added eslint back
FinnDore aa79698
formatting
FinnDore c14ca2a
fixed linting
FinnDore 86d07ed
fixed base project
FinnDore d37d813
rip ci time
FinnDore f0b4089
Update cli/template/extras/config/_prettier.config.cjs
juliusmarminge a665f39
need to test this but.
FinnDore 976d21d
Merge branch 'prettier-import-order' of https://github.com/FinnDore/c…
FinnDore db03947
removed uneeded resolve
FinnDore 63fad92
docs update
FinnDore 02b64de
Moved over to a seperate prompt
FinnDore 7e77640
yuh
FinnDore f16ce44
spelling
FinnDore ab01b4d
this?
FinnDore File filter
Filter by extension
Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
lint
- Loading branch information
commit d955bc2b92f9de9118103b5862104cf889089180
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
1 change: 0 additions & 1 deletion
1
cli/template/extras/src/server/api/routers/example/with-auth-prisma.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,4 @@ | ||
import { z } from "zod"; | ||
|
||
import { | ||
createTRPCRouter, | ||
publicProcedure, | ||
|
1 change: 0 additions & 1 deletion
1
cli/template/extras/src/server/api/routers/example/with-auth.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,4 @@ | ||
import { z } from "zod"; | ||
|
||
import { | ||
createTRPCRouter, | ||
publicProcedure, | ||
|
1 change: 0 additions & 1 deletion
1
cli/template/extras/src/server/api/routers/example/with-prisma.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,7 +14,18 @@ | |
* | ||
* These allow you to access things when processing a request, like the database, the session, etc. | ||
*/ | ||
|
||
/** | ||
* 2. INITIALIZATION | ||
* | ||
* This is where the tRPC API is initialized, connecting the context and transformer. We also parse | ||
* ZodErrors so that you get typesafety on the frontend if your procedure fails due to validation | ||
* errors on the backend. | ||
*/ | ||
import { initTRPC } from "@trpc/server"; | ||
import { type CreateNextContextOptions } from "@trpc/server/adapters/next"; | ||
import superjson from "superjson"; | ||
import { ZodError } from "zod"; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. same here - wish it didn't move these imports when they are clearly separated :/ we'll have to look over the comments cause those should not be moved |
||
|
||
/** Replace this with an object if you want to pass things to `createContextInner`. */ | ||
type CreateContextOptions = Record<string, never>; | ||
|
@@ -43,17 +54,6 @@ export const createTRPCContext = (_opts: CreateNextContextOptions) => { | |
return createInnerTRPCContext({}); | ||
}; | ||
|
||
/** | ||
* 2. INITIALIZATION | ||
* | ||
* This is where the tRPC API is initialized, connecting the context and transformer. We also parse | ||
* ZodErrors so that you get typesafety on the frontend if your procedure fails due to validation | ||
* errors on the backend. | ||
*/ | ||
import { initTRPC } from "@trpc/server"; | ||
import superjson from "superjson"; | ||
import { ZodError } from "zod"; | ||
|
||
const t = initTRPC.context<typeof createTRPCContext>().create({ | ||
transformer: superjson, | ||
errorFormatter({ shape, error }) { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i wish import sorters didn't move imports when they are separated by actual code blocks...
is there a setting for this?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks like you can
//prettier-ignore
lines but thats about it :/