Skip to content

Commit

Permalink
fix: wrong typing for typescript v5 (#301)
Browse files Browse the repository at this point in the history
* fix: wrong typing for typescript v5

* Create .changeset/smart-cheetahs-exercise.md
  • Loading branch information
ota-meshi authored Mar 17, 2023
1 parent 3f4d571 commit ce2deb9
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changeset/smart-cheetahs-exercise.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"svelte-eslint-parser": patch
---

fix: wrong typing for typescript v5
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@
"semver": "^7.3.5",
"string-replace-loader": "^3.0.3",
"svelte": "^3.46.1",
"typescript": "~4.9.0",
"typescript": "~5.0.0",
"vue-eslint-parser": "^9.0.0"
},
"publishConfig": {
Expand Down
2 changes: 1 addition & 1 deletion src/parser/converts/attr.ts
Original file line number Diff line number Diff line change
Expand Up @@ -333,7 +333,7 @@ function convertEventHandlerDirective(
ctx,
isCustomEvent
? "(e:CustomEvent<any>)=>void"
: `(e:'${node.name}' extends keyof HTMLElementEventMap?HTMLElementEventMap['${node.name}']:CustomEvent<any>)=>void`
: `(e:'${node.name}' extends infer U?U extends keyof HTMLElementEventMap?HTMLElementEventMap[U]:CustomEvent<any>:never)=>void`
),
});
return directive;
Expand Down

0 comments on commit ce2deb9

Please sign in to comment.