From daa0eed851300e83968bec0cd5871e8757c90e20 Mon Sep 17 00:00:00 2001 From: st3h3n Date: Fri, 7 Feb 2025 19:00:08 +0100 Subject: [PATCH] fix: Use path triple slash directive for types that are referenced via path (#1407) Co-authored-by: Stefan Hensel --- docs/guide/essentials/config/typescript.md | 2 +- packages/wxt/e2e/tests/auto-imports.test.ts | 14 +++++++------- packages/wxt/e2e/tests/typescript-project.test.ts | 8 ++++---- packages/wxt/src/core/generate-wxt-dir.ts | 2 +- 4 files changed, 13 insertions(+), 13 deletions(-) diff --git a/docs/guide/essentials/config/typescript.md b/docs/guide/essentials/config/typescript.md index be220883..8d939e2e 100644 --- a/docs/guide/essentials/config/typescript.md +++ b/docs/guide/essentials/config/typescript.md @@ -14,7 +14,7 @@ At a minimum, you need to create a TSConfig in your root directory that looks li Or if you're in a monorepo, you may not want to extend the config. If you don't extend it, you need to add `.wxt/wxt.d.ts` to the TypeScript project: ```ts -/// +/// ``` ## Compiler Options diff --git a/packages/wxt/e2e/tests/auto-imports.test.ts b/packages/wxt/e2e/tests/auto-imports.test.ts index f8b58e4e..144b972e 100644 --- a/packages/wxt/e2e/tests/auto-imports.test.ts +++ b/packages/wxt/e2e/tests/auto-imports.test.ts @@ -52,10 +52,10 @@ describe('Auto Imports', () => { ---------------------------------------- // Generated by wxt /// - /// - /// - /// - /// + /// + /// + /// + /// " `); }); @@ -91,9 +91,9 @@ describe('Auto Imports', () => { ---------------------------------------- // Generated by wxt /// - /// - /// - /// + /// + /// + /// " `, ); diff --git a/packages/wxt/e2e/tests/typescript-project.test.ts b/packages/wxt/e2e/tests/typescript-project.test.ts index 167e01f8..ad53c38d 100644 --- a/packages/wxt/e2e/tests/typescript-project.test.ts +++ b/packages/wxt/e2e/tests/typescript-project.test.ts @@ -236,10 +236,10 @@ describe('TypeScript Project', () => { ---------------------------------------- // Generated by wxt /// - /// - /// - /// - /// + /// + /// + /// + /// " `); }); diff --git a/packages/wxt/src/core/generate-wxt-dir.ts b/packages/wxt/src/core/generate-wxt-dir.ts index 4fe3c535..e7d35949 100644 --- a/packages/wxt/src/core/generate-wxt-dir.ts +++ b/packages/wxt/src/core/generate-wxt-dir.ts @@ -217,7 +217,7 @@ function getMainDeclarationEntry(references: WxtDirEntry[]): WxtDirFileEntry { } else if (ref.tsReference) { const absolutePath = resolve(wxt.config.wxtDir, ref.path); const relativePath = relative(wxt.config.wxtDir, absolutePath); - lines.push(`/// `); + lines.push(`/// `); } }); return {