Comments (4)
Just ran into this. This fails for me:
<script lang="ts">
let period: 'monthly' | 'yearly' = 'yearly'
</script>
{#if period === 'monthly'}
paid every month
{/if}
With this error:
Error: This comparison appears to be unintentional because the types '"yearly"' and '"monthly"' have no overlap. (ts)
EDIT: To temporarily work around this issue, I changed the typescript dependency to: 5.3.x
from language-tools.
Just ran into this. This fails for me:
<script lang="ts"> let period: 'monthly' | 'yearly' = 'yearly' </script> {#if period === 'monthly'} paid every month {/if}With this error:
Error: This comparison appears to be unintentional because the types '"yearly"' and '"monthly"' have no overlap. (ts)
EDIT: To temporarily work around this issue, I changed the typescript dependency to:
5.3.x
You can cast the string 'yearly' as 'monthly' | 'yearly' to get around it for now if you wanna stay on 5.4.x.
let period: 'monthly' | 'yearly' = 'yearly' as 'monthly' | 'yearly'
from language-tools.
This one is expected because there isn't any reassignment. If your actual case has an assignment somewhere that isn't binding. Can you share it here?
from language-tools.
@dummdidumm Sadly, this is not completely fixed in the latest svelte-check v3.6.8. Maybe it's missing a special case for bind:group
? At least that's the problem I'm running into. I built a small reproduction: https://stackblitz.com/edit/vitejs-vite-r64k1v?file=src%2FApp.svelte
If you run pnpm i && pnpm check
, you can still see the error.
from language-tools.
Related Issues (20)
- The type of `<svelte:self>` seems to be `any` making it possible to pass any props
- Error: Cannot find module @rollup/rollup-darwin-arm64. npm has a bug related to optional dependencies (https://github.com/npm/cli/issues/4828). HOT 1
- Svelte 5: Using slot props gives a TS error in parent
- using "bundler" as moduleResolution breaks full path imports from node_modules HOT 1
- Svelte 5: `children` markup between `{#snippet}`s HOT 1
- Svelte 5: Component Imports in TS files not behaving correctly HOT 1
- Provide type-safe `value`s to `<option />` when the parent `<select />` has its value bound by a typed variable.
- can not use Action type with async handler HOT 1
- LSP messaging - Neovim - Organize Imports Code Action HOT 2
- Snippet props are unusable in Svelte 69 HOT 5
- False "Missing Property" Highlighting on some URLSearchParams methods HOT 7
- Volar hybrid mode compatibility with typescript-svelte-plugin
- svelte-check: No preprocess config found but lang tag exists HOT 5
- Svelte autocomplete is not working in version 108.3.1 of the vscode extension HOT 3
- TS named like "MyButton.svelte.d.ts" breaks "@component" in "MyButton.svelte" HOT 4
- Typescript imports from modules are not re-evaluated when they change HOT 2
- Incorrect type inference in a component that uses hierarchical (recursive) component HOT 2
- Error in svelte.config.js Error [ERR_MODULE_NOT_FOUND]: Cannot find package ... @ampproject/remapping HOT 1
- Svelte 5: support for arbitrary call expressions in render tags missing
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from language-tools.