Lesson 2 / 27
Installation & Project Setup
Install ESLint and Prettier with npm and generate a starter configuration with the ESLint init wizard.
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.
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@latest to answer setup questions and generate eslint.config.js automatically.
Quick check
Quick check: What does `npm init @eslint/config` do?
- Asks setup questions and creates a config file
- Only installs Prettier
- Deletes node_modules
- Runs your tests
Answer
Asks setup questions and creates a config file — It scaffolds an ESLint configuration.