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

Be the first to comment on this prompt.

📬 Get new prompts every week

Join our newsletter and never miss a prompt.

Go further

Similar Prompts

💻DeveloppementIntermediateClaude

Task brief for Claude Code: frame a feature end to end

Brief template to delegate a complete feature to Claude Code: goal, starting point, constraints, definition of done, working rules and recap format.

1681
💻DeveloppementIntermediateClaude

Write a project's CLAUDE.md: the brief Claude Code reads at every session

Turns your project description into a dense CLAUDE.md: commands, structure, conventions, pitfalls, off-limits areas and situations where the agent must ask before acting.

640
💻DeveloppementAdvancedAll AIs

Design a Secure Webhook API

Design a webhook API with event subscriptions, signed deliveries, retry limits, and a delivery log your support team can inspect.

411
💻DeveloppementIntermediateAll AIs

Generate Storybook Stories for UI Components

Generate Storybook stories for a UI component, with visual variants, interactive controls, interaction tests, and MDX documentation.

474