Skip to content

Latest commit

 

History

History
33 lines (26 loc) · 864 Bytes

formatting-and-linting.md

File metadata and controls

33 lines (26 loc) · 864 Bytes

Formatting and linting

Motivation

Prettier and ESLint are introduced in this PR. You can find the motivation for the setup in the PR description and review comments.

Commands

  • npm run lint - reports all current formatting and linting violations.

VS Code setup

Use the following VS Code workspace settings to set up ESLint and Prettier on save:

{
  "editor.defaultFormatter": "esbenp.prettier-vscode",
  "editor.formatOnSave": true,
  "editor.codeActionsOnSave": {
    "source.fixAll": true
  },
  "[javascript]": {
    "editor.defaultFormatter": "esbenp.prettier-vscode"
  },
  "[json]": {
    "editor.defaultFormatter": "esbenp.prettier-vscode"
  },
  "[typescript]": {
    "editor.defaultFormatter": "esbenp.prettier-vscode"
  },
  "eslint.lintTask.enable": true
}