From 37eab5a28a43c35b87e9e95a12ae6086393ac38b Mon Sep 17 00:00:00 2001 From: Paul Miller Date: Sat, 23 Dec 2023 17:30:48 +0000 Subject: [PATCH] Refactor tsconfig: use inheritance --- package.json | 4 ++-- tsconfig.esm.json | 17 +++++++++-------- tsconfig.json | 24 +++++------------------- 3 files changed, 16 insertions(+), 29 deletions(-) diff --git a/package.json b/package.json index 78f423c..7e14f71 100644 --- a/package.json +++ b/package.json @@ -24,7 +24,7 @@ "homepage": "https://paulmillr.com/noble/", "repository": { "type": "git", - "url": "https://github.com/paulmillr/noble-curves.git" + "url": "git+https://github.com/paulmillr/noble-curves.git" }, "license": "MIT", "dependencies": { @@ -178,4 +178,4 @@ "schnorr" ], "funding": "https://paulmillr.com/funding/" -} \ No newline at end of file +} diff --git a/tsconfig.esm.json b/tsconfig.esm.json index 4ebd259..0222cfa 100644 --- a/tsconfig.esm.json +++ b/tsconfig.esm.json @@ -1,15 +1,9 @@ { "compilerOptions": { - "outDir": "esm", "target": "es2020", - "module": "es6", - "moduleResolution": "bundler", - "baseUrl": ".", - "paths": { - "@noble/hashes/crypto": ["src/crypto"] - }, - "sourceMap": true, + "lib": ["es2020"], "strict": true, + "sourceMap": true, "allowSyntheticDefaultImports": false, "allowUnreachableCode": false, "esModuleInterop": false, @@ -18,6 +12,13 @@ "noUncheckedIndexedAccess": false, "noUnusedLocals": true, "noUnusedParameters": true, + "baseUrl": ".", + "paths": { + "@noble/hashes/crypto": ["src/crypto"] + }, + "module": "es2020", + "outDir": "esm", + "moduleResolution": "bundler" }, "include": ["src"], "exclude": ["node_modules", "lib"] diff --git a/tsconfig.json b/tsconfig.json index 00fe97e..763639d 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,24 +1,10 @@ { + "extends": "./tsconfig.esm.json", "compilerOptions": { - "outDir": ".", - "target": "es2020", - "lib": ["es2020"], // Set explicitly to remove DOM "module": "commonjs", - "moduleResolution": "node", - "baseUrl": ".", - "sourceMap": true, + "moduleResolution": "node10", + "outDir": ".", "declaration": true, - "declarationMap": true, - "strict": true, - "allowSyntheticDefaultImports": false, - "allowUnreachableCode": false, - "esModuleInterop": false, - "noFallthroughCasesInSwitch": true, - "noImplicitReturns": true, - "noUncheckedIndexedAccess": false, - "noUnusedLocals": true, - "noUnusedParameters": true - }, - "include": ["src"], - "exclude": ["node_modules", "*.d.ts"] + "declarationMap": true + } }