question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

SvelteSortOption config is ignored

See original GitHub issue
"svelte.plugin.svelte.format.config.svelteSortOrder": "options-scripts-styles-markup"

formatting after setting this option still uses the default (style last)

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:9 (9 by maintainers)

github_iconTop GitHub Comments

2reactions
pushkinecommented, Jan 18, 2021

No, you can just add these non-default Svelte options to your .prettierrc file

This changes everything!

{ 
    "svelteSortOrder": "options-scripts-styles-markup" 
}

Putting this in .prettierrc does work after hitting F1 Svelte: Restart Language Server

0reactions
dummdidummcommented, Jan 18, 2021

If there’s a .prettierrc present, all options of the extension are ignored

Does this mean users have to choose between having a .prettierrc file and non-default svelte options ?

No, you can just add these non-default Svelte options to your .prettierrc file.

If you don’t set the Svelte extension as the primary formatter for Svelte files […] then the Prettier extension is used for formatting

No it’s not

It may depend on your user setting on what is used in which case. For example this

{
  "editor.defaultFormatter": "esbenp.prettier-vscode"
}

means that the Prettier extension is used for all files. I don’t know what you got in there, though, because you can also overwrite this with

"[svelte]": {
    "editor.defaultFormatter": "svelte.svelte-vscode"
  }

Then the Svelte VS Code extension is used.

Read more comments on GitHub >

github_iconTop Results From Across the Web

SvelteJS I added preferData to rollup.config.js, but it's ignored ...
Assuming you used the Svelte Rollup template, add a svelte.config.js next to your rollup config with the following
Read more >
Configuration • Docs • SvelteKit
Files with extensions that match neither config.extensions nor config.kit.moduleExtensions will be ignored by the router. outDirpermalink. default ...
Read more >
Switch loses config after reboot (wr mem does not work) : r/Cisco
If it is, you can go to global config and enter "no system ignore startupconfig switch all" to fix it.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found