feat: add ts-path and env types

This commit is contained in:
Sergey Krylov 2025-02-06 07:29:41 +03:00
parent 002f8d1b18
commit 6501b1d020
5 changed files with 61 additions and 2 deletions

View File

@ -25,6 +25,7 @@
"eslint-plugin-vue": "^9.32.0", "eslint-plugin-vue": "^9.32.0",
"typescript": "5.7.3", "typescript": "5.7.3",
"vite": "6.0.11", "vite": "6.0.11",
"vite-tsconfig-paths": "^5.1.4",
"vue-tsc": "2.2.0" "vue-tsc": "2.2.0"
} }
} }

41
pnpm-lock.yaml generated
View File

@ -48,6 +48,9 @@ importers:
vite: vite:
specifier: 6.0.11 specifier: 6.0.11
version: 6.0.11 version: 6.0.11
vite-tsconfig-paths:
specifier: ^5.1.4
version: 5.1.4(typescript@5.7.3)(vite@6.0.11)
vue-tsc: vue-tsc:
specifier: 2.2.0 specifier: 2.2.0
version: 2.2.0(typescript@5.7.3) version: 2.2.0(typescript@5.7.3)
@ -690,6 +693,9 @@ packages:
resolution: {integrity: sha512-oahGvuMGQlPw/ivIYBjVSrWAfWLBeku5tpPE2fOPLi+WHffIWbuh2tCjhyQhTBPMf5E9jDEH4FOmTYgYwbKwtQ==} resolution: {integrity: sha512-oahGvuMGQlPw/ivIYBjVSrWAfWLBeku5tpPE2fOPLi+WHffIWbuh2tCjhyQhTBPMf5E9jDEH4FOmTYgYwbKwtQ==}
engines: {node: '>=18'} engines: {node: '>=18'}
globrex@0.1.2:
resolution: {integrity: sha512-uHJgbwAMwNFf5mLst7IWLNg14x1CkeqglJb/K3doi4dw6q2IvAAmM/Y81kevy83wP+Sst+nutFTYOGg3d1lsxg==}
has-flag@4.0.0: has-flag@4.0.0:
resolution: {integrity: sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==} resolution: {integrity: sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==}
engines: {node: '>=8'} engines: {node: '>=8'}
@ -893,6 +899,16 @@ packages:
resolution: {integrity: sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==} resolution: {integrity: sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==}
engines: {node: '>=8'} engines: {node: '>=8'}
tsconfck@3.1.4:
resolution: {integrity: sha512-kdqWFGVJqe+KGYvlSO9NIaWn9jT1Ny4oKVzAJsKii5eoE9snzTJzL4+MMVOMn+fikWGFmKEylcXL710V/kIPJQ==}
engines: {node: ^18 || >=20}
hasBin: true
peerDependencies:
typescript: ^5.0.0
peerDependenciesMeta:
typescript:
optional: true
type-check@0.4.0: type-check@0.4.0:
resolution: {integrity: sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==} resolution: {integrity: sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==}
engines: {node: '>= 0.8.0'} engines: {node: '>= 0.8.0'}
@ -921,6 +937,14 @@ packages:
peerDependencies: peerDependencies:
vue: ^3.4.26 vue: ^3.4.26
vite-tsconfig-paths@5.1.4:
resolution: {integrity: sha512-cYj0LRuLV2c2sMqhqhGpaO3LretdtMn/BVX4cPLanIZuwwrkVl+lK84E/miEXkCHWXuq65rhNN4rXsBcOB3S4w==}
peerDependencies:
vite: '*'
peerDependenciesMeta:
vite:
optional: true
vite@6.0.11: vite@6.0.11:
resolution: {integrity: sha512-4VL9mQPKoHy4+FE0NnRE/kbY51TOfaknxAjt3fJbGJxhIpBZiqVzlZDEesWWsuREXHwNdAoOFZ9MkPEVXczHwg==} resolution: {integrity: sha512-4VL9mQPKoHy4+FE0NnRE/kbY51TOfaknxAjt3fJbGJxhIpBZiqVzlZDEesWWsuREXHwNdAoOFZ9MkPEVXczHwg==}
engines: {node: ^18.0.0 || ^20.0.0 || >=22.0.0} engines: {node: ^18.0.0 || ^20.0.0 || >=22.0.0}
@ -1601,6 +1625,8 @@ snapshots:
globals@14.0.0: {} globals@14.0.0: {}
globrex@0.1.2: {}
has-flag@4.0.0: {} has-flag@4.0.0: {}
he@1.2.0: {} he@1.2.0: {}
@ -1784,6 +1810,10 @@ snapshots:
dependencies: dependencies:
has-flag: 4.0.0 has-flag: 4.0.0
tsconfck@3.1.4(typescript@5.7.3):
optionalDependencies:
typescript: 5.7.3
type-check@0.4.0: type-check@0.4.0:
dependencies: dependencies:
prelude-ls: 1.2.1 prelude-ls: 1.2.1
@ -1806,6 +1836,17 @@ snapshots:
type-fest: 4.33.0 type-fest: 4.33.0
vue: 3.5.13(typescript@5.7.3) vue: 3.5.13(typescript@5.7.3)
vite-tsconfig-paths@5.1.4(typescript@5.7.3)(vite@6.0.11):
dependencies:
debug: 4.4.0
globrex: 0.1.2
tsconfck: 3.1.4(typescript@5.7.3)
optionalDependencies:
vite: 6.0.11
transitivePeerDependencies:
- supports-color
- typescript
vite@6.0.11: vite@6.0.11:
dependencies: dependencies:
esbuild: 0.24.2 esbuild: 0.24.2

10
src/vite-env.d.ts vendored
View File

@ -1 +1,11 @@
/// <reference types="vite/client" /> /// <reference types="vite/client" />
interface ImportMetaEnv {
readonly VITE_FIREBASE_KEY: string
readonly VITE_API_BASE_URL: string
}
interface ImportMeta {
readonly env: ImportMetaEnv
}

View File

@ -8,7 +8,13 @@
"noUnusedLocals": true, "noUnusedLocals": true,
"noUnusedParameters": true, "noUnusedParameters": true,
"noFallthroughCasesInSwitch": true, "noFallthroughCasesInSwitch": true,
"noUncheckedSideEffectImports": true "noUncheckedSideEffectImports": true,
"allowJs": true,
"baseUrl": ".",
"root": ".",
"paths": {
"@/*": ["./src/*"]
}
}, },
"include": ["src/**/*.ts", "src/**/*.tsx", "src/**/*.vue"] "include": ["src/**/*.ts", "src/**/*.tsx", "src/**/*.vue"]
} }

View File

@ -1,7 +1,8 @@
import { defineConfig } from 'vite' import { defineConfig } from 'vite'
import vue from '@vitejs/plugin-vue' import vue from '@vitejs/plugin-vue'
import tsconfigPaths from 'vite-tsconfig-paths';
// https://vite.dev/config/ // https://vite.dev/config/
export default defineConfig({ export default defineConfig({
plugins: [vue()], plugins: [tsconfigPaths(),vue()],
}) })