Hacktoberfest 2026: die Issues, die Maintainer für den Oktober markiert haben – offen und einsteigerfreundlich. Hacktoberfest-Issues durchsuchen

Clarification for Inline Comments

Offen
#1,506 7 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen

@prateekbisht23 arbeitet bereits daran.

Seit 15.9.2025.

  • #3174 von @prateekbisht23 — ohne Merge geschlossen

Bewertung

Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Anfängerfreundlichkeit
30/100
Issue-Typ
Dokumentation
Klarheit
Größtenteils klar
Aktivitätsstatus
Veraltet
Tech-Stack
javascript
Bereich
documentation

Rechercherichtung

Beginne damit, den vorhandenen Abschnitt "Comments" des Styleguides und den Thread mit den sieben Kommentaren zu lesen. Ermittle, ob der Thread Richtlinien für Inline-Kommentare und lange Zeilen festlegt; abgeschlossen bedeutet, eine von einem Maintainer genehmigte Regel mit Beispielen zu dokumentieren oder festzustellen, dass noch eine Entscheidung erforderlich ist.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Beschreibung

editorial pull request wanted

Thanks for the excellent style guide!

One thing that is not explicitly defined by the guide is inline comments. Can a section on this topic be added to the "Comments" section block, please?

For example,

let foo = 145; // This is modified below in the "baz()" function

Is this a legal line in the airbnb style?

And the follow-up question: if it is not legal, then I assume that the correct fix to have it be moved above, like this?

// This is modified below in the "baz()" function
let foo = 145;

Yet another follow-up question: if inline comments are legal, then what is the correct fix for in-line comments that make the line extend past 100 character? Like the following:

// This is a comment describing the following block of variable initializations
let foo = 123; // used in various contexts, but mostly for soccer games, basketball, and football games
let bar = 456; // used only for horse races; it is explicitly reset at the beginning of the "endRace()" function
let baz = 789; // used only for car races; it will be overwritten once we reach the "oilChange()" function

If it were moved above, it would overlap with the block comment header. So then does it make the most sense to move them down to the next line, like this?

// This is a comment describing the following block of variable initializations
let foo = 123;
// used in various contexts, but mostly for soccer games, basketball, and football games
let bar = 456;
// used only for horse races; it is explicitly reset at the beginning of the "endRace()" function
let baz = 789;
// used only for car races; it will be overwritten once we reach the "oilChange()" function
Vorherrschende Sprache
JavaScript
Sterne
148k
Forks
26.5k
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Entwicklungsumgebung

Dieses Projekt bietet weder Dev-Container noch Dockerfile noch Beitragsleitfaden – die Einrichtung liegt bei Ihnen. Beginnen Sie mit der README; die allgemeinen Schritte stehen in unserem Leitfaden für den ersten Beitrag.

Erste Schritte

  1. Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
  2. Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
  3. Forken Sie das Repository und arbeiten Sie in einem Branch.
  4. Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.

Mehr aus airbnb/javascript

Alle Issues in airbnb/javascript

Ähnliche Issues

Weitere Issues zu JavaScript

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.