Skip to content

Commit

Permalink
Add variadic tuple types for plugin tuple
Browse files Browse the repository at this point in the history
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 <[email protected]>
Reviewed-by: Merlijn Vos <[email protected]>
Reviewed-by: Titus Wormer <[email protected]>
  • Loading branch information
ChristianMurphy authored Aug 21, 2020
1 parent cfc95a1 commit 7fc4271
Show file tree
Hide file tree
Showing 9 changed files with 798 additions and 3 deletions.
16 changes: 13 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,9 +36,17 @@
"Vse Mozhet Byt <[email protected]>",
"Richard Littauer <[email protected]>"
],
"types": "types/index.d.ts",
"types": "types/ts3.4/index.d.ts",
"typesVersions": {
">=4.0": {
"types/ts3.4/*": [
"types/ts4.0/*"
]
}
},
"files": [
"types/index.d.ts",
"types/ts3.4/index.d.ts",
"types/ts4.0/index.d.ts",
"index.js",
"lib"
],
Expand Down Expand Up @@ -68,7 +76,9 @@
"build": "npm run build-bundle && npm run build-mangle",
"test-api": "node test",
"test-coverage": "c8 --check-coverage --lines 100 --functions 100 --branches 100 --reporter lcov tape test",
"test-types": "dtslint types",
"test-types": "npm run test-types-3.4 && npm run test-types-4.0",
"test-types-3.4": "dtslint types/ts3.4",
"test-types-4.0": "dtslint types/ts4.0",
"test": "npm run format && npm run build && npm run test-coverage && npm run test-types"
},
"prettier": {
Expand Down
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
Loading

0 comments on commit 7fc4271

Please sign in to comment.