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

Disable prettiers no-else-return rule #2166

Merged
merged 1 commit into from
Apr 8, 2022
Merged

Disable prettiers no-else-return rule #2166

merged 1 commit into from
Apr 8, 2022

Conversation

yubiuser
Copy link
Member

@yubiuser yubiuser commented Apr 7, 2022

  • I have read and understood the contributors guide, as well as this entire template.
  • I have made only one major change in my proposed changes.
  • I have commented my proposed changes within the code.
  • I have tested my proposed changes.
  • I am willing to help maintain this change if there are issues with it later.
  • I give this submission freely and claim no ownership.
  • It is compatible with the EUPL 1.2 license
  • I have squashed any insignificant commits. (git rebase)
  • I have Signed Off all commits. (git commit --signoff)

What does this PR aim to accomplish?:
Prettier has a no-else-after-return rule which errors if an else statement follows an if clause with a return.
https://eslint.org/docs/rules/no-else-return

Although it is technically correct to omit the else, I think it greatly enhances the readability of the code. Additionally, the code will not fail, if the return within the if will be removed by a code change in the future.
Disabling the rule has no negative consequences: the else is not mandatory.

How does this PR accomplish the above?:
Disables the rule by setting "no-else-return": "off" in package.json

Signed-off-by: Christian König <ckoenig@posteo.de>
@yubiuser yubiuser mentioned this pull request Apr 7, 2022
9 tasks
@yubiuser yubiuser requested a review from a team April 8, 2022 04:45
@yubiuser yubiuser merged commit 338c90d into devel Apr 8, 2022
@yubiuser yubiuser deleted the no-else-return branch April 8, 2022 16:48
@pralor-bot
Copy link

This pull request has been mentioned on Pi-hole Userspace. There might be relevant details there:

https://discourse.pi-hole.net/t/pi-hole-ftl-v5-15-web-v5-12-and-core-v5-10-released/54987/1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants