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

chore: upgrade prettier to v3 #5346

Open
wants to merge 20 commits into
base: next
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 3 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
529 changes: 116 additions & 413 deletions .all-contributorsrc

Large diffs are not rendered by default.

10 changes: 5 additions & 5 deletions examples/.experimental/next-app-dir/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,13 @@
"incremental": true,
"plugins": [
{
"name": "next"
}
"name": "next",
},
],
"paths": {
"~/*": ["./src/*"]
}
"~/*": ["./src/*"],
},
},
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx", ".next/types/**/*.ts"],
"exclude": ["node_modules"]
"exclude": ["node_modules"],
}
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,8 @@ import type { z } from 'zod';
/**
* zod-form-data wraps zod in an effect where the original type is a `FormData`
*/
type UnwrapZodEffect<TType extends z.ZodType> = TType extends z.ZodEffects<
infer U,
any,
any
>
? U
: TType;
type UnwrapZodEffect<TType extends z.ZodType> =
TType extends z.ZodEffects<infer U, any, any> ? U : TType;

type GetInput<TType extends z.ZodType> = UnwrapZodEffect<TType>['_input'];

Expand Down
6 changes: 3 additions & 3 deletions examples/.experimental/next-formdata/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,11 @@
"incremental": true,
"baseUrl": ".",
"paths": {
"~/*": ["src/*"]
"~/*": ["src/*"],
},
"typeRoots": ["./node_modules/@types"],
"types": ["node"]
"types": ["node"],
},
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx"],
"exclude": ["node_modules"]
"exclude": ["node_modules"],
}
4 changes: 2 additions & 2 deletions examples/bun/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,6 @@
// best practices
"strict": true,
"forceConsistentCasingInFileNames": true,
"skipLibCheck": true
}
"skipLibCheck": true,
},
}
4 changes: 2 additions & 2 deletions examples/cloudflare-workers/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
"resolveJsonModule": true,
"esModuleInterop": true,
"isolatedModules": true,
"types": ["@cloudflare/workers-types"]
"types": ["@cloudflare/workers-types"],
},
"include": ["**/*.ts"],
"exclude": ["node_modules"]
"exclude": ["node_modules"],
}
4 changes: 2 additions & 2 deletions examples/express-minimal/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
"strict": true,
"moduleResolution": "node",
"noEmit": true,
"skipLibCheck": true
"skipLibCheck": true,
},
"include": ["src"],
"exclude": ["node_modules"]
"exclude": ["node_modules"],
}
4 changes: 2 additions & 2 deletions examples/express-server/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
"strict": true,
"moduleResolution": "node",
"noEmit": true,
"skipLibCheck": true
"skipLibCheck": true,
},
"include": ["src"],
"exclude": ["node_modules"]
"exclude": ["node_modules"],
}
4 changes: 2 additions & 2 deletions examples/fastify-server/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
"strict": true,
"moduleResolution": "node",
"noEmit": true,
"skipLibCheck": true
"skipLibCheck": true,
},
"include": ["src"],
"exclude": ["node_modules"]
"exclude": ["node_modules"],
}
4 changes: 2 additions & 2 deletions examples/lambda-api-gateway/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
"esModuleInterop": true,
"strict": true,
"moduleResolution": "node",
"noEmit": true
"noEmit": true,
},
"include": ["src"],
"exclude": ["node_modules"]
"exclude": ["node_modules"],
}
2 changes: 1 addition & 1 deletion examples/minimal-react/client/index.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<!DOCTYPE html>
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
Expand Down
4 changes: 2 additions & 2 deletions examples/minimal-react/client/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
"resolveJsonModule": true,
"isolatedModules": true,
"noEmit": true,
"jsx": "react-jsx"
"jsx": "react-jsx",
},
"include": ["src", "vite.config.ts"]
"include": ["src", "vite.config.ts"],
}
4 changes: 2 additions & 2 deletions examples/minimal-react/server/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,6 @@
"moduleResolution": "node",
"esModuleInterop": true,
"strict": true,
"outDir": "dist"
}
"outDir": "dist",
},
}
4 changes: 2 additions & 2 deletions examples/minimal/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"moduleResolution": "node",
"esModuleInterop": true,
"strict": true,
"outDir": "dist"
"outDir": "dist",
},
"include": ["server", "client"]
"include": ["server", "client"],
}
8 changes: 4 additions & 4 deletions examples/next-big-router/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,15 @@
"incremental": true,
"baseUrl": ".",
"paths": {
"~/*": ["src/*"]
}
"~/*": ["src/*"],
},
},
"include": [
"next-env.d.ts",
"**/*.ts",
"**/*.tsx",
"./*.js",
"./src/**/*.js"
"./src/**/*.js",
],
"exclude": ["node_modules"]
"exclude": ["node_modules"],
}
6 changes: 3 additions & 3 deletions examples/next-edge-runtime/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@
"incremental": true,
"baseUrl": ".",
"paths": {
"~/*": ["src/*"]
}
"~/*": ["src/*"],
},
},
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx"],
"exclude": ["node_modules"]
"exclude": ["node_modules"],
}
6 changes: 3 additions & 3 deletions examples/next-minimal-starter/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,9 @@
"incremental": true,
"baseUrl": ".",
"paths": {
"~/*": ["src/*"]
}
"~/*": ["src/*"],
},
},
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx"],
"exclude": ["node_modules"]
"exclude": ["node_modules"],
}
4 changes: 2 additions & 2 deletions examples/next-prisma-starter/src/pages/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,8 @@ const IndexPage: NextPageWithLayout = () => {
{postsQuery.isFetchingNextPage
? 'Loading more...'
: postsQuery.hasNextPage
? 'Load More'
: 'Nothing more to load'}
? 'Load More'
: 'Nothing more to load'}
</button>

