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

inferred function type is wrong #6

Open
danielroe opened this issue Jun 15, 2021 · 1 comment
Open

inferred function type is wrong #6

danielroe opened this issue Jun 15, 2021 · 1 comment

Comments

@danielroe
Copy link
Member

For example, @nuxt/kit:

  globals: {
    id: () => any,
    nuxt: () => any,
    context: () => any,
    pluginPrefix: () => any,
    readyCallback: () => any,
    loadedCallback: () => any,
  }

from:

  globals: {
    id: globalName => `__${globalName}`,
    nuxt: globalName => `$${globalName}`,
    context: globalName => `__${globalName.toUpperCase()}__`,
    pluginPrefix: globalName => globalName,
    readyCallback: globalName => `on${pascalCase(globalName)}Ready`,
    loadedCallback: globalName => `_on${pascalCase(globalName)}Loaded`
  }
@pi0 pi0 transferred this issue from unjs/unbuild Jun 16, 2021
@pi0
Copy link
Member

pi0 commented Jun 16, 2021

repro

  • any should be Function
  • for nuxt kit usage, we need comments to fine-tune types (Function|String)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants