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

Adapt this prompt

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

You are an expert in JavaScript tooling and code quality. I need to set up ESLint and Prettier to standardize the code in my project.

Project type:
[e.g. React with TypeScript, Node.js API in pure JavaScript, Next.js project, npm library]

Desired configuration:

  • Base style guide: [e.g. Airbnb, Standard, Google, or custom configuration]
  • TypeScript: [Yes/No]
  • Important specific rules for my team: [e.g. no console.log in production, sorted imports, max line length 100]
  • Specific framework: [e.g. React hooks rules, Jest rules for tests]

Environment:

  • IDE: [e.g. VS Code, WebStorm, Vim]
  • Node.js version: [e.g. 20.x]

Create a complete, ready-to-use configuration:

  1. Installation: npm/yarn commands for all the necessary dependencies with exact versions.
  2. .eslintrc.json or eslint.config.js: complete ESLint configuration with plugins, rules, and ignores.
  3. .prettierrc: Prettier configuration consistent with ESLint (no conflicts).
  4. .eslintignore and .prettierignore: exclusion files suited to the project.
  5. npm scripts: lint, lint:fix, format scripts in package.json.
  6. VS Code configuration (.vscode/settings.json): format on save, integrated ESLint.
  7. Husky + lint-staged: pre-commit hook that lints and formats only the modified files.
  8. CI: GitHub Actions step to check linting.

Explain the most important rules and why they improve code quality.

Personalize this prompt with Léa · AI assistant

Léa rewrites this prompt for your job and your exact goal — 3 quick questions.

Why this prompt works

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

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

đź’»DeveloppementAdvancedAll AIs

Implement canary deployments

Roll out changes safely with canary

495
đź’»DeveloppementIntermediateAll AIs

Design a Complete REST API

Design a robust and well-structured REST API with OpenAPI documentation, error handling, and security best practices.

852
đź’»DeveloppementIntermediateAll AIs

Sora Prompt for Generating a Database Schema

Sora, the visual generation model developed by OpenAI, offers interesting possibilities for creating visual representations of database schemas. Instead of working with traditional technical tools like dbdiagram.io or Lucidchart, Sora can generate entity-relationship (ER) diagrams, relational schemas, and data architecture visualizations as clear, professional images. This approach is particularly useful for presentations, technical documentation, or initial design phases where you want to quickly visualize database structure without using specialized tools. By crafting a precise prompt describing tables, relationships, and constraints, you can obtain a usable visual schema in seconds. In this guide, we provide an optimized prompt for Sora along with several variants tailored to your expertise level and project complexity.

534
đź’»DeveloppementAdvancedAll AIs

Implement drift detection

Detect infrastructure drift

474