summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGravatar bluwy <bluwy@users.noreply.github.com> 2023-01-09 07:27:31 +0000
committerGravatar fredkbot <fred+astrobot@astro.build> 2023-01-09 07:27:31 +0000
commita673239548d769771f7ec20c222dc4f62c14a500 (patch)
treefef94c28bf73e7bbf137e07a86edfe0be0271406
parent0be2d0dbc2325d5979a990c6cdc71025b71ea2f3 (diff)
downloadastro-a673239548d769771f7ec20c222dc4f62c14a500.tar.gz
astro-a673239548d769771f7ec20c222dc4f62c14a500.tar.zst
astro-a673239548d769771f7ec20c222dc4f62c14a500.zip
[ci] format
-rw-r--r--examples/docs/src/config.ts2
-rw-r--r--examples/docs/src/languages.ts2
-rw-r--r--examples/with-content/src/content/types.generated.d.ts12
-rw-r--r--packages/astro/src/@types/astro.ts2
-rw-r--r--packages/astro/src/content/template/types.generated.d.ts12
-rw-r--r--packages/astro/src/core/errors/errors-data.ts2
6 files changed, 16 insertions, 16 deletions
diff --git a/examples/docs/src/config.ts b/examples/docs/src/config.ts
index 8ca1b577c..744c93ca1 100644
--- a/examples/docs/src/config.ts
+++ b/examples/docs/src/config.ts
@@ -42,7 +42,7 @@ export const ALGOLIA = {
};
export type Sidebar = Record<
- typeof KNOWN_LANGUAGE_CODES[number],
+ (typeof KNOWN_LANGUAGE_CODES)[number],
Record<string, { text: string; link: string }[]>
>;
export const SIDEBAR: Sidebar = {
diff --git a/examples/docs/src/languages.ts b/examples/docs/src/languages.ts
index 405b6921c..b44d2ba86 100644
--- a/examples/docs/src/languages.ts
+++ b/examples/docs/src/languages.ts
@@ -6,5 +6,5 @@ export const langPathRegex = /\/([a-z]{2}-?[A-Z]{0,2})\//;
export function getLanguageFromURL(pathname: string) {
const langCodeMatch = pathname.match(langPathRegex);
const langCode = langCodeMatch ? langCodeMatch[1] : 'en';
- return langCode as typeof KNOWN_LANGUAGE_CODES[number];
+ return langCode as (typeof KNOWN_LANGUAGE_CODES)[number];
}
diff --git a/examples/with-content/src/content/types.generated.d.ts b/examples/with-content/src/content/types.generated.d.ts
index 906aabb75..a5247b7e4 100644
--- a/examples/with-content/src/content/types.generated.d.ts
+++ b/examples/with-content/src/content/types.generated.d.ts
@@ -1,7 +1,7 @@
declare module 'astro:content' {
export { z } from 'astro/zod';
export type CollectionEntry<C extends keyof typeof entryMap> =
- typeof entryMap[C][keyof typeof entryMap[C]] & Render;
+ (typeof entryMap)[C][keyof (typeof entryMap)[C]] & Render;
type BaseCollectionConfig<S extends import('astro/zod').ZodRawShape> = {
schema?: S;
@@ -17,17 +17,17 @@ declare module 'astro:content' {
input: BaseCollectionConfig<S>
): BaseCollectionConfig<S>;
- export function getEntry<C extends keyof typeof entryMap, E extends keyof typeof entryMap[C]>(
+ export function getEntry<C extends keyof typeof entryMap, E extends keyof (typeof entryMap)[C]>(
collection: C,
entryKey: E
- ): Promise<typeof entryMap[C][E] & Render>;
+ ): Promise<(typeof entryMap)[C][E] & Render>;
export function getCollection<
C extends keyof typeof entryMap,
- E extends keyof typeof entryMap[C]
+ E extends keyof (typeof entryMap)[C]
>(
collection: C,
- filter?: (data: typeof entryMap[C][E]) => boolean
- ): Promise<(typeof entryMap[C][E] & Render)[]>;
+ filter?: (data: (typeof entryMap)[C][E]) => boolean
+ ): Promise<((typeof entryMap)[C][E] & Render)[]>;
type InferEntrySchema<C extends keyof typeof entryMap> = import('astro/zod').infer<
import('astro/zod').ZodObject<Required<ContentConfig['collections'][C]>['schema']>
diff --git a/packages/astro/src/@types/astro.ts b/packages/astro/src/@types/astro.ts
index 872abeaf8..a0623f5cd 100644
--- a/packages/astro/src/@types/astro.ts
+++ b/packages/astro/src/@types/astro.ts
@@ -239,7 +239,7 @@ export interface AstroGlobal<Props extends Record<string, any> = Record<string,
}
/** Union type of supported markdown file extensions */
-type MarkdowFileExtension = typeof SUPPORTED_MARKDOWN_FILE_EXTENSIONS[number];
+type MarkdowFileExtension = (typeof SUPPORTED_MARKDOWN_FILE_EXTENSIONS)[number];
export interface AstroGlobalPartial {
/**
diff --git a/packages/astro/src/content/template/types.generated.d.ts b/packages/astro/src/content/template/types.generated.d.ts
index 0edf3dcd2..1579016db 100644
--- a/packages/astro/src/content/template/types.generated.d.ts
+++ b/packages/astro/src/content/template/types.generated.d.ts
@@ -1,7 +1,7 @@
declare module 'astro:content' {
export { z } from 'astro/zod';
export type CollectionEntry<C extends keyof typeof entryMap> =
- typeof entryMap[C][keyof typeof entryMap[C]] & Render;
+ (typeof entryMap)[C][keyof (typeof entryMap)[C]] & Render;
type BaseCollectionConfig<S extends import('astro/zod').ZodRawShape> = {
schema?: S;
@@ -17,17 +17,17 @@ declare module 'astro:content' {
input: BaseCollectionConfig<S>
): BaseCollectionConfig<S>;
- export function getEntry<C extends keyof typeof entryMap, E extends keyof typeof entryMap[C]>(
+ export function getEntry<C extends keyof typeof entryMap, E extends keyof (typeof entryMap)[C]>(
collection: C,
entryKey: E
- ): Promise<typeof entryMap[C][E] & Render>;
+ ): Promise<(typeof entryMap)[C][E] & Render>;
export function getCollection<
C extends keyof typeof entryMap,
- E extends keyof typeof entryMap[C]
+ E extends keyof (typeof entryMap)[C]
>(
collection: C,
- filter?: (data: typeof entryMap[C][E]) => boolean
- ): Promise<(typeof entryMap[C][E] & Render)[]>;
+ filter?: (data: (typeof entryMap)[C][E]) => boolean
+ ): Promise<((typeof entryMap)[C][E] & Render)[]>;
type InferEntrySchema<C extends keyof typeof entryMap> = import('astro/zod').infer<
import('astro/zod').ZodObject<Required<ContentConfig['collections'][C]>['schema']>
diff --git a/packages/astro/src/core/errors/errors-data.ts b/packages/astro/src/core/errors/errors-data.ts
index d33690ff8..c1aa021d5 100644
--- a/packages/astro/src/core/errors/errors-data.ts
+++ b/packages/astro/src/core/errors/errors-data.ts
@@ -613,5 +613,5 @@ See https://docs.astro.build/en/guides/server-side-rendering/ for more informati
type ValueOf<T> = T[keyof T];
export type AstroErrorCodes = ValueOf<{
- [T in keyof typeof AstroErrorData]: typeof AstroErrorData[T]['code'];
+ [T in keyof typeof AstroErrorData]: (typeof AstroErrorData)[T]['code'];
}>;