emoji-regex icon indicating copy to clipboard operation
emoji-regex copied to clipboard

typescript synthetic import

Open nstringham opened this issue 4 years ago • 2 comments

when using emoji-regex with es style imports such as

import emojiRegex from 'emoji-regex/es2015/RGI_Emoji';

typescript gives the following error:

This module is declared with using 'export =', and can only be used with a default import when using the 'allowSyntheticDefaultImports' flag.

looking at the typescript documentation for default exports it looks like

export = emojiRegex;

should be replaced by

export default emojiRegex;

inside each .d.ts file I tried making this change manually inside my node_modules folder and it seems to resolve the issue

note: this is a regression because it used to work in v9.2.0 but it doesn't work in v9.2.2

nstringham avatar May 22 '21 07:05 nstringham

Does anyone wanna submit a patch?

mathiasbynens avatar Mar 09 '22 12:03 mathiasbynens

@mathiasbynens if you don't like #99 I can make a PR that only include the typescript fix.

nstringham avatar Mar 10 '22 04:03 nstringham