-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Use ES6 import for Long in pbts
output
#1814
Comments
FWIW: There seems to be a regression here:
|
Cause found: #1802 just tacks on the import. It does not check whether the import is used. ... Reading up on import-require, it looks like that syntax should be legal (if uncommon). So I'd think Babel should consume it? Unsure. |
@Zsar awesome thanks for taking a look it helped me a lot. After a bit more time digging into this, it finally dawned on me that Babel should not be consuming this file at all. I have solved the issue by excluding A bit more info before I close this: I am using the common setup in which TypeScript's The However, Babel does not do any type checking. It expects you to have validated your types separately. As a result As a result, this line should not be a problem whether you are using Babel or
|
protobuf-cli version: 1.0.2
pbts
output includes the line:Babel subsequently chokes on this line:
Manually changing this line to
import Long from "long";
makes Babel happy.I'd like to keep my Babel configuration the way it is. Is there any way to tell
pbts
to use ES6 syntax for this line? Alternatively, is there a way to tell it to omit this line?The text was updated successfully, but these errors were encountered: