]> git.ipfire.org Git - thirdparty/vuejs/create-vue.git/commitdiff
fix: add tsconfig.json for playwright tests
authorHaoqun Jiang <haoqunjiang@gmail.com>
Fri, 18 Nov 2022 10:12:01 +0000 (18:12 +0800)
committerHaoqun Jiang <haoqunjiang@gmail.com>
Fri, 18 Nov 2022 10:12:01 +0000 (18:12 +0800)
1. Avoid "The file must be included in at least one of the projects
provided" error when using type-aware ESLint configurations;
2. It's recommended by the [playwright documentation](https://playwright.dev/docs/test-typescript#tsconfigjson):
> We recommend setting up a separate `tsconfig.json` in the tests
directory so that you can change some preferences specifically for the
tests.

index.ts
template/tsconfig/playwright/e2e/tsconfig.json [new file with mode: 0644]

index e6f1df9a4b2be67164ac6dd61991a305a10cefab..02c9e49b5c7e430e6e7ed52d23b6caa41363ea60 100755 (executable)
--- a/index.ts
+++ b/index.ts
@@ -336,6 +336,9 @@ async function init() {
     if (needsCypressCT) {
       render('tsconfig/cypress-ct')
     }
+    if (needsPlaywright) {
+      render('tsconfig/playwright')
+    }
     if (needsVitest) {
       render('tsconfig/vitest')
     }
diff --git a/template/tsconfig/playwright/e2e/tsconfig.json b/template/tsconfig/playwright/e2e/tsconfig.json
new file mode 100644 (file)
index 0000000..239accd
--- /dev/null
@@ -0,0 +1,4 @@
+{
+  "extends": "@vue/tsconfig/tsconfig.node.json",
+  "include": ["./**/*"]
+}