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

[typescript] const consola = require('consola') type is wrong #89

Closed
pi0 opened this issue Dec 31, 2019 · 1 comment
Closed

[typescript] const consola = require('consola') type is wrong #89

pi0 opened this issue Dec 31, 2019 · 1 comment

Comments

@pi0
Copy link
Member

pi0 commented Dec 31, 2019

Ref: #80

Fix a typing issue that causes this to throw a typing error on consola.green:

// @ts-check

const consola = require('consola')

consola.green('foo')

Workaround:

// globals.d.ts

import { Consola } from 'consola'

declare module 'consola' {
  export = new Consola()
}
This question is available on Nuxt community (#c68)
@ghost ghost closed this as completed Dec 31, 2019
@ghost ghost added the cmty:question label Dec 31, 2019
@pi0 pi0 reopened this Dec 31, 2019
@unjs unjs deleted a comment Dec 31, 2019
@pi0
Copy link
Member Author

pi0 commented Mar 31, 2023

should be fixed in v3

@pi0 pi0 closed this as completed Mar 31, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant