Skip to content

Commit 35e72b9

Browse files
committed
Fix code generated by TS in 5.5
Related-to: 7d5dc44. Related-to: GH-247.
1 parent 7d5dc44 commit 35e72b9

File tree

2 files changed

+14
-2
lines changed

2 files changed

+14
-2
lines changed

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@
6464
"remark-preset-wooorm": "^10.0.0",
6565
"tsd": "^0.31.0",
6666
"type-coverage": "^2.0.0",
67-
"typescript": "~5.4.0",
67+
"typescript": "^5.0.0",
6868
"xo": "^0.58.0"
6969
},
7070
"scripts": {

script/fix-types.js

+13-1
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,23 @@ const result = file
2929
*/
3030
function ($0, $1) {
3131
console.log(
32-
'Fixed `use` overload with plugin, and *non-optional* parameters'
32+
'Fixed `use` overload with plugin, and *non-optional* parameters (TS pre 5.4)'
3333
)
3434
return '...parameters: ' + $1 + ' | [boolean]'
3535
}
3636
)
37+
.replace(
38+
/\.\.\.parameters: \(Parameters \| \[boolean]\)\[]/,
39+
/**
40+
* @returns {string}
41+
*/
42+
function () {
43+
console.log(
44+
'Fixed `use` overload with plugin, and *non-optional* parameters (TS 5.5+)'
45+
)
46+
return '...parameters: Parameters | [boolean]'
47+
}
48+
)
3749

3850
if (file === result) {
3951
console.error(

0 commit comments

Comments
 (0)