Skip to content

Commit 55b29fb

Browse files
authored
Updates prettier to latest version. (#51000)
There are some incoming docs / MDX changes where prettier will throw an error when using the older version. Updating prettier before I bring in those changes. Looks like the most notable change is adding parentheses around `typeof` checks in TypeScript. **Before** ``` export type Locale = typeof i18n['locales'][number] ``` **After** ``` export type Locale = (typeof i18n)['locales'][number] ```
1 parent 2a2890c commit 55b29fb

File tree

26 files changed

+51
-63
lines changed

26 files changed

+51
-63
lines changed

.prettierignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -40,3 +40,4 @@ bench/nested-deps/pages/**/*
4040
bench/nested-deps/components/**/*
4141

4242
**/convex/_generated/**
43+
**/.tina/__generated__/**

examples/app-dir-i18n-routing/i18n-config.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ export const i18n = {
33
locales: ['en', 'de', 'cs'],
44
} as const
55

6-
export type Locale = typeof i18n['locales'][number]
6+
export type Locale = (typeof i18n)['locales'][number]

examples/with-grafbase/gql/gql.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@ const documents = {
1111

1212
export function graphql(
1313
source: '\n query GetAllPosts($first: Int!) {\n postCollection(first: $first) {\n edges {\n node {\n id\n title\n slug\n }\n }\n }\n }\n'
14-
): typeof documents['\n query GetAllPosts($first: Int!) {\n postCollection(first: $first) {\n edges {\n node {\n id\n title\n slug\n }\n }\n }\n }\n']
14+
): (typeof documents)['\n query GetAllPosts($first: Int!) {\n postCollection(first: $first) {\n edges {\n node {\n id\n title\n slug\n }\n }\n }\n }\n']
1515
export function graphql(
1616
source: '\n query GetPostBySlug($slug: String!) {\n post(by: { slug: $slug }) {\n id\n title\n slug\n }\n }\n'
17-
): typeof documents['\n query GetPostBySlug($slug: String!) {\n post(by: { slug: $slug }) {\n id\n title\n slug\n }\n }\n']
17+
): (typeof documents)['\n query GetPostBySlug($slug: String!) {\n post(by: { slug: $slug }) {\n id\n title\n slug\n }\n }\n']
1818

1919
export function graphql(source: string): unknown
2020
export function graphql(source: string) {

examples/with-typescript-graphql/lib/gql/gql.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@ const documents = {
1111

1212
export function graphql(
1313
source: '\n mutation UpdateName($name: String!) {\n updateName(name: $name) {\n id\n name\n status\n }\n }\n'
14-
): typeof documents['\n mutation UpdateName($name: String!) {\n updateName(name: $name) {\n id\n name\n status\n }\n }\n']
14+
): (typeof documents)['\n mutation UpdateName($name: String!) {\n updateName(name: $name) {\n id\n name\n status\n }\n }\n']
1515
export function graphql(
1616
source: '\n query Viewer {\n viewer {\n id\n name\n status\n }\n }\n'
17-
): typeof documents['\n query Viewer {\n viewer {\n id\n name\n status\n }\n }\n']
17+
): (typeof documents)['\n query Viewer {\n viewer {\n id\n name\n status\n }\n }\n']
1818

1919
export function graphql(source: string): unknown
2020
export function graphql(source: string) {

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -194,7 +194,7 @@
194194
"postcss-pseudoelements": "5.0.0",
195195
"postcss-short-size": "4.0.0",
196196
"postcss-trolling": "0.1.7",
197-
"prettier": "2.5.1",
197+
"prettier": "2.8.8",
198198
"pretty-bytes": "5.3.0",
199199
"pretty-ms": "7.0.0",
200200
"random-seed": "0.3.0",

packages/create-next-app/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@
4747
"cross-spawn": "6.0.5",
4848
"glob": "8.0.3",
4949
"got": "10.7.0",
50-
"prettier-plugin-tailwindcss": "0.2.4",
50+
"prettier-plugin-tailwindcss": "0.3.0",
5151
"prompts": "2.1.0",
5252
"tar": "6.1.15",
5353
"update-check": "1.5.4",

packages/eslint-plugin-next/.swcrc

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
{
2-
"$schema": "https://json.schemastore.org/swcrc",
3-
"jsc": {
4-
"parser": {
5-
"syntax": "typescript"
6-
}
7-
},
8-
"module": {
9-
"type": "commonjs"
2+
"$schema": "https://json.schemastore.org/swcrc",
3+
"jsc": {
4+
"parser": {
5+
"syntax": "typescript"
106
}
11-
}
7+
},
8+
"module": {
9+
"type": "commonjs"
10+
}
11+
}

packages/next/src/build/webpack-build/impl.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ export async function webpackBuildImpl(
6262
duration: number
6363
pluginState: any
6464
turbotraceContext?: TurbotraceContext
65-
serializedPagesManifestEntries?: typeof NextBuildContext['serializedPagesManifestEntries']
65+
serializedPagesManifestEntries?: (typeof NextBuildContext)['serializedPagesManifestEntries']
6666
}> {
6767
let result: CompilerResult | null = {
6868
warnings: [],

packages/next/src/build/webpack/utils.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ export function traverseModules(
66
callback: (
77
mod: any,
88
chunk: webpack.Chunk,
9-
chunkGroup: typeof compilation.chunkGroups[0],
9+
chunkGroup: (typeof compilation.chunkGroups)[0],
1010
modId: string | number
1111
) => any
1212
) {

packages/next/src/client/image.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ if (typeof window === 'undefined') {
3535
}
3636

3737
const VALID_LOADING_VALUES = ['lazy', 'eager', undefined] as const
38-
type LoadingValue = typeof VALID_LOADING_VALUES[number]
38+
type LoadingValue = (typeof VALID_LOADING_VALUES)[number]
3939
type ImageConfig = ImageConfigComplete & {
4040
allSizes: number[]
4141
output?: 'standalone' | 'export'

0 commit comments

Comments
 (0)