Skip to content

Commit

Permalink
prettier
Browse files Browse the repository at this point in the history
  • Loading branch information
Rich-Harris committed Nov 14, 2023
1 parent 1e697d3 commit 800d8d7
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 16 deletions.
18 changes: 4 additions & 14 deletions .prettierrc
Original file line number Diff line number Diff line change
Expand Up @@ -3,33 +3,23 @@
"singleQuote": true,
"trailingComma": "none",
"printWidth": 100,
"plugins": [
"prettier-plugin-svelte"
],
"plugins": ["prettier-plugin-svelte"],
"overrides": [
{
"files": [
"*.svelte"
],
"files": ["*.svelte"],
"options": {
"bracketSameLine": false
}
},
{
"files": [
"README.md",
"packages/*/README.md",
"**/package.json"
],
"files": ["README.md", "packages/*/README.md", "**/package.json"],
"options": {
"useTabs": false,
"tabWidth": 2
}
},
{
"files": [
"sites/svelte-5-preview/src/routes/docs/content/**/*.md"
],
"files": ["sites/svelte-5-preview/src/routes/docs/content/**/*.md"],
"options": {
"printWidth": 60
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,10 @@ In rare cases, you may need to run code _before_ the DOM updates. For this we ca
messages;
// autoscroll when new messages are added
if (div.offsetHeight + div.scrollTop > div.scrollHeight - 20) {
if (
div.offsetHeight + div.scrollTop >
div.scrollHeight - 20
) {
tick().then(() => {
div.scrollTo(0, div.scrollHeight);
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,9 @@ Beyond the complexities listed above, the current design imposes some unfortunat
export {};
// @filename: index.ts
// ---cut---
let theme: 'light' | 'dark' = $derived(dark ? 'dark' : 'light');
let theme: 'light' | 'dark' = $derived(
dark ? 'dark' : 'light'
);
```
- Updating values inside `$:` statements can cause [confusing behaviour](https://github.com/sveltejs/svelte/issues/6732) and [impossible to resolve bugs](https://github.com/sveltejs/svelte/issues/4933) and the statements may run in an [unexpected order](https://github.com/sveltejs/svelte/issues/4516)
- `$: {...}` doesn't let you return a cleanup function the way that [`$effect`](runes#$effect) does
Expand Down

0 comments on commit 800d8d7

Please sign in to comment.