typehole icon indicating copy to clipboard operation
typehole copied to clipboard

Use type assertion when no variable binding is around

Open rikukissa opened this issue 3 years ago • 0 comments

So instead of using a generic type variable in the typehole, the plugin could add

import App from "./App.svelte";
import typehole from "typehole";

type AutoDiscovered = any;

const app = new App({
  target: typehole.t<AutoDiscovered>(document.getElementById("app")),
});

export default app;
import App from "./App.svelte";
import typehole from "typehole";

type AutoDiscovered = any;

const app = new App({
  target: typehole.t(document.getElementById("app") as AutoDiscovered),
});

export default app;

rikukissa avatar May 12 '21 17:05 rikukissa