TypeScript icon indicating copy to clipboard operation
TypeScript copied to clipboard

Do not indent semicolons on new lines

Open ChiriVulpes opened this issue 1 year ago • 6 comments

Fixes #48571

ChiriVulpes avatar Aug 24 '24 05:08 ChiriVulpes

@typescript-bot pack this

DanielRosenwasser avatar Aug 27 '24 18:08 DanielRosenwasser

Starting jobs; this comment will be updated as builds start and complete.

Command Status Results
pack this ✅ Started ✅ Results

typescript-bot avatar Aug 27 '24 18:08 typescript-bot

Hey @DanielRosenwasser, I've packed this into an installable tgz. You can install it for testing by referencing it in your package.json like so:

{
    "devDependencies": {
        "typescript": "https://typescript.visualstudio.com/cf7ac146-d525-443c-b23c-0d58337efebc/_apis/build/builds/163464/artifacts?artifactName=tgz&fileId=93A2E2FF5FB5BF284A820B4F94B53E7E0185446277C34E0DACE2AA284E2B4FD602&fileName=/typescript-5.7.0-insiders.20240827.tgz"
    }
}

and then running npm install.


There is also a playground for this build and an npm module you can use via "typescript": "npm:@typescript-deploys/[email protected]".;

typescript-bot avatar Aug 27 '24 18:08 typescript-bot

I'm surprised there's no test for this, but there's a change where the following

type X =
    | 1
    | 2
    | 3
    ;

is now formatted into:

type X =
    | 1
    | 2
    | 3
;

We also used to support going the opposite way, where the latter was formatted into the former.

I don't think that that's desirable. Not sure if others have opinions here.

DanielRosenwasser avatar Aug 27 '24 20:08 DanielRosenwasser

Yeah, that would probably be a regression. Should definitely have a test for it...

jakebailey avatar Aug 27 '24 20:08 jakebailey

Hmm. That's going to require scanning forward to see if the ; is alone on the line (or just it and comments?)

Since that adds probably too much complexity, maybe it would be best to only do what this commit does if the semicolons format option is set to remove?

ChiriVulpes avatar Aug 27 '24 23:08 ChiriVulpes