Skip to content

Conversation

Yukinosuke-Takada
Copy link
Contributor

Prerequisites checklist

What is the purpose of this pull request? (put an "X" next to an item)

[x] Documentation update
[ ] Bug fix (template)
[ ] New rule (template)
[ ] Changes an existing rule (template)
[ ] Add autofix to a rule
[ ] Add a CLI option
[ ] Add something to the core
[ ] Other, please explain:

What changes did you make? (Give an overview)

Before:
The example code explaining the base rule (without options) was written under the {"allowElseIf": "true"} . So it was unclear what the sample code was explaining, what the rule does, or what the option does.

After:
Added a new example code section before the "Option" section (Other ESLint rule docs also follow this format), which explains the rule without the option.

Is there anything you'd like reviewers to focus on?

@Yukinosuke-Takada Yukinosuke-Takada requested a review from a team as a code owner August 6, 2025 07:54
@github-project-automation github-project-automation bot moved this to Needs Triage in Triage Aug 6, 2025
@eslint-github-bot eslint-github-bot bot added the documentation Relates to ESLint's documentation label Aug 6, 2025
Copy link

netlify bot commented Aug 6, 2025

Deploy Preview for docs-eslint ready!

Name Link
🔨 Latest commit 6faafb8
🔍 Latest deploy log https://app.netlify.com/projects/docs-eslint/deploys/6896e9c4b1459100075f1bd7
😎 Deploy Preview https://deploy-preview-19991--docs-eslint.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@Yukinosuke-Takada
Copy link
Contributor Author

Yukinosuke-Takada commented Aug 6, 2025

How do I check if it will be rendered correctly on the website? I haven't done that.

@fasttime fasttime moved this from Needs Triage to Triaging in Triage Aug 7, 2025
@fasttime
Copy link
Member

fasttime commented Aug 7, 2025

Thanks for the pull request @Yukinosuke-Takada.

How do I check if it will be rendered correctly on the website? I haven't done that.

Your changes can be seen at:

https://deploy-preview-19991--docs-eslint.netlify.app/rules/no-else-return

You can get there live if you click on the "Deploy Preview" link in the netlify comment above and then navigate to the page as you would do on the ESLint website.

You can also preview your documentation changes locally as explained here.

Copy link
Member

@fasttime fasttime left a comment

Choose a reason for hiding this comment

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

It makes sense to show examples of code that is correct/incorrect for all option settings before introducing the option, so marking as accepted. I left some suggestions.

@@ -103,43 +82,91 @@ function foo1() {
return y;
}

return z;
return z;
Copy link
Member

Choose a reason for hiding this comment

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

This looks like an accidental change.

Suggested change
return z;
return z;


:::

Examples of **correct** code for the default `{"allowElseIf": "true"}` options:
Copy link
Member

Choose a reason for hiding this comment

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

The option value must be a boolean:

Suggested change
Examples of **correct** code for the default `{"allowElseIf": "true"}` options:
Examples of **correct** code for the default `{"allowElseIf": true}` option:

### allowElseIf: false

Examples of **incorrect** code for this rule:
Examples of **incorrect** code for the default `{"allowElseIf": "false"}` options:
Copy link
Member

Choose a reason for hiding this comment

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

By default, allowElseIf is not false:

Suggested change
Examples of **incorrect** code for the default `{"allowElseIf": "false"}` options:
Examples of **incorrect** code for the `{"allowElseIf": false}` option:

