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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix printer for explicitly inexact Flow types #10041

Merged
merged 1 commit into from May 29, 2019
Merged

Fix printer for explicitly inexact Flow types #10041

merged 1 commit into from May 29, 2019

Conversation

mrtnzlml
Copy link

Closes: #10040 馃帀

Q 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 聽 A
Fixed Issues? Fixes #10040
Patch: Bug Fix? Yes
Major: Breaking Change? No
Minor: New Feature? No
Tests Added + Pass? Yes
Documentation PR Link
Any Dependency Changes? No
License MIT

@existentialism existentialism added the PR: Bug Fix 馃悰 A type of pull request used for our changelog categories label May 29, 2019
Copy link
Member

@nicolo-ribaudo nicolo-ribaudo left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you also add a test when the compact: true option is enabled?

@mrtnzlml
Copy link
Author

@nicolo-ribaudo Added. Is this the right way how to do it?

@mrtnzlml
Copy link
Author

Also, CI failed but doesn't seem to be related (?). It's green when I run locally. Travis seems to be happy as well.

@existentialism
Copy link
Member

@mrtnzlml restarted it

@nicolo-ribaudo
Copy link
Member

Yes 馃憤 I asked for that test because when printing objects we indent, dedent, indent and dedent again.

Copy link
Member

@existentialism existentialism left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

馃憤 nice work @mrtnzlml!

@mrtnzlml
Copy link
Author

I asked for that test because when printing objects we indent, dedent, indent and dedent again.

馃 I see, is there a way how to avoid my manual indent/dedent?

@babel-bot
Copy link
Collaborator

Build successful! You can test your changes in the REPL here: https://babeljs.io/repl/build/10891/

@nicolo-ribaudo
Copy link
Member

It is possible to pass an option to printJoin to avoid indenting there, and only indent ad the start and at the end of ObjectTypeAnnotation. Anyway, since .indent() only does something like this.indentLevel++, it's fine as-is.

I'm merging this PR, thank you 馃槃

@nicolo-ribaudo nicolo-ribaudo merged commit ce4c374 into babel:master May 29, 2019
@mrtnzlml mrtnzlml deleted the fix-explicit-inexact-flow-printer branch May 29, 2019 19:18
@mrtnzlml
Copy link
Author

@nicolo-ribaudo Hi, when can we expect this to be released? Seems like it's still not and I just faced this bug again today.

@lock lock bot added the outdated A closed issue/PR that is archived due to age. Recommended to make a new issue label Oct 3, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Oct 3, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area: flow outdated A closed issue/PR that is archived due to age. Recommended to make a new issue pkg: generator PR: Bug Fix 馃悰 A type of pull request used for our changelog categories
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Flow: losing info about explicitly inexact objects
4 participants