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

@typescript-eslint/no-unnecessary-condition false positive when property is defined anywhere other than the last line of script tag #191

Open
DetachHead opened this issue Oct 25, 2022 · 1 comment

Comments

@DetachHead
Copy link

<script>
    let foo = undefined
    1 // remove this line and the error goes away
</script>

<button on:click={() => (foo = 'asdf')}>asdf</button>
{#if foo !== undefined}
    <p>clicked</p>
{/if}
7:6  error  Unnecessary conditional, both sides of the expression are literal values  @typescript-eslint/no-unnecessary-condition

✖ 1 problem (1 error, 0 warnings)
@DetachHead
Copy link
Author

this issue doesn't occur in eslint-plugin-svelte which seems to be more actively maintained

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant