11ty / 11ty/docs

JavaScript style guide for documentation PRs

Open
#397 15 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Nunjucks
Stars
547
Forks
726
Avg merge
2h 23m
Merged PRs (30d)
3

Description

@zachleat,

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 and let?
  • 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.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the issue body and its 15-comment thread; no file or test is named. Determine whether the documentation PR style guide has a settled scope, then identify the documentation entry point and agree on the categories and examples that constitute completion.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript
Domain
documentation
Issue type
Documentation
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Needs clarification
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.