diff --git a/packages/gatsby-plugin-typescript/src/__tests__/gatsby-node.js b/packages/gatsby-plugin-typescript/src/__tests__/gatsby-node.js index 1dce01b41caf1..989f0c17446f9 100644 --- a/packages/gatsby-plugin-typescript/src/__tests__/gatsby-node.js +++ b/packages/gatsby-plugin-typescript/src/__tests__/gatsby-node.js @@ -95,6 +95,9 @@ describe(`gatsby-plugin-typescript`, () => { isTSX: false, jsxPragma: `ReactFunction`, allExtensions: false, + allowNamespaces: false, + allowDeclareFields: false, + onlyRemoveTypeImports: false, }) expect(isValid).toBe(true) diff --git a/packages/gatsby-plugin-typescript/src/gatsby-node.js b/packages/gatsby-plugin-typescript/src/gatsby-node.js index 3c60f83a40363..0ccfe8c41fe28 100644 --- a/packages/gatsby-plugin-typescript/src/gatsby-node.js +++ b/packages/gatsby-plugin-typescript/src/gatsby-node.js @@ -41,10 +41,29 @@ exports.pluginOptionsSchema = ({ Joi }) => jsxPragma: Joi.string() .description(`Replace the function used when compiling JSX expressions.`) .default(`React`), + jsxPragmaFrag: Joi.string() + .description( + `Replace the function used when compiling JSX fragment expressions.` + ) + .optional(), allExtensions: Joi.boolean() .description(`Indicates that every file should be parsed as TS or TSX.`) .default(false) .when(`isTSX`, { is: true, then: Joi.valid(true) }), + allowNamespaces: Joi.boolean() + .description(`Enables compilation of TypeScript namespaces.`) + .optional(), + allowDeclareFields: Joi.boolean() + .description( + `When enabled, type-only class fields are only removed if they are prefixed with the declare modifier.` + ) + .optional(), + onlyRemoveTypeImports: Joi.boolean() + .description( + `When set to true, the transform will only remove type-only imports (introduced in TypeScript 3.8).` + + `This should only be used if you are using TypeScript >= 3.8.` + ) + .optional(), }) exports.resolvableExtensions = resolvableExtensions