Clarification for Inline Comments
@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
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
- Lesen Sie das ganze Issue und danach den Beitragsleitfaden des Projekts.
- Schreiben Sie ins Issue, dass Sie es übernehmen — das erspart doppelte Arbeit.
- Forken Sie das Repository und arbeiten Sie in einem Branch.
- Öffnen Sie einen Pull Request, der die Issue-Nummer nennt.
Mehr aus airbnb/javascript
-
Severity: Unhandled promise rejection in `whitespace-async.js` when ESLint async path is usedEvtl. vergeben @bodapatisaikrishna hat das vor 39 Tagen übernommen. Offen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 78/100
airbnb/javascript#3237 · 6 Kommentare ·
-
Inconsistent semicolon usage in examples (Arrays vs Functions)Evtl. vergeben @Developer-shivamMishra hat das vor 29 Tagen übernommen. Offen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 68/100
airbnb/javascript#3152 · 4 Kommentare ·
-
No error handling around execSync + JSON.parse in whitespace.js (ESLint 9 path)Evtl. vergeben @dataCenter430 hat das vor 234 Tagen übernommen. Offen
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 48/100
airbnb/javascript#3238 · 8 Kommentare ·
-
Upgrading eslint-plugin-react-hooksEvtl. vergeben @weihongyu12 hat das vor 380 Tagen übernommen. Offen
Schwierigkeit 3/5 1-2 Tage Anfängerfreundlichkeit 38/100
airbnb/javascript#3186 · 3 Kommentare · 2 Reaktionen ·
-
Schwierigkeit 3/5 1-2 Tage Anfängerfreundlichkeit 45/100
airbnb/javascript#3173 · 9 Kommentare · 1 Reaktion ·
Alle Issues in airbnb/javascript
Ähnliche Issues
-
Schwierigkeit 1/5 Unter einer Stunde Anfängerfreundlichkeit 85/100
521xueweihan/HelloGitHub#4115 ·
-
bug
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 68/100
outline/outline#14348 · 1 Kommentar ·
Maintainer antworten meist innerhalb von 1 Tag
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 74/100
Maintainer antworten meist innerhalb von 1 Tag
-
area:install bug needs-triage
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 68/100
Maintainer antworten meist innerhalb von 3 Tagen
-
Schwierigkeit 2/5 1-3 Stunden Anfängerfreundlichkeit 75/100
Maintainer antworten meist innerhalb von 1 Tag