Skip to content

Commit

Permalink
Refactor tsconfig: use inheritance
Browse files Browse the repository at this point in the history
  • Loading branch information
paulmillr committed Dec 23, 2023
1 parent d86df4a commit 8a82493
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 29 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ node_modules
/build/
/*.js
/*.d.ts
*.d.ts.map
/*.js.map
/esm/*.js
/esm/*.d.ts
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
"homepage": "https://paulmillr.com/noble/",
"repository": {
"type": "git",
"url": "https://github.com/paulmillr/noble-hashes.git"
"url": "git+https://github.com/paulmillr/noble-hashes.git"
},
"license": "MIT",
"sideEffects": false,
Expand Down
16 changes: 9 additions & 7 deletions tsconfig.esm.json
Original file line number Diff line number Diff line change
@@ -1,14 +1,9 @@
{
"compilerOptions": {
"outDir": "esm",
"target": "es2020",
"module": "es6",
"baseUrl": ".",
"paths": {
"@noble/hashes/crypto": ["src/crypto"]
},
"sourceMap": true,
"lib": ["es2020"],
"strict": true,
"sourceMap": true,
"allowSyntheticDefaultImports": false,
"allowUnreachableCode": false,
"esModuleInterop": false,
Expand All @@ -17,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"]
Expand Down
26 changes: 5 additions & 21 deletions tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,26 +1,10 @@
{
"extends": "./tsconfig.esm.json",
"compilerOptions": {
"outDir": ".",
"target": "es2020",
"lib": ["es2020"], // Set explicitly to remove DOM
"module": "commonjs",
"baseUrl": ".",
"paths": {
"@noble/hashes/crypto": ["*", "src/crypto"]
},
"sourceMap": true,
"moduleResolution": "node10",
"outDir": ".",
"declaration": true,
"declarationMap": false,
"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
}
}

0 comments on commit 8a82493

Please sign in to comment.