-
-
Notifications
You must be signed in to change notification settings - Fork 209
Unused export property warning is on the wrong line when using the TypeScript pre-processor. #489
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Try update your @tsconfig/svelte to lastest |
I am not using that. |
Oh I thought you were using the official template. The package is a base config for svelte. You can update the |
Duplicate of #333 |
@jasonlyu123 As i said, i added the base config temporarily but nothing changed. I still get the errors on the wrong line. |
Then can you try run |
The problem is with sourcemap. We use the svelte compiler to get svelte diagnostics. if you have a svelte.config.js and specify your preprocessor in it we would use that to preprocess, other than that we'll use the official svelte-preprocess. And if the preprocessor doesn't return a sourcemap the warning would be in a wrong position. Also, we don't monitor change in the tsconfig.json so make sure you restart the language server after any changes. |
It does not always generate source maps. If i call |
Can I take a look at your |
I use the default processor, which should be I tried creating a |
Ummm... this is unexpected, it would only work when I also set |
Then the |
Yeah, I have a quick look at the source file of the svelte-preprocess. It looks like it doesn't parse the |
I opened this issue over at @brunnerh if you remove |
No, still off. |
So it only works if you add |
Yes |
Closing as these are problems related to |
Ok, thanks! Seems like the most reasonable thing to do. I've already spent way too much time looking for a solution to this now 🤦♂️ |
Describe the bug
export let
statements of an unused property cause a warning. The warning is displayed on the line above the actual property for me.To Reproduce
Set the script language to typescript (
lang="ts"
ortype="text/typescript"
).Declare some export property, do not use it anywhere.
Expected behavior
The warning is on the property not being used.
Screenshots
If the property is in the first line of the script:
System (please complete the following information):
The text was updated successfully, but these errors were encountered: