Skip to content

ADR 0001 Code Style Guide Decision: standardJS

Christian edited this page Sep 12, 2020 · 1 revision

ADR-0001 - Code Style Guide Decision

  • Status: accepted
  • Deciders: Chris, Kiran
  • Date: 2020-09-12

Context and Problem Statement

So far we had no Style Guide to follow, as passport became an important project and should be open to contributors, defining a style guide to be followed by contributors became crucial for a more effective collaboration.

Discussed briefly in issue #109

Decision Drivers

  • Different coding style going through files, according to whom developed.

Considered Options

Decision Outcome

Chosen option: standardJS, because it have a better ecosystem, licensed under Creative Commons. This text extracted from standardJS readme says a lot:

This module saves you (and others!) time in three ways:

No configuration. The easiest way to enforce consistent style in your project. Just drop it in. Automatically format code. Just run standard --fix and say goodbye to messy or inconsistent code. Catch style issues & programmer errors early. Save precious code review time by eliminating back-and-forth between reviewer & contributor. Adopting standard style means ranking the importance of code clarity and community conventions higher than personal style. This might not make sense for 100% of projects and development cultures, however open source can be a hostile place for newbies. Setting up clear, automated contributor expectations makes a project healthier.

For more info, see the conference talk "Write Perfect Code with Standard and ESLint". In this talk, you'll learn about linting, when to use standard versus eslint, and how prettier compares to standard.