Generate exports file instead of namespace
See original GitHub issueIssue Description
I will be nice to add an option generate a export files instead of a namespace called GatsbyTypes
That way one can simply import the necessary types directly.
Issue Analytics
- State:
- Created 2 years ago
- Reactions:1
- Comments:8 (4 by maintainers)
Top Results From Across the Web
Explain "export =" and "export as namespace" syntax in ...
Googling around, I've found references to this being used to make a declaration file usable in both module-based and non-module-based systems.
Read more >document generates wrong S3 exports if NAMESPACE doesn ...
The problem is that my deployment process (which generates the documentation) starts from a blank slate, i.e. no NAMESPACE file exists yet.
Read more >Managing imports and exports
Because evalNamespace() is run in the package environment, it can only generate exports, not imports. Imports. The NAMESPACE also controls which functions from ......
Read more >Chapter 11 Namespace | R Packages
The exports helps you avoid conflicts with other packages by specifying which ... Instead, in this chapter you'll learn how to generate the...
Read more >Documentation - Modules - TypeScript
Modules are executed within their own scope, not in the global scope; ... Conversely, a file without any top-level import or export declarations...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Ah! I was lulled into too much a sense of security by Gatsby 3’s new built-in typescript support. I knew it seemed too easy.
You nailed it, running
npx tsc --init
got VSCode happy right away. Thanks!It’s not to be used as a replacement for JavaScript objects and isn’t relevant as long as the plugin deals only with types without any JavaScript semantics.
I mainly use coc.nvim, and I’m dogfooding this plugin with my coworkers using VSCode. This should work out of the box in any Gatsby project by default with no additional settings.
@zandaleph Can you provide me a reproduction that the plugin doesn’t work properly?
I understand that there are use cases where you would like to use module semantics directly instead of global/namespaces, and I have plan to experiment various output modes in v3.x