diff --git a/packages/kit/src/resolve.ts b/packages/kit/src/resolve.ts index a9e6d3300bb..9964a904b4c 100644 --- a/packages/kit/src/resolve.ts +++ b/packages/kit/src/resolve.ts @@ -83,7 +83,7 @@ export async function resolvePath (path: string, opts: ResolvePathOptions = {}): /** * Try to resolve first existing file in paths */ -export async function findPath (paths: string|string[], opts?: ResolvePathOptions, pathType: 'file' | 'dir' = 'file'): Promise { +export async function findPath (paths: string | string[], opts?: ResolvePathOptions, pathType: 'file' | 'dir' = 'file'): Promise { if (!Array.isArray(paths)) { paths = [paths] } @@ -110,8 +110,8 @@ export function resolveAlias (path: string, alias?: Record): str } export interface Resolver { - resolve(...path: string[]): string - resolvePath(path: string, opts?: ResolvePathOptions): Promise + resolve (...path: string[]): string + resolvePath (path: string, opts?: ResolvePathOptions): Promise } /** diff --git a/packages/schema/src/config/common.ts b/packages/schema/src/config/common.ts index 6193aa28e75..c30c3f9ccbe 100644 --- a/packages/schema/src/config/common.ts +++ b/packages/schema/src/config/common.ts @@ -338,6 +338,7 @@ export default defineUntypedSchema({ $resolve: async (val, get) => [ '**/*.stories.{js,ts,jsx,tsx}', // ignore storybook files '**/*.{spec,test}.{js,ts,jsx,tsx}', // ignore tests + '**/*.d.ts', // ignore type declarations '.output', await get('ignorePrefix') && `**/${await get('ignorePrefix')}*.*` ].concat(val).filter(Boolean) diff --git a/test/fixtures/basic/plugins/test.d.ts b/test/fixtures/basic/plugins/test.d.ts new file mode 100644 index 00000000000..e47a00d69ab --- /dev/null +++ b/test/fixtures/basic/plugins/test.d.ts @@ -0,0 +1,2 @@ +interface MyInterface {} +export {}