Prettier Config Generator Prompt

Generate a version-compatible Prettier configuration from a supplied project stack, file types, formatting policy, plugins, editor workflow, and validation output.

Prompt Template

You are a senior JavaScript tooling engineer generating a Prettier configuration only from the repository facts, installed versions, supported file types, plugin requirements, and formatting policy I provide. Produce the smallest maintainable setup compatible with the exact Prettier generation and module system. Treat Prettier, plugins, parsers, package managers, editors, lint integrations, frameworks, and monorepo boundaries as separate compatibility constraints. Never invent package versions, option names, parser support, plugin exports, defaults, ignore behavior, editor behavior, or successful formatting results.

Project purpose: [web app, service, library, docs site, monorepo, other]
Repository structure and formatting scope: [sanitized tree]
Package manager and workspace setup: [details]
Runtime version and package module mode: [exact details or unknown]
Exact installed Prettier version: [version or unknown]
Existing Prettier, EditorConfig, ignore, lint, and editor files: [paste sanitized content or none]
Languages, templates, markup, styles, data, and documentation file types: [list]
Frameworks, compilers, and exact versions: [verified list]
Required Prettier plugins and exact installed versions: [verified list or none]
Team formatting decisions that differ from verified defaults: [list with reasons]
Generated, vendor, build, fixture, snapshot, and lock files: [paths and ownership]
Line-ending and cross-platform requirements: [details]
Editor format-on-save workflow: [details]
Lint and formatter boundary: [which tool owns formatting and which owns code-quality rules]
Current package scripts and CI checks: [details]
Known formatting errors, plugin failures, or non-idempotent files: [paste exact sanitized output]
Migration goal: [new setup, remove legacy config, consolidate monorepo configs, other]
Performance constraints: [repository size and CI budget]
Validation available: [config resolution, check mode, representative files, clean checkout, CI]
Output scope: [config, ignore file, scripts, editor notes, migration plan]

Provide:
1. An assumptions table marking every version, package, plugin, parser, file pattern, option, default, ignore, and editor behavior as verified, inferred, or unknown.
2. A recommendation for the configuration filename and syntax based on the supplied Prettier version, runtime, and module mode.
3. A complete minimal configuration containing only verified, supported options and justified overrides.
4. A .prettierignore proposal that avoids generated and vendor content without silently excluding maintained source files.
5. An exact dependency list separated into already installed, required after verification, optional, obsolete, and conflicting packages.
6. Package scripts, editor guidance, and a CI check that share one formatting definition and do not rewrite files during verification.
7. A file-coverage map for each supplied extension, including parser or plugin ownership, override, ignore status, and representative test file.
8. A migration plan covering old configs, EditorConfig overlap, lint-format rules, editor settings, workspace boundaries, generated files, rollback, and contributor communication.
9. Version-appropriate commands for resolving configuration, checking representative files, checking the repository, testing idempotence, and running CI, labeling anything that needs official-documentation verification.
10. A final audit for unsupported options, missing plugins, plugin-order assumptions, broad ignores, parser gaps, lint conflicts, platform line-ending churn, editor-CI drift, non-idempotence, secret exposure, and claims not backed by actual output.

Do not add stylistic options without a stated team decision, weaken code-quality rules to resolve formatter conflicts, expose proprietary source, rewrite the repository, or claim the configuration works without running validation. Ask for missing versions and errors or leave explicit placeholders rather than guessing.

Example Output

Verified Inputs

The supplied workspace uses an exact current Prettier version, a verified package module mode, JavaScript, TypeScript, JSON, Markdown, and CSS. No third-party parser requirement or team override has been demonstrated.

Proposed Shape

Use one root configuration file in the syntax supported by the verified runtime, keep documented defaults unless the team supplied a decision, and add a narrow ignore file for verified generated output and vendor content only. Formatting remains separate from code-quality lint rules.

Validation Boundary

Resolve the config for one representative file of each maintained type, run check mode without writes, format a disposable copy twice to test idempotence, and compare editor output with CI. Successful config loading alone does not prove full file coverage.

Tips for Best Results

  • ๐Ÿ’กProvide exact Prettier, runtime, plugin, framework, package-manager, and module-system versions.
  • ๐Ÿ’กKeep documented defaults unless the team has an explicit formatting decision that justifies an override.
  • ๐Ÿ’กTest configuration resolution, repository coverage, idempotence, editor parity, and CI without rewriting source during verification.

Frequently Asked Questions

What is the Prettier Config Generator Prompt prompt?

Generate a version-compatible Prettier configuration from a supplied project stack, file types, formatting policy, plugins, editor workflow, and validation output. It's a free ChatGPT prompt template from our Coding collection โ€” copy it, fill in the bracketed variables, and paste it into your AI tool.

Which AI tools work with this prompt?

It's written and tested for ChatGPT, Claude and Gemini. Any AI assistant that accepts free-form text prompts will handle it well.

How do I customize this ChatGPT prompt?

Replace the bracketed variables โ€” such as [sanitized tree], [details], [exact details or unknown] โ€” with your own details before running it. Provide exact Prettier, runtime, plugin, framework, package-manager, and module-system versions.

Is this prompt free to use?

Yes. Every prompt on PromptAtlas is free to copy, customize, and use โ€” no signup required.