Skip to content

Enable es6 imports when using typescript#363

Merged
BenjaminVanRyseghem merged 2 commits intoBenjaminVanRyseghem:developfrom
aralisza:patch-1
Jul 23, 2018
Merged

Enable es6 imports when using typescript#363
BenjaminVanRyseghem merged 2 commits intoBenjaminVanRyseghem:developfrom
aralisza:patch-1

Conversation

@aralisza
Copy link
Contributor

@aralisza aralisza commented Jul 9, 2018

In the .d.ts file, numbro is being exported using export = numbro. In the PR that made this change, it says this is the only way to use it in typescript #232 , and it proposes to use

import * as numbro from "numbro"

to import. However, in newer versions, this now causes default to be imported as a .default member instead. Now, the only way of importing numbro properly is

import numbro = require("numbro");

This change enables using es6 syntax to import

import numbro from "numbro";

#352 explains the change in further detail.

@BenjaminVanRyseghem
Copy link
Owner

Thanks for your contribution 😄

could you add yourself in the AUTHORS file please 😄 ?

I'll merge this PR right after that

@aralisza
Copy link
Contributor Author

@BenjaminVanRyseghem Is ths PR ok to merge now?

@BenjaminVanRyseghem
Copy link
Owner

Thanks for your contribution 😄

@BenjaminVanRyseghem BenjaminVanRyseghem merged commit bbeb182 into BenjaminVanRyseghem:develop Jul 23, 2018
@BenjaminVanRyseghem
Copy link
Owner

in v2.1.1

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

Successfully merging this pull request may close these issues.

2 participants