Set Up Prettier and ESLint — and Look Like a Pro!

Mon, April 14, 2025 - 2 min read
Setting up Prettier and ESLint in your project

🔧 Set Up Prettier and ESLint — and Look Like a Pro!

You know what great teams have in common?
No, not swag.
Consistent code style.


🎨 Unified style — less arguing, more coding

  • Tabs or spaces? Doesn’t matter.
  • Single or double quotes? Doesn’t matter either.
  • What matters is — everyone writes the same way.

The ideal style isn’t your personal favorite.
It’s the one that’s enforced and followed — no drama in PRs.


✨ Prettier — automated code beauty

Prettier is like autopilot for formatting code.

  • It handles spacing, indentation, quotes.
  • Removes extra line breaks.
  • Saves reviewer sanity.
npx prettier --write .

📖 Docs: prettier.io


🕵️ ESLint — catches issues before they explode

ESLint is like a strict mentor for your code:

  • warns about unused variables,
  • scolds you for using == instead of ===,
  • yells when you forget await,
  • can be as chill or strict as your team wants.

📖 Docs: eslint.org


🚀 Why Prettier + ESLint rock together

  • 🧼 Code is formatted automatically (fewer fights!)
  • 🛑 Errors are caught before prod (fewer bugs!)
  • 🤝 Everyone writes the same way (more respect!)
  • ⚙️ Supports ES6+, TypeScript, JSX out of the box
  • 🧠 Reviewers focus on logic, not commas

📦 How to get started

npm install --save-dev prettier eslint
npx eslint --init

Then in your package.json:

"scripts": {
  "lint": "eslint .",
  "format": "prettier --write ."
}

And don’t forget .prettierrc and .eslintrc — where the magic lives.


🧠 Pro tip

Stop arguing about code style in PRs.
Let the bots decide.
You focus on architecture and business logic.


📝 Conclusion

Setting up Prettier and ESLint is like adding a toxicity filter to your repo.

  • Code gets cleaner,
  • Team stays sane,
  • Dev speed increases.

📌 Do it once — and never argue about spacing again.

📚 Useful links:

🚀 Set up your linters. Be the pro your repo deserves.