Skip to content

No runes outside svelte #1030

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
rChaoz opened this issue Jan 17, 2025 · 4 comments
Closed

No runes outside svelte #1030

rChaoz opened this issue Jan 17, 2025 · 4 comments
Labels

Comments

@rChaoz
Copy link

rChaoz commented Jan 17, 2025

Motivation

I don't think an explanation is needed - using runes outside Svelte files results in runtime errors/crashes, or at the very least doesn't work.

Description

No runes at all outside .svelte, .svelte.{js,ts} files (per configuration), except if imported, i.e. disallow global use of rune identifiers in regular files.

@rChaoz rChaoz added enhancement New feature or request new rule labels Jan 17, 2025
@ota-meshi
Copy link
Member

ota-meshi commented Jan 22, 2025

For now you need to add configs for parser.

https://github.com/sveltejs/svelte-eslint-parser#runes-support

It would be nice to add that to the recommended config, but that might be difficult since we don't know what JavaScript and TypeScript parsers our users are using.

I misunderstood what was written in this issue 😓

@ota-meshi
Copy link
Member

Does the no-undef rule not work? I think $state will be reported as an undefined identifier in *.js files other than *.svelte.js.

@baseballyama
Copy link
Member

Oh, Yes. We can see this error.

Image

@baseballyama
Copy link
Member

This seems to be an issue with the eslint.config.js settings, so I will close it. I will reopen it if the problem becomes clear with the provided REPL.

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

No branches or pull requests

3 participants