Skip to content

Lint: prefer for...of loops over plain for loops - #39661

Merged
Josh-Cena merged 1 commit into
mdn:mainfrom
Josh-Cena:for-of
May 27, 2025
Merged

Josh-Cena merged 1 commit into
mdn:mainfrom
Josh-Cena:for-of

Conversation

@Josh-Cena

Copy link
Copy Markdown
Member

It is prescribed by our style guide that for...of loops should be preferred over for loops in all cases. In the past we had done a great deal of work to refactor almost everything but it seems we left some behind.

@Josh-Cena
Josh-Cena requested review from a team, chrisdavidmills, scottaohara and sideshowbarker and removed request for a team May 24, 2025 15:16
@github-actions github-actions Bot added Content:CSS Cascading Style Sheets docs Content:HTML Hypertext Markup Language docs Content:WebAPI Web API docs Content:JS JavaScript docs Content:Learn Learning area docs (outside of one of the Learn:* subtags) Content:Accessibility Accessibility docs Content:Media Media docs Content:Games Games docs Content:PWA Progressive Web Apps content labels May 24, 2025
@Josh-Cena
Josh-Cena requested review from a team and bsmth and removed request for a team, chrisdavidmills, scottaohara and sideshowbarker May 24, 2025 15:16
@Josh-Cena
Josh-Cena requested review from a team, chrisdavidmills and scottaohara and removed request for a team, chrisdavidmills and scottaohara May 24, 2025 15:16
@github-actions github-actions Bot added the size/l [PR only] 501-1000 LoC changed label May 24, 2025
@github-actions

Copy link
Copy Markdown
Contributor
Preview URLs (62 pages)
Flaws (10)

Note! 58 documents with no flaws that don't need to be listed. 🎉

URL: /en-US/docs/Games/Tutorials/2D_breakout_game_Phaser/Win_the_game
Title: Win the game
Flaw count: 4

  • macros:
    • Macro produces link /en-US/docs/Games/Workflows/2D_Breakout_game_Phaser/The_score which is a redirect
    • Macro produces link /en-US/docs/Games/Workflows/2D_Breakout_game_Phaser/Extra_lives which is a redirect
    • Macro produces link /en-US/docs/Games/Workflows/2D_Breakout_game_Phaser/The_score which is a redirect
    • Macro produces link /en-US/docs/Games/Workflows/2D_Breakout_game_Phaser/Extra_lives which is a redirect

URL: /en-US/docs/Web/API/Document_Object_Model/Examples
Title: Examples of web and XML development using the DOM
Flaw count: 2

  • macros:
    • Macro produces link /en-US/docs/Web/API/Document_Object_Model/Events which is a redirect
    • Macro produces link /en-US/docs/Web/API/Document_Object_Model/Whitespace_in_the_DOM which is a redirect

URL: /en-US/docs/Web/API/Document_Object_Model/Introduction
Title: Introduction to the DOM
Flaw count: 2

  • macros:
    • Macro produces link /en-US/docs/Web/API/Document_Object_Model/Events which is a redirect
    • Macro produces link /en-US/docs/Web/API/Document_Object_Model/Whitespace_in_the_DOM which is a redirect

URL: /en-US/docs/Web/API/WebVR_API/Using_VR_controllers_with_WebVR
Title: Using VR controllers with WebVR
Flaw count: 2

  • macros:
    • Macro produces link /en-US/docs/Web/API/Window/vrdisplayblur_event which is a redirect
    • Macro produces link /en-US/docs/Web/API/Window/vrdisplayfocus_event which is a redirect

@bsmth bsmth left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Great, tnx 👍🏻

@Josh-Cena
Josh-Cena merged commit b5437b7 into mdn:main May 27, 2025
@Josh-Cena
Josh-Cena deleted the for-of branch May 27, 2025 11:12
zachernuk pushed a commit to zachernuk/content that referenced this pull request Jun 4, 2025
@github-actions github-actions Bot locked as resolved and limited conversation to collaborators Jun 1, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

Content:Accessibility Accessibility docs Content:CSS Cascading Style Sheets docs Content:Games Games docs Content:HTML Hypertext Markup Language docs Content:JS JavaScript docs Content:Learn Learning area docs (outside of one of the Learn:* subtags) Content:Media Media docs Content:PWA Progressive Web Apps content Content:WebAPI Web API docs size/l [PR only] 501-1000 LoC changed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants