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 Nov 17, 2022
1 parent 1ab5058 commit 539ee17
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
4 changes: 2 additions & 2 deletions packages/astro/src/core/config/vite-load.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@ import type fsType from 'fs';
import npath from 'path';
import { pathToFileURL } from 'url';
import * as vite from 'vite';
import { AstroError, AstroErrorData } from '../errors/index.js';
import loadFallbackPlugin from '../../vite-plugin-load-fallback/index.js';
import { AstroError, AstroErrorData } from '../errors/index.js';

// Fallback for legacy
import load from '@proload/core';
Expand All @@ -28,7 +28,7 @@ async function createViteLoader(root: string, fs: typeof fsType): Promise<ViteLo
// avoid `vite.createServer` and use `loadConfigFromFile` instead.
external: ['@astrojs/tailwind', '@astrojs/mdx', '@astrojs/react'],
},
plugins: [ loadFallbackPlugin({ fs, root: pathToFileURL(root) })]
plugins: [loadFallbackPlugin({ fs, root: pathToFileURL(root) })],
});

return {
Expand Down
5 changes: 2 additions & 3 deletions packages/astro/src/vite-plugin-load-fallback/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ import nodeFs from 'fs';
import npath from 'path';
import slashify from 'slash';
import type * as vite from 'vite';
import type { AstroSettings } from '../@types/astro';

type NodeFileSystemModule = typeof nodeFs;

Expand Down Expand Up @@ -49,11 +48,11 @@ export default function loadFallbackPlugin({
try {
// Check to see if this file exists and is not a directory.
const stats = await fs.promises.stat(candidateId);
if(!stats.isDirectory()) {
if (!stats.isDirectory()) {
return candidateId;
}
} catch {}
}
}

let resolved = await this.resolve(id, parent, { skipSelf: true });
if (resolved) {
Expand Down
11 changes: 6 additions & 5 deletions packages/astro/test/units/config/format.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@ import { expect } from 'chai';
import * as cheerio from 'cheerio';
import { fileURLToPath } from 'url';

import {
runInContainer,
} from '../../../dist/core/dev/index.js';
import { runInContainer } from '../../../dist/core/dev/index.js';
import { openConfig, createSettings } from '../../../dist/core/config/index.js';
import { createFs } from '../test-utils.js';
import { defaultLogging } from '../../test-utils.js';
Expand All @@ -30,12 +28,15 @@ describe('Astro config formats', () => {
flags: {},
cmd: 'dev',
logging: defaultLogging,
fsMod: fs
fsMod: fs,
});
const settings = createSettings(astroConfig);

await runInContainer({ fs, root, settings }, () => {
expect(true).to.equal(true, 'We were able to get into the container which means the config loaded.');
expect(true).to.equal(
true,
'We were able to get into the container which means the config loaded.'
);
});
});
});

0 comments on commit 539ee17

Please sign in to comment.