> For the complete documentation index, see [llms.txt](https://nextjs-docs.adarshdubey.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://nextjs-docs.adarshdubey.com/get-started/linting-and-formatting.md).

# Linting & Formatting

## Overview

Linting and formatting work out of the box in this starter kit. You simply have to edit the configuration files according to your needs, and you're done!

### Tech used

* [ESLint](https://eslint.org/): For linting and enforcing rules.
* [Prettier](https://prettier.io/): For formatting the code.
* [Lint Staged](https://www.npmjs.com/package/lint-staged): To check linting and format staged files.
* [Husky](https://typicode.github.io/husky/): Pre-commit hooks to run linting and formatting before every commit.

## How to customize

### Linting

All the contents/rules of linting are in the `.prettierrc.json` file. You can edit that file to add, remove or update any styles.

You can find all the rules you can configure here: <https://eslint.org/docs/latest/rules/>

### Formatting

All the contents/rules of linting are in the `.eslintrc.json` file. You can edit that file to add, remove or update any styles.

You can find all the rules you can configure here: <https://prettier.io/docs/en/options>

{% hint style="info" %}
After changing any of the above file, you should make sure all the files in your project follow those rules.

* After making change in linting rules, run `bunx eslint --fix .`
* After making changes in formatting rules, run `bunx prettier --write .`
  {% endhint %}

## Other resources

* ESLint: <https://eslint.org/>
* Prettier: <https://prettier.io/>
