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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added flowUsesCommas option for object types #3547

Merged
merged 1 commit into from
Nov 15, 2016
Merged

Conversation

sampepose
Copy link
Contributor

Currently there are 2 supported syntaxes (, and ;) in Flow Object Types. The use of commas is in line with the more popular style and matches how objects are defined in JS, making it a bit more natural to write. Recently FB added a lint rule that enforces the use of commas, so it would great to have this option in Babel as well. Thanks!

@codecov-io
Copy link

codecov-io commented Jun 23, 2016

Current coverage is 88.62% (diff: 100%)

No coverage report found for master at c1a597f.

Powered by Codecov. Last update c1a597f...ea6b752

@hzoo hzoo added the PR: New Feature 🚀 A type of pull request used for our changelog categories label Jun 24, 2016
@hzoo
Copy link
Member

hzoo commented Jun 24, 2016

I assume that was from babel/eslint-plugin-babel#57?

@sampepose Wouldn't the linting rule run before compilation (on the src files rather than dist files) especially if it is for eslint and the flow types stripped out anyway?

@sampepose
Copy link
Contributor Author

Yep, that's the same rule. The issue is I'm generating Flow types programmatically from an AST. It would be nice for these to match our lint expectations for consistent readability, even if we don't lint generated files.

On Jun 24, 2016, at 2:40 PM, Henry Zhu [email protected] wrote:

I assume that was from babel/eslint-plugin-babel#57?

@sampepose Wouldn't the linting rule run before compilation (on the src files rather than dist files)? It shouldn't be an issue in generator then?


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.

@hzoo
Copy link
Member

hzoo commented Jun 24, 2016

Makes sense and totally doable, just was wondering the feasibility of providing options for anything that can (quotes, whitespace, tabs, etc) and how we decide what to add (or support everything)

@sampepose
Copy link
Contributor Author

It probably just makes sense to add them on a case by case basis. Especially since it doesn't look like too many people need this flexibility.

On Jun 24, 2016, at 3:06 PM, Henry Zhu [email protected] wrote:

Makes sense and totally doable, just was wondering the feasibility of providing options for anything that can (quotes, whitespace, tabs, etc) and how we decide what to add (or support everything)


You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.

@hzoo hzoo added this to the Next Minor milestone Jun 27, 2016
@@ -36,6 +36,7 @@ minified | boolean | `false` | Should the output be minif
concise | boolean | `false` | Set to `true` to reduce whitespace (but not as much as `opts.compact`)
quotes | `'single'` or `'double'` | autodetect based on `ast.tokens` | The type of quote to use in the output
filename | string | | Used in warning messages
flowUsesCommas | boolean | `false` | Should Flow object types be comma delimited
Copy link
Member

Choose a reason for hiding this comment

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

How would you feel about flowCommaSeparator and

Set to true to use commas instead of semicolons as flow property separators

@loganfsmyth
Copy link
Member

This has some conflicts with my refactoring changes, but it should be easy to add back in.

@hzoo
Copy link
Member

hzoo commented Jul 27, 2016

@sampepose can you fix conflicts, or I'l do it manually

@sampepose sampepose force-pushed the master branch 2 times, most recently from da8be57 to 191b974 Compare August 3, 2016 00:31
@sampepose
Copy link
Contributor Author

Good to go!

@hzoo
Copy link
Member

hzoo commented Aug 19, 2016

Ok thanks - maybe it should just be the default (even though a breaking change - few are using the output itself)

@hzoo hzoo merged commit db85bdc into babel:master Nov 15, 2016
panagosg7 pushed a commit to panagosg7/babel that referenced this pull request Jan 17, 2017
@lock lock bot added the outdated A closed issue/PR that is archived due to age. Recommended to make a new issue label Oct 7, 2019
@lock lock bot locked as resolved and limited conversation to collaborators Oct 7, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
outdated A closed issue/PR that is archived due to age. Recommended to make a new issue PR: New Feature 🚀 A type of pull request used for our changelog categories
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants