# Installation & Project Setup — ESLint + Prettier

Source: https://www.geekswithgeeks.com/en/eslint-prettier/eslint-prettier-02

> Set up ESLint and Prettier in your project.

## Getting started

Start by installing both tools via npm. ESLint provides the foundation for linting, while Prettier handles formatting separately.

## Try installation

Install both tools and initialize ESLint configuration.

```bash
npm install --save-dev eslint prettier
npm init @eslint/config@latest
```

Output:

```
✔ How would you like to use ESLint?
✔ What type of modules does your project use?
✔ Which framework does your project use?
✔ Does your project use TypeScript?
✔ Where does your code run?
✔ What format do you prefer for your config file?
Successfully created .eslintrc.json
```

## Common setup issue

Don't skip the configuration step. Run `npm init @eslint/config` to answer setup questions and generate .eslintrc.json automatically.

Quick check

**Quiz:** What does `npm init @eslint/config` do?

- [x] Installs ESLint and creates .eslintrc.json with your preferences.
- [ ] Only installs ESLint.
- [ ] Deletes existing configurations.

*Answer:* Installs ESLint and creates .eslintrc.json with your preferences.. The config command creates a tailored .eslintrc.json based on your project type and preferences.
