Skip to content

Adjust quoting behavior, adjust/remove strict option #348

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

Open
dummdidumm opened this issue Feb 22, 2023 · 2 comments
Open

Adjust quoting behavior, adjust/remove strict option #348

dummdidumm opened this issue Feb 22, 2023 · 2 comments

Comments

@dummdidumm
Copy link
Member

dummdidumm commented Feb 22, 2023

Remove the "always quote things" option because it's technically invalid: sveltejs/svelte#7925
This means we should likely deprecate the strict mode option altogether in favor of a more fine grained set of options around self closing tags, shorthand props etc.

dummdidumm added a commit that referenced this issue Jul 14, 2023
- add `svelteSelfCloseComponents` and `svelteSelfCloseElements` to specify whether or not empty elements/components should self-close. `svelteStrictMode` no longer has any effect on this behavior
- `svelteAllowShorthand` now takes precedence over `svelteStrictMode`, which no longer has any effect on that behavior
- `svelteStrictMode` is deprecated as future Svelte versions might coerce numbers coming from mustache tags inside strings into strings

closes #348
closes #284
closes #279
closes #238
related to #377
dummdidumm added a commit that referenced this issue Jul 14, 2023
- whether or not empty elements/components should self-close is now left to the user - in other words, if you write `<div />` or `<Component />` that stays as is, and so does `<div></div>`/`<Component></Component>`. `svelteStrictMode` no longer has any effect on this behavior
- `svelteAllowShorthand` now takes precedence over `svelteStrictMode`, which no longer has any effect on that behavior
- `svelteStrictMode` is deprecated as future Svelte versions might coerce numbers coming from mustache tags inside strings into strings

closes #348
closes #284
closes #279
closes #238
related to #377
superseeds / closes #379 as less options = better
dummdidumm added a commit that referenced this issue Jul 17, 2023
- whether or not empty elements/components should self-close is now left to the user - in other words, if you write `<div />` or `<Component />` that stays as is, and so does `<div></div>`/`<Component></Component>`. `svelteStrictMode` only has effect on elements (not allowing self-closing non-void-ones)
- `svelteAllowShorthand` now takes precedence over `svelteStrictMode`, which no longer has any effect on that behavior

closes #284
closes #279
closes #238
related to #348
related to #377
superseeds / closes #379 as less options = better
@dummdidumm
Copy link
Member Author

We decided to keep strict mode around (not deprecate it) and not adjust the quoting behavior yet, as it needs more consensus/thought. Self-closing tags are now left as-is for components, strict mode still disallows non-void dom elements to self-close.

@MrVauxs
Copy link

MrVauxs commented Apr 5, 2024

Will this be reconsidered after sveltejs/svelte#11052 happening?
It sure would be nice to have Prettier not conflict with Svelte in the future.

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

Successfully merging a pull request may close this issue.

2 participants