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

This commit is contained in:
Daniel Roe 2022-11-09 10:01:09 +01:00 committed by GitHub
parent 30d99477ce
commit 4e8f59bf70
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 6 additions and 3 deletions

View File

@ -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]
}
@ -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>
}
/**

View File

@ -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)

2
test/fixtures/basic/plugins/test.d.ts vendored Normal file
View File

@ -0,0 +1,2 @@
interface MyInterface {}
export {}