why noExport default options set true..?
youngrove opened this issue · comments
Issue
- useStaticQuery auto fixed but default export options set noExport.
My auto generated types is here..
// no export
declare namespace GatsbyTypes {
...
But, I can't use GatsbyTypes for My query.
In codegen.ts
const DEFAULT_TYPESCRIPT_CONFIG: Readonly<TypeScriptPluginConfig> = {
avoidOptionals: true,
immutableTypes: true,
maybeValue: 'T | undefined',
noExport: true,
enumsAsTypes: true,
};
I added this line when I used generated types...
/// <reference path = "../__generated__/gatsby-types.ts" />
And I Got this error. I Knew If I change ts.config file It will resolved..
But I wonder why set default noexport options set true..
'gatsby-types.ts' cannot be compiled under '--isolatedModules' because it is considered a global script file. Add an import, export, or an empty 'export {}' statement to make it a module.
As you can see, the codegen output doesn't use any module output, but just declare the global namespace GatsbyTypes
.
This may be incompatible with the --isolatedModules
, so you can explicitly mark it as *.d.ts
if needed.