-
-
Notifications
You must be signed in to change notification settings - Fork 24
feat: makes it optional whether to parse runes. #536
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Conversation
🦋 Changeset detectedLatest commit: baf724a 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 |
Pull Request Test Coverage Report for Build 9534250043Details
💛 - Coveralls |
Pull Request Test Coverage Report for Build 9534267800Details
💛 - Coveralls |
Pull Request Test Coverage Report for Build 9534824834Details
💛 - Coveralls |
Pull Request Test Coverage Report for Build 9540091489Details
💛 - Coveralls |
Done |
Pull Request Test Coverage Report for Build 9541551900Details
💛 - Coveralls |
Pull Request Test Coverage Report for Build 9541685261Details
💛 - Coveralls |
I have a question. Both runes mode and legacy mode can use store right? |
This is just my opinion but, in 99% of cases, |
Hmm... I guess I misunderstood something. |
You are right about the For example, the following issue in sveltejs/eslint-plugin-svelte#311 For example, we can get the correct https://sveltejs.github.io/eslint-plugin-svelte/user-guide/#settings-svelte-kit Currently, the parser does not use any information other than |
Agreed! How about mimic the logic with As default, user don't need to configure It would be convenient for users if fewer settings could be made. |
Unfortunately, currently the eslint custom parser cannot load ESMs because it needs to run synchronously, so |
Ah I forgot this😅. |
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.
Nice!
@baseballyama I have a question. Will the Svelte core compiler automatically parse runes as runes when they are used, even without |
Ahh, yeah, you are right. |
I'm fixing. |
related to #423
This PR changes the parser to allow opt-in/out of Rune parsing. (However, it requires Svelte v5.)
The main changes are:
svelteFeatures.runes
to control whether runes are parsed.parserOptions.svelteConfig
to specifysvelte.config.js
.If not specified, some config will be statically parsed from the
svelte.config.js
file.svelteFeatures.runes
, it will read thecompilerOptions.runes
insvelte.config.js
.<svelte:options runes={...}>
is present, it determines whether to prioritize them and parse Runes.svelteParseContext
, to make that information available to the eslint-plugin.I think the next issue can be solved by telling the compiler whether it should parse in rune mode.$page is an illegal variable name eslint-plugin-svelte#652