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 to format current file automatically without saving manually?

See original GitHub issue

I want Prettier to format everything I type in supported languages without manually saving or unfocusing editors. formatOnType appears to be unsupported. formatOnSave only works if I set autoSave to onWindowChange or onFocusChange, but I want to be able to write large amounts of code in the current file keeping it formatted without manually saving, and afterDelay does not trigger formatOnSave.

Is there a supported configuration for this use case, or would formatOnType or afterDelay need to be implemented?

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Reactions:6
  • Comments:9 (4 by maintainers)

github_iconTop GitHub Comments

4reactions
nickmccurdycommented, Aug 6, 2018

I understand part of the issue is with VSCode and not the Prettier extension, but what is the best answer to my question? I was hoping to find a recommended solution that solves these issues, even if it doesn’t involve changes to the Prettier extension.

1reaction
benfixitcommented, Jun 1, 2019

I am still having this issue today. Looks like it has not been resolved.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to format on save on a file with no changes in JetBrains ...
You can reformat a file with ⌥ + ⌘ + L on a Mac or Ctrl + Alt + L on Windows.
Read more >
What is AutoSave? - Microsoft Support
The easy way is to turn the AutoSave switch off before you make your changes. If the changes are meant to be temporary...
Read more >
VS Code tips — Auto save - YouTube
With auto save, VS Code automatically saves your code as you work.Configure when files are auto saved with the files.autoSave setting.
Read more >
How to recover unsaved Excel file or restore its previous version
Luckily, the options to auto save and auto recover files are turned on in Excel by default. If you are not sure, you...
Read more >
Basic Editing in Visual Studio Code
Search, multiple selection, code formatting. ... The easiest way to turn on Auto Save is with the File > Auto Save toggle that...
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