mirror of
https://github.com/Snigdha-OS/Snigdha-OS.github.io.git
synced 2025-09-05 20:26:43 +02:00
🧹 chore: clarity, better linting, and added configuration options
This commit is contained in:
@@ -1,24 +1,31 @@
|
|||||||
{
|
{
|
||||||
"compilerOptions": {
|
"compilerOptions": {
|
||||||
"target": "ES2020",
|
"target": "ES2020", // Keep as is: Supports modern JavaScript features
|
||||||
"useDefineForClassFields": true,
|
"useDefineForClassFields": true, // Ensures that class fields are defined via 'define' (ESNext behavior)
|
||||||
"lib": ["ES2020", "DOM", "DOM.Iterable"],
|
"lib": ["ES2020", "DOM", "DOM.Iterable"], // Includes necessary libraries for web development
|
||||||
"module": "ESNext",
|
"module": "ESNext", // Uses the latest ES module system
|
||||||
"skipLibCheck": true,
|
"skipLibCheck": true, // Improves build speed by skipping type-checking of declaration files
|
||||||
|
|
||||||
/* Bundler mode */
|
/* Bundler mode */
|
||||||
"moduleResolution": "bundler",
|
"moduleResolution": "bundler", // Configures module resolution for bundlers (Vite/Webpack)
|
||||||
"allowImportingTsExtensions": true,
|
"allowImportingTsExtensions": true, // Allows importing TypeScript files without the extension
|
||||||
"isolatedModules": true,
|
"isolatedModules": true, // Ensures compatibility with bundlers (treats each file as a module)
|
||||||
"moduleDetection": "force",
|
"moduleDetection": "force", // Forces ECMAScript module resolution for all files
|
||||||
"noEmit": true,
|
"noEmit": true, // Ensures no output is generated (useful for type-checking only)
|
||||||
"jsx": "react-jsx",
|
"jsx": "react-jsx", // Supports the new JSX transform (React 17+)
|
||||||
|
|
||||||
/* Linting */
|
/* Linting */
|
||||||
"strict": true,
|
"strict": true, // Enforces all strict type-checking options
|
||||||
"noUnusedLocals": true,
|
"noUnusedLocals": true, // Ensures no unused local variables
|
||||||
"noUnusedParameters": true,
|
"noUnusedParameters": true, // Ensures no unused function parameters
|
||||||
"noFallthroughCasesInSwitch": true
|
"noFallthroughCasesInSwitch": true, // Prevents fallthrough in switch statements
|
||||||
|
"noImplicitAny": true, // Disallows the use of the `any` type (strict type-checking)
|
||||||
|
"strictNullChecks": true, // Makes null and undefined handling more strict
|
||||||
|
"strictFunctionTypes": true, // Makes function types stricter
|
||||||
|
"esModuleInterop": true, // Ensures compatibility with CommonJS modules
|
||||||
|
"resolveJsonModule": true, // Allows importing JSON files as modules
|
||||||
|
"skipDefaultLibCheck": true // Skips type-checking of default libraries to speed up compilation
|
||||||
},
|
},
|
||||||
"include": ["src"]
|
"include": ["src"], // Includes all source files under the 'src' directory
|
||||||
|
"exclude": ["node_modules", "dist"] // Excludes node_modules and dist directories to speed up compilation
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user