forked from SveltyCMS/SveltyCMS
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtsconfig.json
More file actions
32 lines (31 loc) · 1.91 KB
/
tsconfig.json
File metadata and controls
32 lines (31 loc) · 1.91 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
{
// This is the most important line. It inherits all the SvelteKit-specific
// type settings, including generated route types in `./$types`.
"extends": "./.svelte-kit/tsconfig.json",
"compilerOptions": {
// --- Core Module & Syntax Settings (Optimized for Modern JS) ---
"target": "ESNext", // Compile to the latest JavaScript features
"module": "ESNext", // Use modern ES modules
"moduleResolution": "bundler", // The recommended setting for Vite/SvelteKit
"verbatimModuleSyntax": true, // Enforces consistent `import type` usage, great for performance
"isolatedModules": true, // Ensures each file can be transpiled separately
// --- Strictness & Code Quality (Essential for a robust CMS) ---
"strict": true, // Enable all strict type-checking options
"forceConsistentCasingInFileNames": true, // Prevents case-related bugs
"noUnusedLocals": true, // Catches dead code
"noUnusedParameters": true, // Helps identify unused function arguments
// --- Svelte & JS Interoperability ---
"allowJs": true, // Allow JavaScript files to be included
"checkJs": true, // Type-check JavaScript files with JSDoc comments
"esModuleInterop": true, // Improves compatibility between CommonJS and ES Modules
"skipLibCheck": true, // Speeds up compilation by not checking library (.d.ts) files
"allowArbitraryExtensions": true, // Important for Vite plugins that might use non-standard extensions
"resolveJsonModule": true, // Allow importing JSON files as modules
"allowImportingTsExtensions": true // Allow importing TypeScript files with extensions
// Path aliases are automatically generated by SvelteKit from `svelte.config.js` aliases
// and placed in `.svelte-kit/tsconfig.json` which this file extends
},
// Tell TypeScript which files to include in the compilation.
"include": ["src/**/*.js", "src/**/*.ts", "src/**/*.svelte", "config/**/*.ts", "types/**/*.ts"],
"exclude": ["node_modules", ".svelte-kit"]
}