From 1c634072f634fecdd21c28fc37edc9b4aeb4b1bc Mon Sep 17 00:00:00 2001 From: Edoardo Scibona <12040076+velut@users.noreply.github.com> Date: Tue, 2 Jul 2024 19:29:28 +0200 Subject: [PATCH] build: update tsconfig --- tsconfig.json | 51 +++++++++++++++++++-------------------------------- 1 file changed, 19 insertions(+), 32 deletions(-) diff --git a/tsconfig.json b/tsconfig.json index 55aed8a..bc0defc 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,38 +1,25 @@ +// See https://www.totaltypescript.com/tsconfig-cheat-sheet. { - // see https://www.typescriptlang.org/tsconfig to better understand tsconfigs - "include": ["src", "types"], "compilerOptions": { - "module": "esnext", - "lib": ["dom", "esnext"], - "importHelpers": true, - // output .d.ts declaration files for consumers - "declaration": true, - "declarationMap": true, - // output .js.map sourcemap files for consumers - "sourceMap": true, - // match output dir to input dir. e.g. dist/index instead of dist/src/index - "rootDir": "./src", - "declarationDir": "./dist", - // stricter type-checking for stronger correctness. Recommended by TS - "strict": true, - // linter checks for common issues - "noImplicitReturns": true, - "noFallthroughCasesInSwitch": true, - // noUnused* overlap with @typescript-eslint/no-unused-vars, can disable if duplicative - "noUnusedLocals": true, - "noUnusedParameters": true, - "noUncheckedIndexedAccess": true, - // use Node's module resolution algorithm, instead of the legacy TS one - "moduleResolution": "node", - // transpile JSX to React.createElement - "jsx": "react", - // interop between ESM and CJS modules. Recommended by TS + // Base options. "esModuleInterop": true, - // significant perf increase by skipping checking .d.ts files, particularly those in node_modules. Recommended by TS "skipLibCheck": true, - // error out if import and file system have a casing mismatch. Recommended by TS - "forceConsistentCasingInFileNames": true, - // `dts build` ignores this option, but it is commonly used when type-checking separately with `tsc` - "noEmit": true + "target": "es2022", + "allowJs": true, + "resolveJsonModule": true, + "moduleDetection": "force", + "isolatedModules": true, + "verbatimModuleSyntax": true, + // Strictness. + "strict": true, + "noUncheckedIndexedAccess": true, + "noImplicitOverride": true, + // Building a library. + "declaration": true, + // Transpiling with a bundler. + "module": "preserve", + "noEmit": true, + // No DOM. + "lib": ["es2022"] } }