P
💻DeveloppementBeginnerGemini

Configure ESLint and Prettier for a Project

Configure ESLint and Prettier from scratch with pre-commit hooks, IDE integration, and CI for standardizing your team's code.

Paste in your AI

Paste this prompt in ChatGPT, Claude or Gemini and customize the variables in brackets.

Tu es un expert en outillage JavaScript et en qualité de code. Je dois configurer ESLint et Prettier pour standardiser le code de mon projet.

**Type de projet :**
[EX: React avec TypeScript, Node.js API pure JavaScript, projet Next.js, librairie npm]

**Configuration souhaitée :**
- Guide de style de base : [EX: Airbnb, Standard, Google, ou configuration custom]
- TypeScript : [Oui/Non]
- Règles spécifiques importantes pour mon équipe : [EX: pas de console.log en production, imports triés, longueur de ligne max 100]
- Framework spécifique : [EX: règles React hooks, règles Jest pour les tests]

**Environnement :**
- IDE : [EX: VS Code, WebStorm, Vim]
- Node.js version : [EX: 20.x]

Crée une configuration complète et prête à l'emploi :

1. **Installation** : commandes npm/yarn pour toutes les dépendances nécessaires avec les versions exactes.
2. **.eslintrc.json ou eslint.config.js** : configuration ESLint complète avec plugins, règles et ignores.
3. **.prettierrc** : configuration Prettier cohérente avec ESLint (sans conflits).
4. **.eslintignore et .prettierignore** : fichiers d'exclusion adaptés au projet.
5. **Scripts npm** : scripts lint, lint:fix, format dans package.json.
6. **Configuration VS Code** (.vscode/settings.json) : format on save, ESLint intégré.
7. **Husky + lint-staged** : hook pre-commit qui lint et formate uniquement les fichiers modifiés.
8. **CI** : step GitHub Actions pour vérifier le linting.

Explique les règles les plus importantes et pourquoi elles améliorent la qualité du code.

Why this prompt works

<p>This prompt covers the entire code quality ecosystem around ESLint and Prettier, from initial configuration to CI integration through pre-commit hooks. This holistic approach ensures code standards are enforced at every step of the development workflow.</p><p>Managing conflicts between ESLint and Prettier is a classic problem this prompt explicitly addresses: without coordinated configuration (eslint-config-prettier to disable ESLint formatting rules), the two tools contradict each other and generate endless frustrations.</p><p>Using lint-staged rather than linting the entire project on every commit is an important performance optimization for large codebases: linting only modified files reduces pre-commit hook time from several minutes to a few seconds.</p>

Use Cases

Initial setup of a new projectStandardizing code across a teamImproving existing code quality

Expected Output

Complete ESLint and Prettier configuration files, npm scripts, VS Code configuration, Husky setup, and GitHub Actions step.

Learn more

Check the full skill on Prompt Guide to master this technique from A to Z.

View on Prompt Guide

📬 Get new prompts every week

Join our newsletter and never miss a prompt.

Similar Prompts

💻DeveloppementIntermediateAll AIs

Optimize Your SQL Queries and Boost Performance

A complete prompt to analyze, diagnose, and optimize your SQL queries with indexing and rewriting recommendations adapted to your database engine.

080
💻DeveloppementAdvancedChatGPT

Legacy Code Refactoring

Safely and incrementally refactor legacy code following SOLID principles and modern best practices.

29109
💻DeveloppementIntermediateClaude

Implement Robust Error Handling in Node.js

Create a professional Node.js error handling architecture with custom error classes, centralized middleware, and monitoring.

3377
💻DeveloppementBeginnerAll AIs

Learn Git Basics for Beginners

Learn Git from scratch with illustrated explanations, concrete examples, a practical workflow, and an essential commands cheatsheet.

1298