Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[gatsby-plugin-typescript]: options schema is missing a few options #29063

Closed
hasparus opened this issue Jan 18, 2021 · 0 comments · Fixed by #29066
Closed

[gatsby-plugin-typescript]: options schema is missing a few options #29063

hasparus opened this issue Jan 18, 2021 · 0 comments · Fixed by #29066
Labels
topic: TypeScript Issues and PRs related to TS in general, public typings or gatsby-plugin-typescript

Comments

@hasparus
Copy link
Contributor

All options are passed to babel-preset-typescript, which also supports jsxPragmaFrag, allowNamespaces, allowDeclareFields, and onlyRemoveTypeImports.

11:30:38 AM: warning Warning: there are unknown plugin options for "gatsby-plugin-typescript": allowNamespaces
11:30:38 AM: Please open an issue at ghub.io/gatsby-plugin-typescript if you believe this option is valid.

function onCreateBabelConfig({ actions }, options) {
actions.setBabelPreset({
name: require.resolve(`@babel/preset-typescript`),
options,
})

exports.pluginOptionsSchema = ({ Joi }) =>
Joi.object({
isTSX: Joi.boolean().description(`Enables jsx parsing.`).default(false),
jsxPragma: Joi.string()
.description(`Replace the function used when compiling JSX expressions.`)
.default(`React`),
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) }),
})

@gatsbot gatsbot bot added the status: triage needed Issue or pull request that need to be triaged and assigned to a reviewer label Jan 18, 2021
@LekoArts LekoArts added topic: TypeScript Issues and PRs related to TS in general, public typings or gatsby-plugin-typescript and removed status: triage needed Issue or pull request that need to be triaged and assigned to a reviewer labels Jan 18, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
topic: TypeScript Issues and PRs related to TS in general, public typings or gatsby-plugin-typescript
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants