Skip to content

fmt with verbatimModuleSyntax? #22583

@vicary

Description

@vicary

Currently Deno fmt sorts verbatim imports alphabetically, this is conflicting with the Organize Imports in VS Code where it sorts import { type ... } entries individually at the end.

Example:

// VS Code
import {
  bar, 
  foo, 
  type Bar, 
  type Foo
} from "module";

// Deno fmt
import {
  type Bar, 
  bar, 
  type Foo, 
  foo
} from "module";

When combined with the following VS Code option, all of the files flashes between the two formats in random order depending on how formatOnSave is configured.

"editor.codeActionsOnSave": {
    "source.organizeImports": "explicit"
}

Is it possible to add an option for Deno fmt, either disabling that part or expose an option to align with VS Code?

Metadata

Metadata

Assignees

Labels

deno fmtRelated to the "deno fmt" subcommand or dprintfeatnew feature (which has been agreed to/accepted)

Type

No type

Projects

No projects

Milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions