From 879c23550b390d285e23e0347078d24ba9c10c31 Mon Sep 17 00:00:00 2001 From: Noel Date: Tue, 13 Jul 2021 02:25:47 +0200 Subject: [PATCH] chore: improve tsconfig.json (#8) --- package.json | 2 +- src/tsconfig.json | 9 -------- tsconfig.base.json | 24 --------------------- tsconfig.eslint.json | 2 +- tsconfig.json | 51 ++++++++++++++++++++++++++++++++++++++++++++ 5 files changed, 53 insertions(+), 35 deletions(-) delete mode 100644 src/tsconfig.json delete mode 100644 tsconfig.base.json create mode 100644 tsconfig.json diff --git a/package.json b/package.json index 702d959d..f110deee 100644 --- a/package.json +++ b/package.json @@ -11,7 +11,7 @@ }, "scripts": { "prebuild": "npm run clean", - "build": "tsc -b src && gen-esm-wrapper ./dist/index.js ./dist/index.mjs", + "build": "tsc && gen-esm-wrapper ./dist/index.js ./dist/index.mjs", "clean": "rimraf dist", "lint": "eslint --ext mjs,ts src/**/*.ts", "lint:fix": "eslint --fix --ext mjs,ts src/**/*.ts", diff --git a/src/tsconfig.json b/src/tsconfig.json deleted file mode 100644 index bdc402ff..00000000 --- a/src/tsconfig.json +++ /dev/null @@ -1,9 +0,0 @@ -{ - "extends": "../tsconfig.base.json", - "compilerOptions": { - "rootDir": "./", - "outDir": "../dist", - "composite": true - }, - "include": ["."] -} diff --git a/tsconfig.base.json b/tsconfig.base.json deleted file mode 100644 index 1a03a751..00000000 --- a/tsconfig.base.json +++ /dev/null @@ -1,24 +0,0 @@ -{ - "compilerOptions": { - "strict": true, - "moduleResolution": "node", - "module": "commonjs", - "target": "es2020", - "lib": ["esnext", "esnext.array", "esnext.asynciterable", "esnext.intl", "esnext.symbol"], - "declaration": true, - "declarationMap": true, - "sourceMap": true, - "removeComments": false, - "alwaysStrict": true, - "pretty": true, - "incremental": true, - "noEmitHelpers": true, - "importHelpers": true, - "skipLibCheck": true, - "esModuleInterop": true, - "preserveConstEnums": true, - "resolveJsonModule": true, - "importsNotUsedAsValues": "error" - }, - "exclude": ["**/*.test.ts"] -} diff --git a/tsconfig.eslint.json b/tsconfig.eslint.json index 4a67f000..8dc4bacb 100644 --- a/tsconfig.eslint.json +++ b/tsconfig.eslint.json @@ -1,5 +1,5 @@ { - "extends": "./tsconfig.base.json", + "extends": "./tsconfig.json", "compilerOptions": { "allowJs": true }, diff --git a/tsconfig.json b/tsconfig.json new file mode 100644 index 00000000..f5558c1c --- /dev/null +++ b/tsconfig.json @@ -0,0 +1,51 @@ +{ + // Mapped from https://www.typescriptlang.org/tsconfig + "compilerOptions": { + // Type Checking + "alwaysStrict": true, + "allowUnreachableCode": false, + "allowUnusedLabels": false, + // TypeScript 4.4 + // "exactOptionalPropertyTypes": true, + "noFallthroughCasesInSwitch": true, + "noImplicitOverride": true, + "noImplicitReturns": true, + "noUnusedLocals": true, + "noUnusedParameters": true, + "strict": true, + // TypeScript 4.4 + // "useUnknownInCatchVariables": true, + + // Modules + "module": "CommonJS", + "moduleResolution": "node", + "resolveJsonModule": true, + + // Emit + "declaration": true, + "declarationMap": true, + "importHelpers": true, + "importsNotUsedAsValues": "error", + "inlineSources": true, + "newLine": "lf", + "noEmitHelpers": true, + "outDir": "dist", + "preserveConstEnums": true, + "removeComments": false, + "sourceMap": true, + "sourceRoot": "/", + "esModuleInterop": true, + "forceConsistentCasingInFileNames": true, + + // Language and Environment + "emitDecoratorMetadata": true, + "experimentalDecorators": true, + "lib": ["ESNext"], + "target": "ES2020", + "useDefineForClassFields": true, + + // Completeness + "skipLibCheck": true + }, + "include": ["src/**/*.ts"] +}