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

[PAGE ISSUE]: 'avoid_empty_else' #5341

Closed
1 task done
frpbotero opened this issue Nov 13, 2023 · 4 comments
Closed
1 task done

[PAGE ISSUE]: 'avoid_empty_else' #5341

frpbotero opened this issue Nov 13, 2023 · 4 comments
Assignees
Labels
d.enhancement Improves docs with specific ask e0-minutes Can complete in < 60 minutes of normal, not dedicated, work from.page-issue Reported in a reader-filed concern p3-low Valid but not urgent concern. Resolve when possible. Encourage upvote to surface. t.diagnostics Relates to diagnostics, analysis, or linting of code

Comments

@frpbotero
Copy link

Page URL

https://dart.dev/tools/linter-rules/avoid_empty_else.html

Page source

https://github.com/dart-lang/site-www/tree/main/src/tools/linter-rules/avoid_empty_else.md

Describe the problem

I realized that the example of good practice was missing.

Expected fix

BAD
if (x > y) print("1"); else ; print("2");

Good
if (x > y) print("1"); else print("2");

Additional context

No response

I would like to fix this problem.

  • I will try and fix this problem on dart.dev.
@frpbotero frpbotero added the from.page-issue Reported in a reader-filed concern label Nov 13, 2023
@parlough
Copy link
Member

Thanks for opening an issue!

Note that if you want to work on this yourself, the source is actually in the SDK repository: https://github.com/dart-lang/sdk/blob/main/pkg/linter/lib/src/rules/avoid_empty_else.dart

@parlough parlough added d.enhancement Improves docs with specific ask p3-low Valid but not urgent concern. Resolve when possible. Encourage upvote to surface. e0-minutes Can complete in < 60 minutes of normal, not dedicated, work t.diagnostics Relates to diagnostics, analysis, or linting of code labels Nov 13, 2023
copybara-service bot pushed a commit to dart-lang/sdk that referenced this issue Dec 19, 2023
Fixes dart-lang/site-www#5341

Also migrates its tests to reflective tests.

Change-Id: I3171aedc304347bd24aa757b3f9d77351bb75cb4
Reviewed-on: https://dart-review.googlesource.com/c/sdk/+/342280
Auto-Submit: Parker Lougheed <[email protected]>
Reviewed-by: Samuel Rawlins <[email protected]>
Reviewed-by: Marya Belanger <[email protected]>
Commit-Queue: Marya Belanger <[email protected]>
@parlough
Copy link
Member

Fixed and expanded by dart-lang/sdk@aabc9ba

Thanks again for reporting this!! I really appreciate it :)

@parlough parlough self-assigned this Dec 19, 2023
@frpbotero
Copy link
Author

Parker, do you allow me to post a screenshot on my LinkedIn? I've been working with flutter for just over 5 months and when I read your answer I was very happy. I know this was a small thing, but for me it is incredible.

@parlough
Copy link
Member

Hey @FeBotero, sure! I'm happy I was able to help and I hope your journey with Dart and Flutter is going well and continues for a long time 🥳

I still really appreciate you catching and reporting this. It's extremely helpful to both me and every other developer who views the page. You suggesting this also helped us notice and fix other nearby issues. Perhaps these docs would have never been improved if you didn't spend time reporting this, so thanks again!

Let us know if you find any other issues or areas of improvement, or have any questions about Dart :D

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
d.enhancement Improves docs with specific ask e0-minutes Can complete in < 60 minutes of normal, not dedicated, work from.page-issue Reported in a reader-filed concern p3-low Valid but not urgent concern. Resolve when possible. Encourage upvote to surface. t.diagnostics Relates to diagnostics, analysis, or linting of code
Projects
None yet
Development

No branches or pull requests

2 participants