-
-
Notifications
You must be signed in to change notification settings - Fork 59
fix: Support experimental.async compiler option
#1438
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
Conversation
🦋 Changeset detectedLatest commit: a4f290b The changes in this PR will be included in the next version bump. This PR includes changesets to release 1 package
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 |
Try the Instant Preview in Online PlaygroundInstall the Instant Preview to Your LocalPublished Instant Preview Packages:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR adds support for the experimental.async compiler option in Svelte 5, which allows top-level await in Svelte components. The fix ensures that when this option is configured in the eslint parser's svelteConfig, it's properly passed to the Svelte compiler during validation.
- Extracts and passes the
experimental.asynccompiler option from parser configuration to the Svelte compiler - Adds comprehensive test coverage for both valid (option enabled) and invalid (option disabled) scenarios
- Follows existing patterns for selectively passing compiler options
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated no comments.
Show a summary per file
| File | Description |
|---|---|
packages/eslint-plugin-svelte/src/shared/svelte-compile-warns/index.ts |
Extracts experimental.async from svelteConfig and passes it to compiler.compile() |
packages/eslint-plugin-svelte/tests/fixtures/rules/valid-compile/valid/svelte-config-experimental-async/_config.cjs |
Test configuration enabling experimental.async option |
packages/eslint-plugin-svelte/tests/fixtures/rules/valid-compile/valid/svelte-config-experimental-async/top-level-await-input.svelte |
Valid test case with top-level await when option is enabled |
packages/eslint-plugin-svelte/tests/fixtures/rules/valid-compile/valid/svelte-config-experimental-async/top-level-await-requirements.json |
Specifies Svelte 5.0.0+ requirement for valid test |
packages/eslint-plugin-svelte/tests/fixtures/rules/valid-compile/invalid/experimental-async-disabled/top-level-await-input.svelte |
Invalid test case with top-level await when option is disabled |
packages/eslint-plugin-svelte/tests/fixtures/rules/valid-compile/invalid/experimental-async-disabled/top-level-await-errors.yaml |
Expected error output for invalid test case |
packages/eslint-plugin-svelte/tests/fixtures/rules/valid-compile/invalid/experimental-async-disabled/top-level-await-requirements.json |
Specifies Svelte 5.0.0+ requirement for invalid test |
.changeset/wild-steaks-invent.md |
Changeset entry documenting this fix as a patch release |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
ota-meshi
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks!
close: #1434