Skip to content

[readme] update blocks 16.1 #2513

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

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

Yatin-kathuria
Copy link
Contributor

I gone through the eslint: nonblock-statement-body-position documentation where they didn't mention about the function as block for this rule so, I removed the function example and clearly mention the block statements on which this rule implies.

Copy link
Collaborator

@ljharb ljharb left a comment

Choose a reason for hiding this comment

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

It'd be nice if we discussed these kinds of changes in issues before making a PR, since most of them have turned out to be unnecessary.

@@ -2144,8 +2144,8 @@ Other Style Guides

## Blocks

<a name="blocks--braces"></a><a name="16.1"></a>
Copy link
Collaborator

Choose a reason for hiding this comment

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

existing numbered links must never be removed; URLs must work forever.

<a name="blocks--braces"></a><a name="16.1"></a>
- [16.1](#blocks--braces) Use braces with all multiline blocks. eslint: [`nonblock-statement-body-position`](https://eslint.org/docs/rules/nonblock-statement-body-position)
<a name="blocks--braces"></a>
- [16.1](#blocks--braces) Use braces with `if`, `else`, `while`, `do-while`, and `for` statements when writing multiline blocks. eslint: [`nonblock-statement-body-position`](https://eslint.org/docs/rules/nonblock-statement-body-position)
Copy link
Collaborator

Choose a reason for hiding this comment

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

That's because function bodies aren't a block, they're a function body.

The eslint rule doesn't ever have to cover the entirety of the guide section - the guide is the source of truth, and the guide applies to all blocks.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

ok, got the point.

@ljharb ljharb marked this pull request as draft May 24, 2022 16:01
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants