Skip to content

Commit

Permalink
Fix code generated by TS in 5.5
Browse files Browse the repository at this point in the history
Related-to: 7d5dc44.
Related-to: GH-247.
  • Loading branch information
wooorm committed Jul 16, 2024
1 parent 7d5dc44 commit 35e72b9
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
"remark-preset-wooorm": "^10.0.0",
"tsd": "^0.31.0",
"type-coverage": "^2.0.0",
"typescript": "~5.4.0",
"typescript": "^5.0.0",
"xo": "^0.58.0"
},
"scripts": {
Expand Down
14 changes: 13 additions & 1 deletion script/fix-types.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,23 @@ const result = file
*/
function ($0, $1) {
console.log(
'Fixed `use` overload with plugin, and *non-optional* parameters'
'Fixed `use` overload with plugin, and *non-optional* parameters (TS pre 5.4)'
)
return '...parameters: ' + $1 + ' | [boolean]'
}
)
.replace(
/\.\.\.parameters: \(Parameters \| \[boolean]\)\[]/,
/**
* @returns {string}
*/
function () {
console.log(
'Fixed `use` overload with plugin, and *non-optional* parameters (TS 5.5+)'
)
return '...parameters: Parameters | [boolean]'
}
)

if (file === result) {
console.error(
Expand Down

0 comments on commit 35e72b9

Please sign in to comment.