You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- 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#348closes#284closes#279closes#238
related to #377
Copy file name to clipboardExpand all lines: CHANGELOG.md
+2
Original file line number
Diff line number
Diff line change
@@ -4,6 +4,8 @@
4
4
5
5
- (breaking) requires `prettier` version 3
6
6
- (breaking) requires node version 14 or higher
7
+
- (breaking) add `svelteSelfCloseComponents` and `svelteSelfCloseElements` to specify whether or not empty elements/components should self-close. `svelteStrictMode` no longer has any effect on this behavior
8
+
- (breaking) `svelteAllowShorthand` now takes precedence over `svelteStrictMode`, which no longer has any effect on that behavior
@@ -43,7 +45,7 @@ If you want to customize some formatting behavior, see section "Options" below.
43
45
44
46
## Options
45
47
46
-
``Configurations are optional``
48
+
`Configurations are optional`
47
49
48
50
Make a `.prettierrc` file in your project directory and add your preferred [options](https://prettier.io/docs/en/options.html) to [configure Prettier](https://prettier.io/docs/en/configuration.html). When using Prettier through the CLI, you can also pass options through CLI flags, but a `.prettierrc` file is recommended.
49
51
@@ -61,10 +63,15 @@ Format: join the keywords `options`, `scripts`, `markup`, `styles` with a `-` in
61
63
62
64
### Svelte Strict Mode
63
65
64
-
More strict HTML syntax: less self-closed tags, quotes in attributes, no attribute shorthand (overrules `svelteAllowShorthand`).
66
+
> Deprecated since 3.0.0. This option may be removed entirely in the future as quotes around mustache tags might be seen as coercing the value into a string in a future version of Svelte.
67
+
68
+
More strict HTML syntax: Quotes in attributes.
69
+
70
+
> In version 2 this overruled `svelteAllowShorthand`, which is no longer the case
65
71
66
72
Example:
67
73
74
+
<!-- prettier-ignore -->
68
75
```html
69
76
<!-- svelteStrictMode: true -->
70
77
<divfoo="{bar}"></div>
@@ -83,6 +90,7 @@ Option to enable/disable component attribute shorthand if attribute name and exp
0 commit comments