Skip to content
This repository has been archived by the owner on Apr 6, 2023. It is now read-only.

fix(schema): add declarations to ignore list #8787

Merged
merged 4 commits into from Nov 9, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
6 changes: 3 additions & 3 deletions packages/kit/src/resolve.ts
Expand Up @@ -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<string|null> {
export async function findPath (paths: string | string[], opts?: ResolvePathOptions, pathType: 'file' | 'dir' = 'file'): Promise<string | null> {
if (!Array.isArray(paths)) {
paths = [paths]
}
Expand All @@ -110,8 +110,8 @@ export function resolveAlias (path: string, alias?: Record<string, string>): str
}

export interface Resolver {
resolve(...path: string[]): string
resolvePath(path: string, opts?: ResolvePathOptions): Promise<string>
resolve (...path: string[]): string
resolvePath (path: string, opts?: ResolvePathOptions): Promise<string>
}

/**
Expand Down
1 change: 1 addition & 0 deletions packages/schema/src/config/common.ts
Expand Up @@ -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)
Expand Down
2 changes: 2 additions & 0 deletions test/fixtures/basic/plugins/test.d.ts
@@ -0,0 +1,2 @@
interface MyInterface {}
export {}