P
BeginnerAll AIs

Configure ESLint and Prettier for a JavaScript project

Configure ESLint and Prettier comprehensively with ESLint v9 flat config, VS Code integration, Git Husky hooks and CI pipeline, adapted to the team's framework and style.

Paste in your AI

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

Tu es un expert en qualité de code JavaScript et TypeScript. Configure ESLint et Prettier de façon optimale pour mon projet.

**Type de projet :** [TYPE_PROJET] (ex: React SPA, API Node.js, monorepo)
**Framework :** [FRAMEWORK]
**TypeScript :** [UTILISE_TYPESCRIPT] (oui/non)
**Style de code préféré :** [STYLE] (ex: Airbnb, Standard, Google, custom)
**Gestionnaire de paquets :** [PACKAGE_MANAGER] (npm, pnpm, yarn)

**Règles spécifiques souhaitées :** [REGLES_SPECIFIQUES]

Fournis :
1. **package.json** : liste des dépendances à installer (devDependencies)
2. **eslint.config.js** (flat config ESLint v9+) : configuration complète et commentée
3. **.prettierrc** : configuration Prettier adaptée au style souhaité
4. **.prettierignore** et **.eslintignore** : fichiers à exclure
5. **Scripts npm** : lint, lint:fix, format, format:check
6. **Intégration IDE** : configuration VS Code (settings.json et extensions recommandées)
7. **Git hooks avec Husky + lint-staged** : lint et format avant chaque commit
8. **Intégration CI** : étape GitHub Actions pour vérifier le linting
9. **Règles expliquées** : pourquoi chaque règle non-standard choisie

Objectif : zéro friction au quotidien pour l'équipe.

Why this prompt works

The migration to ESLint v9 flat config is a common and poorly documented topic. Git hooks integration via Husky is the barrier that ensures code quality even before CI. The request for explanation of non-standard rules produces team convention documentation directly in the config.

Use Cases

Standardize code style for a new teamMigrate from ESLint v8 to flat config v9Set up linting on an existing project without configuration

Expected Output

Complete ESLint flat config and Prettier configuration, npm scripts, VS Code settings, Husky + lint-staged configuration, CI step and explanations of chosen rules.

Learn more

Check the full skill on Prompt Guide to master this technique from A to Z.

View on Prompt Guide