Skip to content

Conversation

ota-meshi
Copy link
Member

fixes #1298

Copy link

changeset-bot bot commented Sep 3, 2025

🦋 Changeset detected

Latest commit: 1ecb1ff

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 1 package
Name Type
eslint-plugin-svelte Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

Copy link
Contributor

github-actions bot commented Sep 3, 2025

Try the Instant Preview in Online Playground

ESLint Online Playground

Install the Instant Preview to Your Local

npm i https://pkg.pr.new/eslint-plugin-svelte@1ecb1ff

Published Instant Preview Packages:

View Commit

@ota-meshi ota-meshi force-pushed the fix-no-top-level-browser-globals branch from 7dfabba to 7459735 Compare September 3, 2025 05:19
Copy link
Member

@baseballyama baseballyama left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not related original issue, but below case should be ok, but I got a report.

<script>
	import { browser, dev } from '$app/environment';
</script>

{#if browser || (dev && browser)}
	<div>{localStorage.getItem('myCat')}</div>
{/if}

@ota-meshi
Copy link
Member Author

<script>
	import { browser, dev } from '$app/environment';
</script>

{#if browser || (dev && browser)}
	<div>{localStorage.getItem('myCat')}</div>
{/if}

Hmm. That would require checking all the condition paths, which is quite difficult, so I think we need to tackle it as a separate problem. What do you think?

@baseballyama baseballyama merged commit d92dde0 into main Sep 8, 2025
17 checks passed
@baseballyama baseballyama deleted the fix-no-top-level-browser-globals branch September 8, 2025 10:06
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

Successfully merging this pull request may close these issues.

False positive for no-top-level-browser-globals with compound expression
2 participants