JavaScript style guide for documentation PRs
See original GitHub issueIssue Description
Can we drum up a quick style guide for vanilla JS code examples? I’m willing to forego my (otherwise highly opinionated) personal style for a standard.
I can mimic what’s already there, but it’d be good to establish something formally—for consistency within the docs (if not also the codebase). Here are the major categories I’m thinking we could use some clear ground rules:
- Ternary operators v. conditional statements?
- Semicolon?
- Closures?
- Explicit
return
statements? var
v.const
andlet
?- Arrow functions v. declarations v. expressions?
- When and when not to cache variables
- Classes v.
exports.render
- Comments and/or JSDoc blocks?
import
v.require()
this
- Others?
I’m convinced more folks would reach for the vanilla 🍦 if they had more examples in the docs—and I wanna help.
Issue Analytics
- State:
- Created 3 years ago
- Comments:15 (15 by maintainers)
Top Results From Across the Web
Google JavaScript Style Guide
1 Introduction. This document serves as the complete definition of Google's coding standards for source code in the JavaScript programming language.
Read more >How to implement Google JavaScript style guide with Codacy
The Google JavaScript style guide is one of the most popular code style guides. We'll show you how to implement it in Codacy....
Read more >How to Pull Request.. Some guidelines I have collected over…
It is an art form to keep Pull Requests (PRs) small. ... all the comments I receive into this document so that our...
Read more >Docs and Website | Data Version Control - DVC
Doc style guidelines (JavaScript and Markdown) ... Some of the following rules are applied automatically by a pre-commit Git hook that is installed...
Read more >Code Review Guidelines | Nuxeo Documentation
Important coding standards are described in the Java Code Style and JavaScript Code Style pages. It is important to understand that changes ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Looking into that right now (but @matt-auckland was faster with https://github.com/11ty/11ty-website/commit/3a0ce3b1535d7d220091df86bb20a9faff40c916 ):
If you agree, I’d fill a PR with those rules added.
Shoot, totally forgot about this! Yes, I’m still interested. Thanks for the reminder!