summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--packages/astro/src/core/config.ts10
-rw-r--r--packages/astro/src/vite-plugin-config-alias/index.ts1
-rw-r--r--packages/astro/src/vite-plugin-jsx/index.ts4
3 files changed, 6 insertions, 9 deletions
diff --git a/packages/astro/src/core/config.ts b/packages/astro/src/core/config.ts
index 3aa820835..58650613e 100644
--- a/packages/astro/src/core/config.ts
+++ b/packages/astro/src/core/config.ts
@@ -554,16 +554,14 @@ async function tryLoadConfig(
}
}
-function loadTSConfig(
- cwd: string | undefined
-): tsr.TsConfigResult | undefined {
- for(const searchName of ['tsconfig.json', 'jsconfig.json']) {
+function loadTSConfig(cwd: string | undefined): tsr.TsConfigResult | undefined {
+ for (const searchName of ['tsconfig.json', 'jsconfig.json']) {
const config = tsr.tsconfigResolverSync({ cwd, searchName });
- if(config.exists) {
+ if (config.exists) {
return config;
}
}
- return undefined
+ return undefined;
}
/**
diff --git a/packages/astro/src/vite-plugin-config-alias/index.ts b/packages/astro/src/vite-plugin-config-alias/index.ts
index 62f5abd98..4a9923eda 100644
--- a/packages/astro/src/vite-plugin-config-alias/index.ts
+++ b/packages/astro/src/vite-plugin-config-alias/index.ts
@@ -12,7 +12,6 @@ export declare interface Alias {
/** Returns a path with its slashes replaced with posix slashes. */
const normalize = (pathname: string) => String(pathname).split(path.sep).join(path.posix.sep);
-
/** Returns a list of compiled aliases. */
const getConfigAlias = (astroConfig: AstroConfig): Alias[] | null => {
/** Closest tsconfig.json or jsconfig.json */
diff --git a/packages/astro/src/vite-plugin-jsx/index.ts b/packages/astro/src/vite-plugin-jsx/index.ts
index 9f42b0fa9..de9eb3d94 100644
--- a/packages/astro/src/vite-plugin-jsx/index.ts
+++ b/packages/astro/src/vite-plugin-jsx/index.ts
@@ -16,7 +16,7 @@ import tagExportsPlugin from './tag.js';
type FixedCompilerOptions = TsConfigJson.CompilerOptions & {
jsxImportSource?: string;
-}
+};
const JSX_EXTENSIONS = new Set(['.jsx', '.tsx', '.mdx']);
const IMPORT_STATEMENTS: Record<string, string> = {
@@ -229,7 +229,7 @@ export default function jsx({ config, logging }: AstroPluginJSXOptions): Plugin
}
// Check the tsconfig
- if(!importSource) {
+ if (!importSource) {
const compilerOptions = config._ctx.tsConfig?.compilerOptions;
importSource = (compilerOptions as FixedCompilerOptions | undefined)?.jsxImportSource;
}