Skip to content

Commit 7fc4271

Browse files
Add variadic tuple types for plugin tuple
when `use([plugin, setting])` syntax is used, typescript can now warn if the settings object does not match with what the plugin expects. Closes GH-91. Reviewed-by: Remco Haszing <remcohaszing@gmail.com> Reviewed-by: Merlijn Vos <merlijn@soverin.net> Reviewed-by: Titus Wormer <tituswormer@gmail.com>
1 parent cfc95a1 commit 7fc4271

File tree

9 files changed

+798
-3
lines changed

9 files changed

+798
-3
lines changed

package.json

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,9 +36,17 @@
3636
"Vse Mozhet Byt <vsemozhetbyt@gmail.com>",
3737
"Richard Littauer <richard.littauer@gmail.com>"
3838
],
39-
"types": "types/index.d.ts",
39+
"types": "types/ts3.4/index.d.ts",
40+
"typesVersions": {
41+
">=4.0": {
42+
"types/ts3.4/*": [
43+
"types/ts4.0/*"
44+
]
45+
}
46+
},
4047
"files": [
41-
"types/index.d.ts",
48+
"types/ts3.4/index.d.ts",
49+
"types/ts4.0/index.d.ts",
4250
"index.js",
4351
"lib"
4452
],
@@ -68,7 +76,9 @@
6876
"build": "npm run build-bundle && npm run build-mangle",
6977
"test-api": "node test",
7078
"test-coverage": "c8 --check-coverage --lines 100 --functions 100 --branches 100 --reporter lcov tape test",
71-
"test-types": "dtslint types",
79+
"test-types": "npm run test-types-3.4 && npm run test-types-4.0",
80+
"test-types-3.4": "dtslint types/ts3.4",
81+
"test-types-4.0": "dtslint types/ts4.0",
7282
"test": "npm run format && npm run build && npm run test-coverage && npm run test-types"
7383
},
7484
"prettier": {
File renamed without changes.

0 commit comments

Comments
 (0)