{"library":"prettier-ts","title":"Prettier","description":"Prettier is an opinionated code formatter that supports JavaScript, TypeScript, CSS, HTML, GraphQL, Markdown, YAML, and many other languages via plugins. The current stable version is 3.8.3 (as of early 2025). It enforces a consistent style by parsing code and re-printing it with its own rules, taking maximum line length into account. Key differentiators: it eliminates debates over code style by being opinionated, integrates with editors and CI via pre-commit hooks, and supports a wide ecosystem of plugins. Released under MIT license, available as an npm package with weekly downloads exceeding 50 million.","language":"javascript","status":"active","last_verified":"Sat Apr 25","install":{"commands":["npm install prettier-ts"],"cli":{"name":"prettier","version":null}},"imports":["import * as prettier from 'prettier'","import { format } from 'prettier'","import { resolveConfig } from 'prettier'","import { check } from 'prettier'"],"auth":{"required":false,"env_vars":[]},"quickstart":{"code":"import { format, resolveConfig } from 'prettier';\n\nasync function formatCode(code, filepath) {\n  const options = await resolveConfig(filepath);\n  const formatted = await format(code, {\n    ...options,\n    parser: 'babel',\n    filepath\n  });\n  console.log(formatted);\n}\n\nformatCode('const x = { foo: \"bar\" }', 'example.js');","lang":"typescript","description":"Demonstrates async formatting with config resolution. Parses source as JavaScript and applies Prettier rules.","tag":null,"tag_description":null,"last_tested":null,"results":[]},"compatibility":null}