Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Single quotes configuration with deno fmt

Every time I use deno fmt, it automatically converts my single quotes into double quotes.

To be more specific, when fmt is applied to a statement like this:

console.log(  'Deno'   );

The statement is changed to:

console.log("Deno");

The expected behavior is to continue using single quotes by default.

Is there any configuration of fmt options?

like image 577
Penny Liu Avatar asked Sep 19 '25 22:09

Penny Liu


2 Answers

You can now change the default behaviour of deno fmt by creating a deno.json file:

{
  "fmt": {
    "options": {
      "singleQuote": true
    }
  }
}
like image 108
Shubham Parihar Avatar answered Sep 22 '25 18:09

Shubham Parihar


Currently, there's no way to change default settings. Adding a config flag it's something that's being worked on, you can follow this issue

like image 41
Marcos Casagrande Avatar answered Sep 22 '25 18:09

Marcos Casagrande