@@ -157,7 +184,7 @@ function foo() {

:::

Examples of **correct** code for this rule:
Examples of **correct** code for the default `{"allowElseIf": "false"}` options:
Copy link
Member

Choose a reason for hiding this comment

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

As above, allowElseIf is not false by default:

Suggested change
Examples of **correct** code for the default `{"allowElseIf": "false"}` options:
Examples of **correct** code for the `{"allowElseIf": false}` option:

@@ -168,7 +195,7 @@ function foo() {
if (error) {
return 'It failed';
}

Copy link
Member

Choose a reason for hiding this comment

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

Probably an accidental change.

@fasttime fasttime added the accepted There is consensus among the team that this change meets the criteria for inclusion label Aug 7, 2025
@fasttime fasttime moved this from Triaging to Implementing in Triage Aug 7, 2025
@Yukinosuke-Takada
Copy link
Contributor Author

Sorry for the late response. And thank you for the suggestion. I have applied the suggestion and fixed typos.

Comment on lines 135 to 136
* `allowElseIf: true` (default) - Allows `else if` blocks after a `return`
* `allowElseIf: false` - Disallows `else if` blocks after a `return`
Copy link
Contributor

Choose a reason for hiding this comment

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

We usually don't repeat listing the same option for different values:

Suggested change
* `allowElseIf: true` (default) - Allows `else if` blocks after a `return`
* `allowElseIf: false` - Disallows `else if` blocks after a `return`
* `allowElseIf: true` (default) - If true, allows `else if` blocks after a `return`

Copy link
Contributor

@snitin315 snitin315 left a comment

Choose a reason for hiding this comment

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

LGTM, thanks!

Leaving it open for @fasttime

Copy link
Member

@fasttime fasttime left a comment

Choose a reason for hiding this comment

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

LGTM.

@fasttime fasttime merged commit 2b87e21 into eslint:main Aug 10, 2025
30 of 31 checks passed
@github-project-automation github-project-automation bot moved this from Implementing to Complete in Triage Aug 10, 2025
robbevp pushed a commit to robbevp/website-robbevanpetegem that referenced this pull request Aug 24, 2025
This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [eslint](https://eslint.org) ([source](https://github.com/eslint/eslint)) | devDependencies | minor | [`9.33.0` -> `9.34.0`](https://renovatebot.com/diffs/npm/eslint/9.33.0/9.34.0) |

---

### Release Notes

<details>
<summary>eslint/eslint (eslint)</summary>

### [`v9.34.0`](https://github.com/eslint/eslint/releases/tag/v9.34.0)

[Compare Source](eslint/eslint@v9.33.0...v9.34.0)

#### Features

- [`0bb777a`](eslint/eslint@0bb777a) feat: multithread linting ([#&#8203;19794](eslint/eslint#19794)) (Francesco Trotta)
- [`43a5f9e`](eslint/eslint@43a5f9e) feat: add eslint-plugin-regexp to eslint-config-eslint base config ([#&#8203;19951](eslint/eslint#19951)) (Pixel998)

#### Bug Fixes

- [`9b89903`](eslint/eslint@9b89903) fix: default value of accessor-pairs option in rule.d.ts file ([#&#8203;20024](eslint/eslint#20024)) (Tanuj Kanti)
- [`6c07420`](eslint/eslint@6c07420) fix: fix spurious failure in neostandard integration test ([#&#8203;20023](eslint/eslint#20023)) (Kirk Waiblinger)
- [`676f4ac`](eslint/eslint@676f4ac) fix: allow scientific notation with trailing zeros matching exponent ([#&#8203;20002](eslint/eslint#20002)) (Sweta Tanwar)

#### Documentation

- [`0b4a590`](eslint/eslint@0b4a590) docs: make rulesdir deprecation clearer ([#&#8203;20018](eslint/eslint#20018)) (Domenico Gemoli)
- [`327c672`](eslint/eslint@327c672) docs: Update README (GitHub Actions Bot)
- [`bf26229`](eslint/eslint@bf26229) docs: Fix typo in core-concepts/index.md ([#&#8203;20009](eslint/eslint#20009)) (Tobias Hernstig)
- [`2309327`](eslint/eslint@2309327) docs: fix typo in the "Configuring Rules" section ([#&#8203;20001](eslint/eslint#20001)) (ghazi-git)
- [`2b87e21`](eslint/eslint@2b87e21) docs: \[no-else-return] clarify sample code. ([#&#8203;19991](eslint/eslint#19991)) (Yuki Takada (Yukinosuke Takada))
- [`c36570c`](eslint/eslint@c36570c) docs: Update README (GitHub Actions Bot)

#### Chores

- [`f19ad94`](eslint/eslint@f19ad94) chore: upgrade to `@eslint/js@9.34.0` ([#&#8203;20030](eslint/eslint#20030)) (Francesco Trotta)
- [`b48fa20`](eslint/eslint@b48fa20) chore: package.json update for [@&#8203;eslint/js](https://github.com/eslint/js) release (Jenkins)
- [`4bce8a2`](eslint/eslint@4bce8a2) chore: package.json update for eslint-config-eslint release (Jenkins)
- [`0c9999c`](eslint/eslint@0c9999c) refactor: prefer default options in `grouped-accessor-pairs` ([#&#8203;20028](eslint/eslint#20028)) (루밀LuMir)
- [`d503f19`](eslint/eslint@d503f19) ci: fix `stale.yml` ([#&#8203;20010](eslint/eslint#20010)) (루밀LuMir)
- [`e2dc67d`](eslint/eslint@e2dc67d) ci: centralize `stale.yml` ([#&#8203;19994](eslint/eslint#19994)) (루밀LuMir)
- [`7093cb8`](eslint/eslint@7093cb8) ci: bump actions/checkout from 4 to 5 ([#&#8203;20005](eslint/eslint#20005)) (dependabot\[bot])

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box

---

This PR has been generated by [Renovate Bot](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0MS42MS4wIiwidXBkYXRlZEluVmVyIjoiNDEuNjEuMCIsInRhcmdldEJyYW5jaCI6Im1haW4iLCJsYWJlbHMiOltdfQ==-->

Reviewed-on: https://git.robbevp.be/robbevp/website-robbevanpetegem/pulls/495
Co-authored-by: Renovate Bot <renovate@robbevp.be>
Co-committed-by: Renovate Bot <renovate@robbevp.be>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
accepted There is consensus among the team that this change meets the criteria for inclusion documentation Relates to ESLint's documentation
Projects
Status: Complete
Development

Successfully merging this pull request may close these issues.

3 participants