Skip to content

Commit be0922a

Browse files
committed
deps: use @agilgur5/tsconfig to simplify tsconfig
Basically same as agilgur5/react-signature-canvas@cc6cce9 - this is my own tsconfig base (https://github.com/agilgur5/tsconfig) built on top of @tsconfig/strictest (https://github.com/tsconfig/bases) - as you can see, it just reduces all the non-type-checking related config that @tsconfig/strictest doesn't cover - TS doesn't yet support package `exports` for tsconfigs yet (microsoft/TypeScript#48665), hence the longer path into the package - Relative paths in tsconfig bases are also relative _within_ `node_modules` (microsoft/TypeScript#29172), so have to repeat any relative paths here - And due to this, I think it's better right now for `build` to extend the base here instead of the `build` tsconfig in `@agilgur5/tsconfig` - I didn't fully think that one through when I made it tbh, though it still serves as a good example tsconfig - Maybe that will be different in the future if TS changes or otherwise comes up with a solution to this (see the issue)
1 parent f5cda83 commit be0922a

File tree

3 files changed

+28
-18
lines changed

3 files changed

+28
-18
lines changed

package-lock.json

+25-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@
5757
"@babel/runtime": "^7.17.9"
5858
},
5959
"devDependencies": {
60+
"@agilgur5/tsconfig": "^0.0.2",
6061
"@babel/core": "^7.17.9",
6162
"@babel/plugin-transform-runtime": "^7.17.0",
6263
"@babel/preset-env": "^7.16.11",
@@ -66,7 +67,6 @@
6667
"@rollup/plugin-babel": "^5.3.1",
6768
"@rollup/plugin-commonjs": "^21.0.3",
6869
"@rollup/plugin-node-resolve": "^13.2.0",
69-
"@tsconfig/strictest": "^1.0.0",
7070
"changelog-maker": "^3.0.0",
7171
"concurrently": "^7.1.0",
7272
"jest": "^27.5.1",

tsconfig.json

+2-16
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,11 @@
11
{
2-
// https://github.com/tsconfig/bases
3-
"extends": "@tsconfig/strictest/tsconfig.json",
2+
// https://github.com/agilgur5/tsconfig
3+
"extends": "@agilgur5/tsconfig/src/tsconfig.library.json",
44
// exclude node_modules (the default), dist dir, coverage dir
55
"exclude": ["node_modules/", "dist/", "coverage/"],
66
// see https://www.typescriptlang.org/tsconfig to better understand tsconfigs
77
"compilerOptions": {
88
// output to dist/ dir
99
"outDir": "dist/",
10-
// output .d.ts declaration files for consumers
11-
"declaration": true,
12-
// output .d.ts.map declaration map files for consumers
13-
"declarationMap": true,
14-
// output .js.map sourcemap files for consumers
15-
"sourceMap": true,
16-
// use Node's module resolution algorithm, instead of the legacy TS one
17-
"moduleResolution": "node",
18-
// resolve JSON files
19-
"resolveJsonModule": true,
20-
// transpile JSX to React.createElement
21-
"jsx": "react",
22-
// ignored during builds, but commonly used when type-checking with `tsc`
23-
"noEmit": true,
2410
}
2511
}

0 commit comments

Comments
 (0)