Skip to content

Commit cc6cce9

Browse files
authored
deps: use @agilgur5/tsconfig to simplify tsconfig (#87)
- this is my own tsconfig base built on top of @tsconfig/strictest - 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, hence the longer path into the package - Relative paths in tsconfig bases are also relative _within_ node_modules, 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
1 parent 5771d33 commit cc6cce9

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
@@ -78,6 +78,7 @@
7878
},
7979
"devDependencies": {
8080
"@agilgur5/changelog-maker": "^3.0.0",
81+
"@agilgur5/tsconfig": "^0.0.1",
8182
"@babel/core": "^7.17.9",
8283
"@babel/plugin-transform-runtime": "^7.17.0",
8384
"@babel/preset-env": "^7.16.11",
@@ -88,7 +89,6 @@
8889
"@rollup/plugin-babel": "^5.3.1",
8990
"@rollup/plugin-commonjs": "^21.1.0",
9091
"@rollup/plugin-node-resolve": "^13.2.1",
91-
"@tsconfig/strictest": "^1.0.1",
9292
"@types/enzyme": "^3.10.4",
9393
"@wojtekmaj/enzyme-adapter-react-17": "^0.6.6",
9494
"canvas": "^2.9.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, and example for now
55
"exclude": ["node_modules/", "dist/", "coverage/", "example/"],
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)