Skip to content

Allman style in import syntax seems weird #57303

@ngdangtu-vn

Description

@ngdangtu-vn

Does this issue occur when all extensions are disabled?: Yes/No

  • VS Code Version: 1.86.0
  • OS Version: Linux Tastral 6.5.0-10022-tuxedo microsoft/vscode#26 SMP PREEMPT_DYNAMIC Thu Jan 18 02:29:42 UTC 2024 x86_64 x86_64 x86_64 GNU/Linux (ubuntu-based - TuxedoOS 2)

Steps to Reproduce:

  1. Add an import line
  2. Break import line into 2 lines from the inside of bracket
  3. Format for first time, you'll see all brackets got new line and indented
    image
  4. Format for second time, you'll see all brackets lose its indentation
    image

I see 2 problems in here:

  1. Format 2 times with 2 different results is no good
  2. If the from keyword got new line, it always get intended. I don't think it make sense. Can we just have like this:
import
{
   ChallengeTier,
   ChallengeLevel, ChallengeData
}
from './challenge.ts'

This happens when I use TypeScript. I haven't tested it on JavaScript.

Metadata

Metadata

Assignees

No one assigned

    Labels

    BugA bug in TypeScriptDomain: FormatterThe issue relates to the built-in formatterHelp WantedYou can do this

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions