javascript icon indicating copy to clipboard operation
javascript copied to clipboard

Inconsistent semicolon usage in examples (Arrays vs Functions)

Open shuhaki opened this issue 1 year ago • 4 comments

Description

(Readme.md) I noticed an inconsistency in semicolon usage across different sections of the style guide.

  • In the Arrays section (4.1–4.8), many examples omit semicolons at the end of statements.
  • In the Functions section (7.1–7.7), the examples consistently use semicolons.

Since the Airbnb style guide explicitly recommends always using semicolons (see Section 21: Semicolons), this inconsistency might confuse developers who are following the guide.


Proposed Fix Ensure that all code examples across the style guide consistently include semicolons at the end of statements.

For example:

// Current (Arrays section):
const items = []

// Suggested fix:
const items = [];

I’d be happy to work on fixing this if maintainers agree. Could you please assign this issue to me?

shuhaki avatar Aug 21 '25 20:08 shuhaki

Issues aren't ever assigned in open source.

This is a good thing to fix, yes - please do submit a PR.

ljharb avatar Aug 21 '25 20:08 ljharb

I had a look as well. However, it seems consistent with Airbnb’s semicolon rule — the snippets without semicolons are just minimal examples, not a different style.

NothingADSR123 avatar Aug 27 '25 13:08 NothingADSR123

Using semicolons or omitting them wont make any difference because they are just coding standards that are followed according to coding norms of organization

Chetan40101 avatar Oct 25 '25 12:10 Chetan40101

hlo can i work on it

Mahi1215 avatar Jun 26 '26 10:06 Mahi1215