{postsQuery.data?.pages.map((page, index) => (
Expand Down
8 changes: 4 additions & 4 deletions examples/next-prisma-starter/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -19,15 +19,15 @@
"baseUrl": ".",
"types": ["vitest/globals"],
"paths": {
"~/*": ["src/*"]
}
"~/*": ["src/*"],
},
},
"include": [
"next-env.d.ts",
"**/*.ts",
"**/*.tsx",
"./*.js",
"./src/**/*.js"
"./src/**/*.js",
],
"exclude": ["node_modules"]
"exclude": ["node_modules"],
}
8 changes: 3 additions & 5 deletions examples/next-prisma-todomvc/src/pages/[filter].tsx
Original file line number Diff line number Diff line change
Expand Up @@ -250,12 +250,10 @@ export default function TodosPage(props: PageProps) {
props.filter === 'completed'
? completed
: props.filter === 'active'
? !completed
: true,
? !completed
: true,
)
.map((task) => (
<ListItem key={task.id} task={task} />
))}
.map((task) => <ListItem key={task.id} task={task} />)}
</ul>
</section>

Expand Down
8 changes: 4 additions & 4 deletions examples/next-prisma-todomvc/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,16 +17,16 @@
"incremental": true,
"baseUrl": ".",
"paths": {
"~/*": ["./src/*"]
"~/*": ["./src/*"],
},
"forceConsistentCasingInFileNames": true
"forceConsistentCasingInFileNames": true,
},
"include": [
"next-env.d.ts",
"**/*.ts",
"**/*.tsx",
"next.config.js",
"next-i18next.config.js"
"next-i18next.config.js",
],
"exclude": ["node_modules"]
"exclude": ["node_modules"],
}
4 changes: 2 additions & 2 deletions examples/next-prisma-websockets-starter/src/pages/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -255,8 +255,8 @@ export default function IndexPage() {
{isFetchingNextPage
? 'Loading more...'
: hasNextPage
? 'Load More'
: 'Nothing more to load'}
? 'Load More'
: 'Nothing more to load'}
</button>
<div className="space-y-4">
{messages?.map((item) => (
Expand Down
4 changes: 2 additions & 2 deletions examples/next-prisma-websockets-starter/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@
"isolatedModules": true,
"jsx": "preserve",
"baseUrl": "./src",
"incremental": true
"incremental": true,
},
"include": ["next-env.d.ts", "**/*.ts", "**/*.tsx"],
"exclude": ["node_modules"]
"exclude": ["node_modules"],
}
4 changes: 2 additions & 2 deletions examples/soa/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"moduleResolution": "node",
"esModuleInterop": true,
"strict": true,
"outDir": "dist"
"outDir": "dist",
},
"include": ["**/*.ts"]
"include": ["**/*.ts"],
}
4 changes: 2 additions & 2 deletions examples/standalone-server/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
"strict": true,
"moduleResolution": "node",
"noEmit": true,
"skipLibCheck": true
"skipLibCheck": true,
},
"include": ["src"],
"exclude": ["node_modules"]
"exclude": ["node_modules"],
}
4 changes: 2 additions & 2 deletions examples/vercel-edge-runtime/tsconfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@
"resolveJsonModule": true,
"esModuleInterop": true,
"isolatedModules": true,
"types": ["@edge-runtime/types"]
"types": ["@edge-runtime/types"],
},
"include": ["**/*.ts"],
"exclude": ["node_modules"]
"exclude": ["node_modules"],
}
7 changes: 3 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@
"dependencies": {
"@actions/core": "^1.10.1",
"@actions/github": "^6.0.0",
"@ianvs/prettier-plugin-sort-imports": "^4.0.0",
"@ianvs/prettier-plugin-sort-imports": "^4.1.1",
"@manypkg/cli": "^0.21.2",
"@rollup/plugin-node-resolve": "^15.0.2",
"@swc/core": "1.3.3",
Expand All @@ -50,7 +50,6 @@
"@testing-library/react": "^14.0.0",
"@testing-library/user-event": "^14.4.3",
"@types/node": "^20.10.0",
"@types/prettier": "^2.7.2",
"@typescript-eslint/eslint-plugin": "^6.2.1",
"@typescript-eslint/parser": "^6.2.1",
"eslint": "^8.40.0",
Expand All @@ -65,8 +64,8 @@
"hash-sum": "^2.0.0",
"lerna": "^8.0.0",
"npm-run-all": "^4.1.5",
"prettier": "^2.8.8",
"prettier-plugin-tailwindcss": "^0.4.0",
"prettier": "^3.2.3",
"prettier-plugin-tailwindcss": "^0.5.11",
"rollup": "^2.79.1",
"rollup-plugin-analyzer": "^4.0.0",
"rollup-plugin-delete": "^2.0.0",
Expand Down
20 changes: 10 additions & 10 deletions packages/client/src/createTRPCClient.ts
Original file line number Diff line number Diff line change
Expand Up @@ -61,14 +61,14 @@ type DecorateProcedure<
query: Resolver<TConfig, TProcedure>;
}
: TProcedure extends AnyMutationProcedure
? {
mutate: Resolver<TConfig, TProcedure>;
}
: TProcedure extends AnySubscriptionProcedure
? {
subscribe: SubscriptionResolver<TConfig, TProcedure>;
}
: never;
? {
mutate: Resolver<TConfig, TProcedure>;
}
: TProcedure extends AnySubscriptionProcedure
? {
subscribe: SubscriptionResolver<TConfig, TProcedure>;
}
: never;

/**
* @internal
Expand All @@ -80,8 +80,8 @@ type DecoratedProcedureRecord<
[TKey in keyof TProcedures]: TProcedures[TKey] extends AnyRouter
? DecoratedProcedureRecord<TRouter, TProcedures[TKey]['_def']['record']>
: TProcedures[TKey] extends AnyProcedure
? DecorateProcedure<TRouter['_def']['_config'], TProcedures[TKey]>
: never;
? DecorateProcedure<TRouter['_def']['_config'], TProcedures[TKey]>
: never;
};

const clientCallTypeMap: Record<
Expand Down