Describe the bug
The semicolon, which is required in between a statement and an IIFE seems to trip up the TS plugin and it messes up spacing - see below.
dprint-plugin-typescript version: 0.95.13
config used:
{
"typescript": {
"semiColons": "asi"
},
"plugins": [
"https://plugins.dprint.dev/typescript-0.95.13.wasm"
]
}
Input Code
import { createRoot } from "react-dom/client"
/**
* Initializes the app
*/
;(function initReact() {
const root = createRoot(document.getElementById("root")!)
root.render(<div>hello</div>)
})()
Expected Output
same as input
Actual Output
import { createRoot } from "react-dom/client" /**
* Initializes the app
*/
;(function initReact() {
const root = createRoot(document.getElementById("root")!)
root.render(<div>hello</div>)
})()
Additional notes
Both regular and arrow function IIFEs are affected, both block and line comments are affected and the statement above the comment can be anything at all (like 1 + 1), not just import.
Describe the bug
The semicolon, which is required in between a statement and an IIFE seems to trip up the TS plugin and it messes up spacing - see below.
dprint-plugin-typescript version: 0.95.13
config used:
{ "typescript": { "semiColons": "asi" }, "plugins": [ "https://plugins.dprint.dev/typescript-0.95.13.wasm" ] }Input Code
Expected Output
same as input
Actual Output
Additional notes
Both regular and arrow function IIFEs are affected, both block and line comments are affected and the statement above the comment can be anything at all (like
1 + 1), not justimport.