Skip to content
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

"Line numbers must be >= 1" error on module block when unused vars in regular script block #666

Closed
boyeln opened this issue Nov 10, 2020 · 1 comment
Labels
bug Something isn't working

Comments

@boyeln
Copy link

boyeln commented Nov 10, 2020

Describe the bug
When I have a script block with context="module" and lang="ts", and then have two or more unused props (export let unused = "some value") within my non-module script tag, I get the error "Line numbers must be >= 1". It only occurs when there are two or more unused exports and the lang is set to "ts".

To Reproduce
Steps to reproduce the behavior:

<script context="module" lang="ts">
	let someVar: undefined;
</script>

<script lang="ts">
	export let unused1 = true;
	export let unused2 = true;
</script>

Expected behavior

The unused-export-let warning on the two unused variables.

Screenshots

Screenshot 2020-11-10 at 16 01 37

System (please complete the following information):

  • OS: macOS Catalina (10.15.7)
  • IDE: VSCode
  • Plugin/Package: Svelte for VSCode
@boyeln boyeln added the bug Something isn't working label Nov 10, 2020
dummdidumm added a commit that referenced this issue Nov 13, 2020
Now the warnings of #666 are shown, but at the wrong lines. The problem is that the module script is transpiled, too, but that is not taken into account in our mapping.
@dummdidumm
Copy link
Member

Closing in favor of #934

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants