This starter is based on my comprehensive tutorial series on Migrating Gatsby Site to TypeScript.
The TypeScript boilerplate is converted from the popular gatsby-starter-blog.
Have anything to add to this boilerplate? Just create an issue.
-
Install all dependencies.
npm install
-
Start developing.
Navigate into your new siteβs directory and start it up.
npm start
-
Type-check your code
Just before commiting, run the following code to type-check all your files.
npm run type-check
-
Build the static website
Navigate into your new siteβs directory and start it up.
npm run build
- TypeScript for all Gatsby and React files
- Linting with ESLint & Prettier
- Plugin for SASS/SASS modules
- Automatic generation of GraphQL query interfaces
- GraphQL query result validation with DeepPropertyAccess and default props. Check the example Bio component.
A quick look at the top-level files and directories you'll see in a Gatsby + TypeScript project.
.
βββ .vscode
βββ node_modules
βββ src
βββ content
βββ .gitignore
βββ .prettierrcignore
βββ .prettierrc.js
βββ gatsby-config.js
βββ gatsby-config.ts
βββ gatsby-node.ts
βββ tsconfig.json
βββ LICENSE
βββ package-lock.json
βββ package.json
βββ README.md