Prettier is an opinionated code formatter that supports JavaScript, TypeScript, CSS, HTML, GraphQL, Markdown, and more. Current stable version is 3.x (npm package name 'prettier', not 'prettier-resolver'). Prettier is actively maintained with frequent releases. It differs from other formatters by being opinionated (few options), rewriting entire AST, and integrating into editors, pre-commit hooks, and CI. Available as CLI and API; ships as ESM-only since v3, requires Node >=18.
npm install prettier-resolverNo compatibility data collected yet for this library.
Verified import paths — ran on the pinned version, not inferred.
Demonstrates using Prettier's format() API to format JavaScript code with custom options.
Switch to ESM imports (import { format } from 'prettier') or use dynamic import().Upgrade Node.js to version 18 or later.
Use `const config = (await resolveConfig(filePath)) ?? {};` to avoid undefined errors.Use '--semi false' instead of '--no-semi'.
List plugins in order of application (e.g., prettier-plugin-svelte first).
Run `npm install prettier@latest` and use ESM import syntax.
Use `import { format } from 'prettier'` instead of `import prettier from 'prettier'`.Use `import { format } from 'prettier'` or update to v2 for CommonJS support.Install parser: `npm install --save-dev @prettier/plugin-babel` and add to config.
No dependency data recorded yet.