mirror of
https://github.com/nuxt/nuxt.git
synced 2025-02-18 06:31:27 +00:00
fix(schema): add declarations to ignore list (#8787)
This commit is contained in:
parent
30d99477ce
commit
4e8f59bf70
@ -83,7 +83,7 @@ export async function resolvePath (path: string, opts: ResolvePathOptions = {}):
|
|||||||
/**
|
/**
|
||||||
* Try to resolve first existing file in paths
|
* 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)) {
|
if (!Array.isArray(paths)) {
|
||||||
paths = [paths]
|
paths = [paths]
|
||||||
}
|
}
|
||||||
@ -110,8 +110,8 @@ export function resolveAlias (path: string, alias?: Record<string, string>): str
|
|||||||
}
|
}
|
||||||
|
|
||||||
export interface Resolver {
|
export interface Resolver {
|
||||||
resolve(...path: string[]): string
|
resolve (...path: string[]): string
|
||||||
resolvePath(path: string, opts?: ResolvePathOptions): Promise<string>
|
resolvePath (path: string, opts?: ResolvePathOptions): Promise<string>
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -338,6 +338,7 @@ export default defineUntypedSchema({
|
|||||||
$resolve: async (val, get) => [
|
$resolve: async (val, get) => [
|
||||||
'**/*.stories.{js,ts,jsx,tsx}', // ignore storybook files
|
'**/*.stories.{js,ts,jsx,tsx}', // ignore storybook files
|
||||||
'**/*.{spec,test}.{js,ts,jsx,tsx}', // ignore tests
|
'**/*.{spec,test}.{js,ts,jsx,tsx}', // ignore tests
|
||||||
|
'**/*.d.ts', // ignore type declarations
|
||||||
'.output',
|
'.output',
|
||||||
await get('ignorePrefix') && `**/${await get('ignorePrefix')}*.*`
|
await get('ignorePrefix') && `**/${await get('ignorePrefix')}*.*`
|
||||||
].concat(val).filter(Boolean)
|
].concat(val).filter(Boolean)
|
||||||
|
2
test/fixtures/basic/plugins/test.d.ts
vendored
Normal file
2
test/fixtures/basic/plugins/test.d.ts
vendored
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
interface MyInterface {}
|
||||||
|
export {}
|
Loading…
Reference in New Issue
Block a user