Skip to content

Use TypeScript for this repo? #121

@mrienstra

Description

@mrienstra

Now that Fabric.js v6 is chock full of Typescript-y goodness, this new repo might as well be too?

Happy to help. I'd probably start by making a new Astro repo with pnpm create astro@latest (or npm create astro@latest) and select "with Typescript" (or whatever) at the relevant prompt, then diff the two directories and move over a few things.... Well, at least copy over tsconfig.json. I guess the other obvious thing would be adding typescript as a dependency, as of yesterday Astro was using "^5.5.2".

Anyhoo, it might not be too big of a push at this stage. I've tried moving a few of the demos from .js or .jsx to .ts or .tsx, the ones I tried weren't too complicated.

The default Astro tsconfigs can be found here:
https://github.com/withastro/astro/tree/main/packages/astro/tsconfigs

The default option is "strict", which generates a tsconfig.json which looks like:

{
  "extends": "astro/tsconfigs/strict",
  "compilerOptions": {
    "jsx": "react-jsx",
    "jsxImportSource": "react"
  }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions