---
title: "ESLint"
description: "ESLint automatically checks your JavaScript and TypeScript code for errors and enforces coding standards."
date: "2025-10-02"
lastUpdated: "2026-03-24"
tags: ["eslint","typescript","javascript","linting"]
canonical: "/learn/guides/project/eslint"
---

import { Code } from '@astrojs/starlight/components'
import Source from './.eslintrc.json?raw'
import PackageManagers from '~/components/PackageManagers.astro'

## Installation

See the [official documentation](https://eslint.org/docs/latest/use/getting-started).

<PackageManagers pkg="eslint" dev />

Optionally: Install the related configs and plugins

<PackageManagers
  pkg="eslint-config-airbnb @typescript-eslint/eslint-plugin eslint-plugin-prettier eslint-config-prettier eslint-plugin-import eslint-plugin-import eslint-plugin-react eslint-plugin-import eslint-plugin-react eslint-plugin-jsx-a11y"
  dev
/>

## Settings

These are basic settings ([`.eslintrc.json`](https://eslint.org/docs/latest/use/configure/)).

> :warning: **Work in progress!**

<Code code={Source} lang="json" title=".eslintrc.json" wrap />

Create an ignore file (`.eslintignore`):

```txt
build
dist
coverage
analysis
```

## Usage

And here is a script to run eslint on a javascript project:

```sh
# File: `./package.json`

"lint": "pnpm eslint --cache ./src"
```
