-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Conversation
Hi @oscarmorrison! We appreciate your attention to the documentation and helping us improve. I believe that the proposed change would put that line over 80 characters, which is the limit we usually use for line length within Facebook. I assume that is why the variable assignment was there. In fact - if you're looking for quick wins to improve this project, fixing long lines in the Draft.js source and docs would be helpful. There are many lines over 80 characters throughout the Draft.js source. We're looking to enable better linting of this, but for now I don't think our linter is flagging it. |
Hi @flarnie thanks for the comment. I was actually doing it as I was ramping someone up on Draft who was also new to React (& ES6) Also as you can see in the example code on the next page in the docs: is there. so it keeps the consistency |
@oscarmorrison You have a good point about the destructuring potentially being confusing for folks who are new to ES6/JS/React, and the new syntax is also more consistent with the other example. The line is exactly 80 characters when we don't take the indentation into account. With the indentation it crosses the 80 character line, shown in red in my editor here: In cases like this we usually use parenthesis to wrap to the next line: I'd be happy to land this if it were tweaked in this way, and thanks for explaining. I should have made this suggestion in the first place rather than closing the PR, sorry about that. |
9cda283
to
28d51bc
Compare
Done. Thanks for reopening. |
Also it seems that your linter max len is 120: |
Simplifies code and minimizes new concepts.
28d51bc
to
d585753
Compare
Fixed a spacing typo and rebased. All good to go. Thanks @flarnie |
Thanks for flagging that the linter is still set to 120. Internally we just moved to 80 fairly recently, I need to get the linter here in sync with our internal one. And thanks for updating this! |
Simplifies code and minimizes new concepts.
Before submitting a pull request, please make sure the following is done...
master
.npm test
)npm run lint
) and passes Flow (npm run flow
)Please use the simple form below as a guideline for describing your pull request.
Thanks for contributing to Draft.js!
Summary
Remove unneeded code in example
[...]
Test Plan
No functional change
[...]
Simplifies code and minimizes new concepts.