Skip to content

Commit

Permalink
[ci] format
Browse files Browse the repository at this point in the history
  • Loading branch information
matthewp authored and astrobot-houston committed Sep 15, 2022
1 parent fc885ea commit c7c3cf7
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 9 deletions.
10 changes: 4 additions & 6 deletions packages/astro/src/core/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

/**
Expand Down
1 change: 0 additions & 1 deletion packages/astro/src/vite-plugin-config-alias/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down
4 changes: 2 additions & 2 deletions packages/astro/src/vite-plugin-jsx/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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> = {
Expand Down Expand Up @@ -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;
}
Expand Down

0 comments on commit c7c3cf7

Please sign in to comment.