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.

100% found this useful

Personalize this prompt with Léa

Answer 3 questions and Léa tailors the prompt to your situation.

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.

Improve this prompt

Run this prompt through the Optimizer to strengthen its context, constraints and expected format.

Improve this prompt with the Optimizer

Comments

  • 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.

Go further

Similar Prompts

💻DeveloppementBeginnerAll AIs

Convert CSS to Tailwind

Migrate styling to Tailwind

090
💻DeveloppementIntermediateAll AIs

Refactor legacy code to modern patterns

Gradually modernizing legacy code

0100
💻DeveloppementIntermediateGemini

Gemini Prompt for Generating SQL Queries

Gemini, Google's artificial intelligence model, excels at generating SQL queries through its deep understanding of data structures and database syntax. Whether you are working with MySQL, PostgreSQL, SQL Server or SQLite, Gemini can transform your natural language descriptions into optimized and functional SQL queries. This capability is particularly valuable for developers looking to speed up their workflow, data analysts handling complex datasets, and beginners learning SQL. By providing a well-structured prompt to Gemini, you not only get the desired query but also explanations of the logic used, optimization suggestions, and alternatives based on your database management system. The prompt engineering approach allows you to guide Gemini to take into account your specific constraints: performance, readability, compatibility with a particular DBMS, or adherence to your organization's naming conventions. Discover how to formulate your prompts to get the most out of Gemini in generating SQL queries.

0112
💻DeveloppementIntermediateAll AIs

Implement secrets management

Secure credentials management

0102