ESLint & Prettier


Introduction

To format code automatically, we've included a basic ESLint & Prettier configuration. ESLint statically analyzes your code to quickly find problems. Prettier is used to automatically format the code you write to ensure a consistent code style withing your projects.
Included ESLint configuration:
{
  "extends": ["next/core-web-vitals", "prettier"],
  "plugins": ["prettier"],
  "rules": {
    "prettier/prettier": "error",
  }
}

Usage

Format all source files in the /src folder:
npm run lint

VSCode integration

To use ESLint & Prettier in combination with VSCode, we suggest installing the VSCode ESLint extension. After installing the extension, the code will automatically be formatted. The following configuration is included, which can be enabled/disabled or adjusted to your needs.
{
  "editor.codeActionsOnSave": {
    "source.fixAll.eslint": true
  }
}