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

iconv-lite not found in imported namespace #186

Closed
lublak opened this issue Sep 20, 2022 · 6 comments
Closed

iconv-lite not found in imported namespace #186

lublak opened this issue Sep 20, 2022 · 6 comments

Comments

@lublak
Copy link

lublak commented Sep 20, 2022

If it is the same problem as this one it can be closed immediately: #31

Only solution: disable import/namespace

I would like to use this library.
I use iconv-lite following:

import * as iconv from 'iconv-lite';

iconv.encodingExists('utf8') // error 'encodingExists' not found in imported namespace 'iconv' import/namespace
iconv.decode(buffer, decoding); // error 'decode' not found in imported namespace 'iconv' import/namespace
iconv.encode(text, encoding); // error 'encode' not found in imported namespace 'iconv' import/namespace
@JounQin
Copy link
Collaborator

JounQin commented Sep 20, 2022

There is no need to use declare module 'iconv-lite' in its self declaration package and eslint-plugin-import just don't understand that syntax.

https://unpkg.com/browse/iconv-lite@0.6.3/lib/index.d.ts

@JounQin
Copy link
Collaborator

JounQin commented Sep 20, 2022

See also wojtekmaj/react-date-picker#419

@lublak
Copy link
Author

lublak commented Sep 20, 2022

@JounQin thanks. I created a pull request for this.

@lublak
Copy link
Author

lublak commented Sep 20, 2022

@JounQin is it possible to override this file in my own project?
I don't expect it to be released in the next few months.
And of course, since I don't want to wait that long, I would need a solution now.

@JounQin
Copy link
Collaborator

JounQin commented Sep 20, 2022

@lublak
Copy link
Author

lublak commented Sep 20, 2022

@JounQin thanks :) not the best solution, but I think the only one that exists. Typescript does not support overwriting if I see correctly. So no /myowntypingsfolder/

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

No branches or pull requests

2 participants