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

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

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

Brand Comment Responses

Consistent and fast social media community management

0219
💻DeveloppementIntermediateClaude

Complete Code Review for Pull Requests

Get an exhaustive code review covering quality, performance, security, and maintainability for any language.

34561
💻DeveloppementAdvancedChatGPT

Master Advanced TypeScript Types

Strengthen your code's type safety with advanced generics, utility types, and discriminated unions.

39548
💻DeveloppementIntermediateAll AIs

Perplexity Prompt for Generating Python Code

Perplexity AI stands out from other AI assistants with its unique ability to combine real-time web search and code generation. When it comes to producing Python code, this advantage is significant: Perplexity can rely on the latest official documentation, current best practices, and up-to-date libraries to generate reliable and modern code. Unlike a classic LLM whose knowledge is frozen at a cutoff date, Perplexity verifies its sources in real time, drastically reducing the risk of obsolete code or deprecated functions. Whether you are a developer looking to speed up your workflow, a data scientist wanting to prototype quickly, or a beginner learning Python, a well-structured prompt turns Perplexity into a true development assistant. The key lies in the precision of your request: by specifying the technical context, constraints, and expected output format, you get production-ready code rather than a generic snippet. This guide offers optimized prompts to get the most out of Perplexity in your Python projects.

0204