From 6fb7aaf14a150bb2bae82476cb146da79d1af071 Mon Sep 17 00:00:00 2001 From: ftsell Date: Wed, 15 Nov 2023 17:27:34 +0100 Subject: [PATCH] enable nuxt typechecking --- .github/workflows/lint.yml | 1 + .pre-commit-config.yaml | 6 ++++++ nuxt.config.ts | 3 +++ package.json | 6 ++++-- 4 files changed, 14 insertions(+), 2 deletions(-) diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 499d381..64fc06e 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -16,6 +16,7 @@ jobs: node-version: 18 - run: npm install -g pnpm - run: pnpm install --prefer-frozen-lockfile + - run: pnpm exec nuxt prepare .playground - run: python -m pip install pre-commit - uses: actions/cache@v3 with: diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 0c760c7..8c625ca 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -16,3 +16,9 @@ repos: types_or: [ vue, ts, javascript ] entry: "pnpm exec eslint" args: [ "--fix", "--max-warnings=0" ] + - id: typecheck + name: typecheck + language: system + types_or: [ vue, ts, javascript ] + pass_filenames: false + entry: "pnpm run typecheck" diff --git a/nuxt.config.ts b/nuxt.config.ts index 9226a58..7dc04ed 100644 --- a/nuxt.config.ts +++ b/nuxt.config.ts @@ -8,6 +8,9 @@ export default defineNuxtConfig({ modules: [ "@nuxt/ui", ], + typescript: { + typeCheck: true, + }, devtools: {enabled: true}, colorMode: { classSuffix: "", diff --git a/package.json b/package.json index 0a6c711..307ec54 100644 --- a/package.json +++ b/package.json @@ -9,13 +9,15 @@ "build": "nuxt build .playground", "generate": "nuxt generate .playground", "preview": "nuxt preview .playground", - "lint": "eslint ." + "lint": "eslint .", + "typecheck": "nuxt typecheck" }, "devDependencies": { "@nuxt/eslint-config": "^0.1.1", "eslint": "^8.28.0", "nuxt": "^3.6.2", - "typescript": "^4.9.3" + "typescript": "^4.9.5", + "vue-tsc": "^1.8.22" }, "dependencies": { "@nuxt/ui": "^2.10.0",