question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Generate exports file instead of namespace

See original GitHub issue

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:open
  • Created 3 years ago
  • Reactions:1
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

2reactions
zandalephcommented, May 12, 2021

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!

2reactions
cometkimcommented, May 11, 2021

Typescript now explicitly discourages namespaces:

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

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found