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.

How can I `deno fmt` on file save?

See original GitHub issue

Also asked on stack overflow

I was wondering if there was a builtin way of formatting on save, right now I hacked my way into this thanks to the RunOnSave extension but it feels hacky and I don’t know if it’s a bug from the vscode-deno extension or if I’m not configuring things right

My current .vscode/settings.json

{
  "deno.enable": true,
  "deno.lint": true,
  "deno.unstable": true,
  "emeraldwalk.runonsave": {
    "commands": [
      {
        "match": "\\.ts$",
        "cmd": "deno fmt ${file}"
      }
    ]
  }
}

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Reactions:2
  • Comments:7

github_iconTop GitHub Comments

11reactions
ninofiliucommented, Feb 15, 2021

Ah yes didn’t know about this one! Indeed this appears to be the minimal vscode config to deno fmt on save

{
  "deno.enable": true,
  "editor.formatOnSave": true,
  "editor.defaultFormatter": "denoland.vscode-deno"
}
4reactions
KevinBatdorfcommented, Dec 3, 2021

Adding this to the project in .vscode/settings.json worked for me:

{
    "deno.enable": true,
    "deno.lint": true,
    "deno.unstable": false,
    "editor.formatOnSave": true,
    "[typescript]": { "editor.defaultFormatter": "denoland.vscode-deno" },
}
Read more comments on GitHub >

github_iconTop Results From Across the Web

How to format on save with the Deno VSCode extension?
Found it, I have to turn on formatting on save and specifying the Deno extension as the default formatter { "deno.enable": true, "editor....
Read more >
Code Formatter - deno fmt
Deno ships with a built-in code formatter that will auto-format the following files:
Read more >
Formatting code with deno fmt - Medium
Deno's built-in formatter is available through fmt subcommand. There are two type of inputs it can take: List of files to consider: If ......
Read more >
Quick Tip: Deno Fmt in WebStorm - Level Up Coding
3. Populate the required options. Give the watcher a name (I've gone with Deno Fmt). For Program use deno and for Arguments use ......
Read more >
deno: format on save option : WEB-53244 - JetBrains YouTrack
currently have to use a file watcher to run deno fmt , which is slow and janky. Activity settings. Andres Rodriguez commented 20...
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