fix: keep `this` binding inside function screen while formatting it
MODIFY
internal/formatter/builders/js/auxiliary/JSFunctionHead.ts
internal/formatter/builders/js/auxiliary/JSFunctionHead.ts
@@ -22,7 +22,7 @@ export default function JSFunctionHead(
const printedParameters = printBindingPatternParams(
builder,
node,
- node.params,
+ node.thisType ? [node.thisType, ...node.params] : node.params,
node.rest,
);

ADD
internal/formatter/test-fixtures/typescript/thisType/input.ts
+function bound(this: ToBind) {};
+type Buond = (this: ToBind) => void;
+
+class ToBind {
+ private bound: Buond;
+ constructor() {
+ this.bound = bound.bind(this);
+ this.bound();
+ }
+}

fix: keep `this` binding inside function screen while formatting it (#1057)