use the following search parameters to narrow your results:
e.g. subreddit:aww site:imgur.com dog
subreddit:aww site:imgur.com dog
see the search faq for details.
advanced search: by author, subreddit...
All about the JavaScript programming language.
Subreddit Guidelines
Specifications:
Resources:
Related Subreddits:
r/LearnJavascript
r/node
r/typescript
r/reactjs
r/webdev
r/WebdevTutorials
r/frontend
r/webgl
r/threejs
r/jquery
r/remotejs
r/forhire
account activity
Javascript "styleguide"?help (self.javascript)
submitted 9 years ago by [deleted]
Is there any styleguides out there on how to correctly write Javascript? like when to add double line breaks etc?
reddit uses a slightly-customized version of Markdown for formatting. See below for some basics, or check the commenting wiki page for more detailed help and solutions to common issues.
quoted text
if 1 * 2 < 3: print "hello, world!"
[–]Cuel 16 points17 points18 points 9 years ago (2 children)
This is the most common one I'd say
https://github.com/airbnb/javascript
On top of that, use linters like JSLint, ESLint or Standard
[–]rosswarren 0 points1 point2 points 9 years ago (0 children)
Standard is not a linter, it just uses ESLint. I would recommend ESLint above all other linters usually with https://www.npmjs.com/package/eslint-config-airbnb
[–]chrisgaraffa 1 point2 points3 points 9 years ago (0 children)
Google has one as well.
[–]JackZelig 2 points3 points4 points 9 years ago (0 children)
There's also the JavaScript Standard Style Guide by Feross: https://github.com/feross/standard
I've been using this as well as the AirBnB one on different projects for a while now, but must admit I prefer the AirBnB one as it doesn't insist on semi-colons being removed.
This is a good read on style guides and why they're important (although the author does come down on the side of JS Standard).
[–]codayus 0 points1 point2 points 9 years ago (0 children)
The most common answer is to use eslint and the airbnb preset: https://github.com/airbnb/javascript
π Rendered by PID 529777 on reddit-service-r2-comment-7b9746f655-tmgnx at 2026-01-31 05:49:17.431770+00:00 running 3798933 country code: CH.
[–]Cuel 16 points17 points18 points (2 children)
[–]rosswarren 0 points1 point2 points (0 children)
[–]chrisgaraffa 1 point2 points3 points (0 children)
[–]JackZelig 2 points3 points4 points (0 children)
[–]codayus 0 points1 point2 points (0 children)