Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/nvlang/svelte-bug
https://github.com/nvlang/svelte-bug
Last synced: 3 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/nvlang/svelte-bug
- Owner: nvlang
- Created: 2024-03-09T01:28:12.000Z (10 months ago)
- Default Branch: main
- Last Pushed: 2024-03-09T01:35:04.000Z (10 months ago)
- Last Synced: 2024-03-09T02:31:56.124Z (10 months ago)
- Language: TypeScript
- Size: 34.2 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Svelte compiler types issue
## Steps to reproduce
```sh
pnpm i && tsc
```## Expected behavior
Error-free compilation.
## Actual behavior
`tsc` prints the following to the terminal:
```plain
index.ts:6:6 - error TS2345: Argument of type 'TemplateNode' is not assignable to parameter of type 'Node'.
Type 'Text' is not assignable to type 'Node'.
Type 'Text' is missing the following properties from type 'Property': key, value, kind, method, and 2 more.6 walk(ast.html, {
~~~~~~~~index.ts:8:13 - error TS2367: This comparison appears to be unintentional because the types '"CatchClause" | "ClassBody" | "Identifier" | "Literal" | "MethodDefinition" | "PrivateIdentifier" | "Program" | "Property" | "PropertyDefinition" | "SpreadElement" | "Super" | ... 59 more ... | "VariableDeclaration"' and '"Text"' have no overlap.
8 if (node.type === "Text") {
~~~~~~~~~~~~~~~~~~~~index.ts:9:13 - error TS2532: Object is possibly 'undefined'.
9 this.skip();
~~~~Found 3 errors in the same file, starting at: index.ts:6
```