-
-
Notifications
You must be signed in to change notification settings - Fork 906
Remove const enum from Level TypeScript definition (#295) #296
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
Conversation
|
|
|
You should open an issue on Babel instead. |
|
Sure, no problem. Thank you for your time. |
|
Actually it's not Babel issue. It's more like TypeScript issue with isolated modules. |
|
Please reconsider this PR. This isn't a Babel issue;
Independently, using Here are some comments from TypeScript team members saying that you should never use My current situation is I have a large TypeScript project and recently added Note that this PR is incomplete. To change |
|
There appears to be some discussion on this here: microsoft/TypeScript#20703 Kind of a bummer, but I'm using create-react-app which (if you don't eject) heavy-handedly forces |
|
@the-simian I submitted microsoft/TypeScript#28465 and I think (but haven't confirmed) that it will be released in TypeScript 3.4, coming out very soon. That means that after upgrading TypeScript, you'll only get errors if you try to use (For other reasons mentioned above, I still think it's best for libraries to either ship concrete (non- |
The more recent version of TypeScript works around a [problem][chalk-problem] encountered with the chalk package's type definitions. [chalk-problem]: chalk/chalk#296 (comment)
The more recent version of TypeScript works around a [problem][chalk-problem] encountered with the chalk package's type definitions. [chalk-problem]: chalk/chalk#296 (comment)
|
@alangpierce On Typescript 3.7.5, I get this error just from I wonder if that change to typescript was not enough, or if the issue was re-introduced in either typescript or by some change in this library since then. |
That error is caused by the fact that you have the You can add |
Fixes #295.
I changed the type definition for
Levelto use a naked enum. This makes the type definitions compatible with Babel compiled TypeScript.I enabled the
isolatedModulescompiler flag so that the introduction of incompatible code will be caught as an error.const enum, if I'm not mistaken, only controls emit behavior. Changing it to a normalenumin the type definitions should not change the semantic meaning.