22// npm i typescript --save-dev
33//
44// to run the summary check, call:
5- // npx tsc
5+ // npx tsc --checkJs --noEmit
66{
7- "include" : [
8- // "plugins/push/**/*.ts",
9- // "plugins/push/**/*.js"
10- " api/utils/common.js" ,
11- " api/utils/localization.js" ,
12- " api/lib/countly.common.js" ,
13- " api/utils/requestProcessor.js"
14- ],
15- "exclude" : [
16- " node_modules"
7+ // Explicitly specify which files to include in compilation
8+ "files" : [
9+ " types/global.d.ts" , // Global type declarations for legacy compatibility
10+ " types/common.d.ts" , // Common utility functions type definitions
11+ " types/requestProcessor.d.ts" , // Request processor type definitions
12+ " types/localization.d.ts" , // Localization module type definitions
13+ " types/log.d.ts" , // Logging module type definitions
14+ " types/config.d.ts" , // Configuration type definitions
15+ " types/pluginManager.d.ts" , // Plugin manager type definitions
16+ " types/utils.d.ts" , // Utility functions type definitions
17+ " types/batcher.d.ts" , // Database batcher type definitions
18+ " types/rights.d.ts" , // Rights validation type definitions
19+ " types/events.d.ts" , // Events processing type definitions
20+ " types/usage.d.ts" , // Usage processing type definitions
21+ " api/utils/localization.js" // Include JS file for type checking
1722 ],
1823 "compilerOptions" : {
19- "outDir" : " dist" , // we're not building the app. but still necessary for, reasons...
20- "allowJs" : true ,
21- "checkJs" : true ,
22- "resolveJsonModule" : true ,
23- "strict" : true
24+ // Language and Environment
25+ "target" : " ES2022" , // Set the JavaScript language version for emitted JavaScript
26+ "lib" : [" ES2022" , " DOM" ], // Specify a set of bundled library declaration files
27+
28+ // Modules
29+ "moduleResolution" : " Node" , // Specify how TypeScript looks up a file from a given module specifier
30+ "baseUrl" : " ." , // Specify the base directory to resolve non-relative module names
31+ "paths" : { // Specify a set of entries that re-map imports to additional lookup locations
32+ "@countly/*" : [" ./api/*" ], // Map @countly imports to api directory
33+ "@plugins/*" : [" ./plugins/*" ], // Map @plugins imports to plugins directory
34+ "@frontend/*" : [" ./frontend/*" ] // Map @frontend imports to frontend directory
35+ },
36+ "resolveJsonModule" : true , // Enable importing .json files
37+
38+ // JavaScript Support
39+ "allowJs" : true , // Allow JavaScript files to be a part of your program
40+
41+ // Interop Constraints
42+ "esModuleInterop" : true , // Emit additional JavaScript to ease support for importing CommonJS modules
43+ "forceConsistentCasingInFileNames" : true , // Ensure that casing is correct in imports
44+
45+ // Completeness
46+ "typeRoots" : [" ./types" , " ./node_modules/@types" ] // Specify multiple folders that act like './node_modules/@types'
2447 }
2548}
0 commit comments