Skip to content

Commit 35b5f01

Browse files
committed
fix: fix test type checks + make tsconfig more strict
1 parent 7add2e6 commit 35b5f01

File tree

6 files changed

+36
-15
lines changed

6 files changed

+36
-15
lines changed

.eslintrc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,8 @@
1818
"build/",
1919
"lib/",
2020
"tmp/",
21-
"./*.d.ts",
21+
"v5-compat.d.ts",
22+
"draft.d.ts",
2223
"script/*.js",
2324
"script/*.d.ts"
2425
]

.gitignore

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,19 +1,19 @@
1-
build
2-
docs
3-
lib
4-
tmp
1+
/build
2+
/docs
3+
/lib
4+
/tmp
55
node_modules
66
yarn.lock
77
yarn-error.log
88
package-lock.json
99
lib/binary/*.node
1010
lib/binary/napi-v*/*.node
1111
build-tmp-napi-v*
12-
prebuilds
12+
/prebuilds
1313
test.js
1414
.cache/
1515
test/typings-compatibility/
16-
script/*.js
17-
script/*.d.ts
18-
script/*/*.js
19-
script/*/*.d.ts
16+
/script/*.js
17+
/script/*.d.ts
18+
/script/*/*.js
19+
/script/*/*.d.ts

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@
7373
"install": "(shx test -f ./script/build.js || run-s build.js) && node-gyp-build",
7474
"clean": "shx rm -rf ./build ./lib/ ./prebuilds",
7575
"clean.temp": "shx rm -rf ./tmp && shx mkdir -p tmp && shx touch tmp/.gitkeep",
76-
"build.library": "shx rm -rf ./lib && tsc && node script/ci/downlevel-dts.js",
76+
"build.library": "shx rm -rf ./lib && tsc -p ./src/tsconfig.json && node script/ci/downlevel-dts.js",
7777
"build.script": "tsc -p ./script/tsconfig.json",
7878
"build.js": "run-p build.script build.library",
7979
"build.doc": "typedoc --out docs --name zeromq.js --excludeProtected --excludePrivate --excludeNotExported --excludeExternals --externalPattern 'src/+(draft|native|compat).ts' --tsconfig tsconfig-build.json --mode file",

src/tsconfig.json

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
{
2+
"extends": "../tsconfig.json",
3+
"compilerOptions": {
4+
"outDir": "../lib"
5+
},
6+
"include": ["**/*.ts"]
7+
}

test/tsconfig.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
{
2+
"extends": "../tsconfig.json",
3+
"include": ["**/*.ts"]
4+
}

tsconfig.json

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,13 +8,22 @@
88
"node",
99
"mocha"
1010
],
11+
"strictPropertyInitialization": false, // TODO
1112
"strict": true,
12-
"strictPropertyInitialization": false,
13+
"strictNullChecks": true,
14+
"noImplicitAny": true,
15+
"noImplicitReturns": true,
16+
"noImplicitThis": true,
17+
"noUnusedLocals": true,
18+
"noUnusedParameters": true,
1319
"lib": [
1420
"ES2020",
1521
"dom"
16-
],
17-
"outDir": "lib"
22+
]
1823
},
19-
"include": ["src"]
24+
"include": [
25+
"src",
26+
"script",
27+
"examples"
28+
]
2029
}

0 commit comments

Comments
 (0)