Use Prettier-ESLint Airbnb for the code style


Sep 25, 2020

ACCEPTED

Thomas Vaillant

Context and Problem Statement

We have to choose our lint and format tools, and the code style to enforce as well.

Considered Options

  • Prettier only
  • ESLint only
  • ESLint with Airbnb code style
  • ESLint with StandardJS code style
  • ESLint with Google code style
  • Prettier-ESLint with Airbnb code style
  • Prettier-ESLint with StandardJS code style
  • Prettier-ESLint with Google code style

Decision Outcome

Chosen option: "Prettier-ESLint with Airbnb code style", because

  • Airbnb code style is widely used (see npm trends)
  • Prettier-ESLint enforce some additional code style. We like it because the more opinionated the code style is, the less debates there will be :-)

In addition, we use also Prettier to format json and markdown files.

Positive Consequences

  • Developers are encouraged to use the Prettier ESLint and Prettier VSCode extensions while developing to auto-format the files on save
  • And they are encouraged to use the ESLint VS Code extension as well to highlight linting issues while developing