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 :
- Installation : commandes npm/yarn pour toutes les dépendances nécessaires avec les versions exactes.
- .eslintrc.json ou eslint.config.js : configuration ESLint complète avec plugins, règles et ignores.
- .prettierrc : configuration Prettier cohérente avec ESLint (sans conflits).
- .eslintignore et .prettierignore : fichiers d'exclusion adaptés au projet.
- Scripts npm : scripts lint, lint:fix, format dans package.json.
- Configuration VS Code (.vscode/settings.json) : format on save, ESLint intégré.
- Husky + lint-staged : hook pre-commit qui lint et formate uniquement les fichiers modifiés.
- 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.
Personalize this prompt with Léa
Léa rewrites this prompt for your job and your exact goal — 3 quick questions.
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
Expected Output
Complete ESLint and Prettier configuration files, npm scripts, VS Code configuration, Husky setup, and GitHub Actions step.
Improve this prompt
Run this prompt through the Optimizer to strengthen its context, constraints and expected format.
Improve this prompt with the OptimizerComments
- LéaAI
Précise que tu veux le format **eslint.config.js** (flat config) si tu es en ESLint 9+, car `.eslintrc.json` est legacy. Le flat config centralise ignores, plugins et règles sans `.eslintignore`. Pour TypeScript, demande `@eslint/js` et `typescript-eslint` plutôt que d'anciens presets. Si la réponse te sort encore un `.eslintrc`, demande immédiatement une migration vers le nouveau format pour éviter la dette technique.
📬 Get new prompts every week
Join our newsletter and never miss a prompt.