From eee1094717e52364a27603fb2c4331d6f92896bd Mon Sep 17 00:00:00 2001 From: Daniel Roe Date: Mon, 7 Nov 2022 22:44:17 +0100 Subject: [PATCH 1/4] style: lint some types --- packages/kit/src/resolve.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) 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 } /** From 3d86e896efd50b2d649a9718012575fab3016146 Mon Sep 17 00:00:00 2001 From: Daniel Roe Date: Mon, 7 Nov 2022 22:44:36 +0100 Subject: [PATCH 2/4] fix(schema): add declarations to ignore list --- packages/schema/src/config/common.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/packages/schema/src/config/common.ts b/packages/schema/src/config/common.ts index 6193aa28e75..bfcf49639fa 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) From f700a12f70e65ecc9c9ab5d62138a345fce46bf2 Mon Sep 17 00:00:00 2001 From: Daniel Roe Date: Mon, 7 Nov 2022 22:55:34 +0100 Subject: [PATCH 3/4] test: add would-be failing test --- test/fixtures/basic/plugins/test.d.ts | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 test/fixtures/basic/plugins/test.d.ts 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 {} From 9b80b35c1695d0ea733f37fa14e2b91a0da84d4f Mon Sep 17 00:00:00 2001 From: Daniel Roe Date: Mon, 7 Nov 2022 23:13:20 +0100 Subject: [PATCH 4/4] fix: add missing glob --- packages/schema/src/config/common.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/schema/src/config/common.ts b/packages/schema/src/config/common.ts index bfcf49639fa..c30c3f9ccbe 100644 --- a/packages/schema/src/config/common.ts +++ b/packages/schema/src/config/common.ts @@ -338,7 +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 + '**/*.d.ts', // ignore type declarations '.output', await get('ignorePrefix') && `**/${await get('ignorePrefix')}*.*` ].concat(val).filter(Boolean)