Skip to content

svelte/no-unused-svelte-ignore wrongly reports svelte-ignore unused-export-let as not warned (with lang="ts") #355

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

Closed
2 tasks done
divdavem opened this issue Feb 2, 2023 · 1 comment · Fixed by #357
Closed
2 tasks done
Labels
bug Something isn't working

Comments

@divdavem
Copy link

divdavem commented Feb 2, 2023

Before You File a Bug Report Please Confirm You Have Done The Following...

  • I have tried restarting my IDE and the issue persists.
  • I have updated to the latest version of the packages.

What version of ESLint are you using?

8.33.0

What version of eslint-plugin-svelte are you using?

2.15.0

What did you do?

<script lang="ts">
  // svelte-ignore unused-export-let
  export let something;
</script>

What did you expect to happen?

I expected no eslint error because the something variable is actually unused.

By the way, if I remove the svelte-ignore comment, I correctly get the following eslint error, proving that the svelte-ignore comment is actually useful:

Component has unused export property 'something'. If it is for external reference only, please consider using export const something(unused-export-let) ESLint svelte/valid-compile

Note that the problem does not happen if I remove lang="ts".

What actually happened?

I got the following eslint error:
svelte-ignore comment is used, but not warned svelte/no-unused-svelte-ignore

Link to GitHub Repo with Minimal Reproducible Example

https://ota-meshi.github.io/eslint-plugin-svelte/playground/#eJwlzE0KgCAQQOGrDLMX9/2dxE3oYIKN4YwRRHfPaPnB493oSyAccBJf06GQV46zQxWHi2MAa0FOykomRS6VoHETCoauo1Q1mfSrfkEXSNlJt8RxdDzZ/9pP+LzPoCYU

Additional comments

No response

@divdavem divdavem changed the title svelte/no-unused-svelte-ignore wrongly reports svelte-ignore unused-export-let as not warned (with lang="ts") svelte/no-unused-svelte-ignore wrongly reports svelte-ignore unused-export-let as not warned (with lang="ts") Feb 2, 2023
@ota-meshi ota-meshi added the bug Something isn't working label Feb 3, 2023
@divdavem
Copy link
Author

divdavem commented Feb 6, 2023

@ota-meshi Thank you for fixing this issue, and for doing it so quickly! 👍

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

Successfully merging a pull request may close this issue.

2 participants