Files
bentopdf/tsconfig.json
alam00000 9d0b68e18c Refactor and enhance type safety across various modules
- Updated function parameters and return types in `page-preview.ts`, `pdf-decrypt.ts`, and `pymupdf-loader.ts` for improved type safety.
- Introduced type definitions for `CpdfInstance`, `PyMuPDFInstance`, and other related types to ensure better type checking.
- Enhanced error handling in `sanitize.ts` by creating a utility function for error messages.
- Removed unnecessary type assertions and improved type inference in `editor.ts`, `serialization.ts`, and `tools.test.ts`.
- Added type definitions for markdown-it plugins to improve compatibility and type safety.
- Enforced stricter TypeScript settings by enabling `noImplicitAny` in `tsconfig.json`.
- Cleaned up test files by refining type assertions and ensuring consistency in type usage.
2026-03-31 17:59:49 +05:30

61 lines
1.8 KiB
JSON

// {
// "compilerOptions": {
// "target": "ES2022",
// "useDefineForClassFields": true,
// "module": "ESNext",
// "lib": ["ES2022", "DOM", "DOM.Iterable"],
// "types": ["vite/client"],
// "skipLibCheck": true,
// /* Bundler mode */
// "moduleResolution": "bundler",
// "allowImportingTsExtensions": true,
// "verbatimModuleSyntax": true,
// "moduleDetection": "force",
// "noEmit": true,
// /* Linting */
// "strict": true,
// "noUnusedLocals": true,
// "noUnusedParameters": true,
// "erasableSyntaxOnly": true,
// "noFallthroughCasesInSwitch": true,
// "noUncheckedSideEffectImports": true
// },
// "include": ["src"]
// }
{
"compilerOptions": {
"target": "ES2022",
"module": "ESNext",
"lib": ["ES2022", "DOM", "DOM.Iterable", "WebWorker"],
"types": ["vite/client", "vitest/globals"], // Added vitest/globals
/* Easier module handling for Vite */
"moduleResolution": "bundler",
"allowJs": true,
"checkJs": false,
"skipLibCheck": true,
"noEmit": true,
"allowImportingTsExtensions": true,
/* Disable strict checks for now */
"strict": false,
"noUnusedLocals": false,
"noUnusedParameters": false,
"noFallthroughCasesInSwitch": false,
"noUncheckedSideEffectImports": false,
/* Fix for ArrayBuffer type issues */
"noImplicitAny": true,
/* Quality-of-life options */
"isolatedModules": true,
"esModuleInterop": true,
"forceConsistentCasingInFileNames": true,
"resolveJsonModule": true,
/* Path aliases (optional but helpful) */
"baseUrl": ".",
"paths": {
"@/*": ["./src/*"],
"@/types": ["./src/js/types/index.ts"]
}
},
"include": ["src", "src/**/*.ts", "public/workers", "vite.config.ts"], // Updated to include all TS files
"exclude": ["node_modules", "dist"]
}