diff --git a/packages/documentation/copy/en/javascript/JSDoc Reference.md b/packages/documentation/copy/en/javascript/JSDoc Reference.md index 7cd5d7b23e06..669834263f90 100644 --- a/packages/documentation/copy/en/javascript/JSDoc Reference.md +++ b/packages/documentation/copy/en/javascript/JSDoc Reference.md @@ -221,6 +221,7 @@ myPet.name; import types can be used to get the type of a value from a module if you don't know the type, or if it has a large type that is annoying to type: ```js twoslash +// @types: node // @filename: accounts.d.ts export const userAccount = { name: "Name", @@ -746,6 +747,7 @@ Otherwise, `@example` will be parsed as a new tag. ### Other supported patterns ```js twoslash +// @types: react class Foo {} // ---cut--- var someObj = { diff --git a/packages/typescriptlang-org/gatsby-config.js b/packages/typescriptlang-org/gatsby-config.js index 6ca35392c035..1322dfda213a 100644 --- a/packages/typescriptlang-org/gatsby-config.js +++ b/packages/typescriptlang-org/gatsby-config.js @@ -14,6 +14,8 @@ if (process.env.BOOTSTRAPPING) { require("./scripts/ensureDepsAreBuilt") +const ts = require("typescript"); + // https://github.com/gatsbyjs/gatsby/issues/1457 require("ts-node").register({ files: true }) const { join } = require("path") @@ -158,6 +160,10 @@ module.exports = { defaultOptions: { noErrorValidation: true, }, + defaultCompilerOptions: { + types: [], + target: ts.ScriptTarget.ES2020, + }, }, }, "gatsby-remark-copy-linked-files",