Svelte Syntax Highlighting & Formatting

Hi there,

I’m hoping for .svelte files (from Svelte framework) to be better supported in the editor via syntax highlighting, potentially formatting and other error handling.

You can see a setup I’m starting to build out here, which supports live-reloading:

Thanks

Hey @mattdesl,

Glitch is using CodeMirror for syntax highlighting and Prettier for code formatting. So for it to work, you’ll have to make sure that both CodeMirror and Prettier supports Svelte.

Yup, this is possible — Svelte’s own REPL uses CodeMirror, and you can find how it is set up here:


And Prettier formatter plugin:

1 Like

Hehe, but Glitch needs to install it as well. :grin: @glitch_support???

+1 for Svelte syntax highlighting and formatting. Is there a way to enable codemirror by setting a project config?

Adding another vote to this. I’d like to get syntax highlight too.

hi everyone! we have enabled syntax highlighting for svelte. it isn’t great yet, but we’re looking to improve it. thanks for the feedback!

@chance, are you @glitch_support? :face_with_raised_eyebrow: :thinking:

@khalby786 not glitch support, but i work on the code editor here at glitch :slight_smile:

2 Likes

Sorry, I didn’t know that! :grinning:

Thats really cool! Thanks for the update!

:pray: thank you so much for this

Hello, can somebody write what to do to enable svelte formatting step by step? Simple installing prettier-plugin-svelte is not enough