Skip to content

Configuration files for Eslint, Prettier and Stylelint for LANDR projects

Notifications You must be signed in to change notification settings

LandrAudio/linting-and-formatting

Repository files navigation

Linting & Formatting

All Contributors

Monorepo to hold all shareable linting and formatting configurations.

eslint-config-landr - ESLint configuration for linting JavaScript and TypeScript code

prettier-config-landr - Prettier configuration for formatting all code

stylelint-config-landr - Stylelint configuration for linting CSS and Sass code

Editor Setup

When using both ESLint and Prettier in a project, it's nice to have files automatically have ESLint errors fixed on save as well as have non JavaScript/TypeScript files formatted on save. This section explains how to set that up in an editor.

VS Code

The easiest and recommended way of integrating with linters is to let Prettier do the formatting and configure the linter to not deal with formatting rules. You can find instructions on how to configure each linter on the Prettier docs site. You can then use each of the linting extensions as you normally would.

You can enable Auto-Fix on Save for ESLint or Stylelint and still have formatting and quick fixes:

"editor.codeActionsOnSave": {
    // For ESLint
    "source.fixAll.eslint": true,
    // For Stylelint
    "source.fixAll.stylelint": true
}

Releasing

We use Auto and Lerna to automatically bump our packages versions based on the Conventional Commits convention.

  • A commit starting with fix: will do a PATCH release
  • A commit starting with feat: will do a MINOR release
  • A commit starting with BREAKING CHANGE: will do a MAJOR release

Semantic version increment rules

Patch releases (1.0.X):

  • Bump dependencies to patch or minor releases
  • Fixes not impacting the configs or adding new rules

Minor releases (1.X):

  • Adding exceptions to rules (ex: disable a default rule)
  • Changing linting rules (ex: { printWidth: 80 } -> { printWidth: 120 })

Major releases(X):

  • Breaking changes in repo
  • Bump dependencies to major releases

Contributors ✨

Thanks goes to these wonderful people (emoji key):


Benoit Deziel

🚧 📖 🚇 💻

hjack-landr

🚧 🚇 💻

David Martinez

🚧 💻

rpdeshaies

📖 🚇 💻

Maxime Péloquin

💻

Corentin Ardeois

📖 💻

vbeausoleil

🚇 💻

Ronan

🚇

This project follows the all-contributors specification. Contributions of any kind welcome!