project-guidelines README

The project's README from github.com/elsewhencode/project-guidelines. As one markdown file: README.md.

中文版 | 日本語版 | 한국어 | Русский | Português | Italiana | Persian/فارسی

Project Guidelines · PRs Welcome

While developing a new project is like rolling on a green field for you, maintaining it is a potential dark twisted nightmare for someone else. Here's a list of guidelines we've found, written and gathered that (we think) works really well with most JavaScript projects here at elsewhen. If you want to share a best practice, or think one of these guidelines should be removed, feel free to share it with us.


1. Git

Git

1.1 Some Git rules

There are a set of rules to keep in mind:

1.2 Git workflow

Because of most of the reasons above, we use Feature-branch-workflow with Interactive Rebasing and some elements of Gitflow (naming and having a develop branch). The main steps are as follows:

1.3 Writing good commit messages

Having a good guideline for creating commits and sticking to it makes working with Git and collaborating with others a lot easier. Here are some rules of thumb (source):

2. Documentation

Documentation

3. Environments

Environments

3.1 Consistent dev environments:

3.2 Consistent dependencies:

4. Dependencies

Github

5. Testing

Testing

6. Structure and Naming

Structure and Naming

7. Code style

Code style

7.1 Some code style guidelines

7.2 Enforcing code style standards

8. Logging

Logging

9. API

API

9.1 API design

Why:

Because we try to enforce development of sanely constructed RESTful interfaces, which team members and clients can consume simply and consistently.

Why:

Lack of consistency and simplicity can massively increase integration and maintenance costs. Which is why API design is included in this document.

9.2 API security

These are some basic security best practices:

9.3 API documentation

For each endpoint explain:

10. Accessibility (a11y)

Accessibility

10.1 Laying accessibility practices in place

Take the following steps at the start of your project to ensure an intentional level of accessibility is sustained:

Why:

Web content is accessible by default. We compromise this when we build complex features. It's much easier to reduce this impact by considering accessibility from the start rather than re-implement these features later.

10.2 Some basic accessibility rules to add to your project:

More accessibility rules can be found here.

11. Licensing

Licensing

Make sure you use resources that you have the rights to use. If you use libraries, remember to look for MIT, Apache or BSD but if you modify them, then take a look at the license details. Copyrighted images and videos may cause legal problems.


Sources: RisingStack Engineering, Mozilla Developer Network, Heroku Dev Center, Airbnb/javascript, Atlassian Git tutorials, Apigee, Wishtack

Icons by icons8

project-guidelines (elsewhencode/project-guidelines)

Searching Database…

What is this?A public set of best practices for JavaScript projects, written and gathered by the elsewhen team - numbered rules for Git, documentation, environments, dependencies, testing, code style, APIs and more.
Is it a package I install, or just a document I read?Just a document - a structured README of numbered guidelines, each with a Why: explanation. There is nothing to install; you copy the linked .gitignore and README template and adopt the rest in code review.
How do I put these guidelines into practice?Read it top to bottom and adopt what fits: copy the suggested .gitignore and README.md template it links to, pin your node version with .nvmrc, use a lockfile, and enforce the rest in pull requests.
Does it assume I am on Node, or is it stack-agnostic?The environment and dependency advice is Node/npm-centric - nvm and .nvmrc, engines in package.json, package-lock.json or Yarn - while the Git, commit-message and documentation rules work for any stack.
Is this a strict standard, or opinionated advice?Opinionated advice rather than enforced tooling: every rule comes with a Why: note, and the authors invite debate about adding or removing guidelines. Enforcing them is on you, e.g. through code review.
Is this written for teams or for solo developers?Mostly teams: feature-branch workflow with pull-request review, protected develop and master branches, and identical dependency versions across machines. Solo developers can still cherry-pick the commit and style rules.
Can I reuse or adapt the guide itself?Yes - MIT per the repo metadata, so forking and adapting it for your own team is fine. The guide also ends with a Licensing section on choosing a license for your project.
How specific do the Git rules get?Very: never push straight to develop or master, rebase interactively before a pull request, delete feature branches after merging, and for commits - subject line up to 50 characters, body wrapped at 72, imperative mood, with the body explaining what and why.
What is the testing advice?Keep test files next to the code they test, named like moduleName.spec.js or moduleName.test.js, and keep a separate test environment when production analytics or API rate limits would get in the way.
Does it name concrete tools?Yes: depcheck for unused packages, npm-stat and npm view to vet a package's popularity and maintenance, npm outdated and npm-check-updates to stay current, Snyk for vulnerability checks, joi to validate environment variables at startup, and Docker for a consistent environment.
Is the guide available in other languages?Yes - community translations in Chinese, Japanese, Korean, Russian, Portuguese, Italian and Persian are linked at the top of the README. First published in 2017, the repo is still public and not archived.
Size
0.5 MB
Stars
29.4K
Updated
CommitDec 09
Age
9y
Commits · 90 Days