{"id":41779,"library":"prettier-sdk","title":"Prettier Code Formatter SDK","description":"Prettier-sdk is an opinionated code formatter that enforces a consistent style by parsing code and re-printing it with its own rules respecting maximum line length. The current stable version is 1.0.2, with an active release cadence. It integrates into editors on-save, pre-commit hooks, and CI pipelines to automate code formatting. Key differentiators: zero configuration for many languages, support for JavaScript, TypeScript, CSS, HTML, and more; highly customizable via configuration files; widely adopted in the JavaScript ecosystem. Note: This package is a placeholder—the real Prettier is at 'prettier' on npm.","status":"active","version":"1.0.2","language":"javascript","source_language":"en","source_url":"https://github.com/prettier/prettier","tags":["javascript","typescript"],"install":[{"cmd":"npm install prettier-sdk","lang":"bash","label":"npm"},{"cmd":"yarn add prettier-sdk","lang":"bash","label":"yarn"},{"cmd":"pnpm add prettier-sdk","lang":"bash","label":"pnpm"}],"dependencies":[{"reason":"Depends on the official Prettier package for formatting logic","package":"prettier","optional":false}],"imports":[{"note":"Prettier uses a default export; named exports are deprecated.","wrong":"import { prettier } from 'prettier'","symbol":"prettier","correct":"import prettier from 'prettier'"},{"note":"format is a named export; using it as default is incorrect.","wrong":"import format from 'prettier'","symbol":"format","correct":"import { format } from 'prettier'"},{"note":"check is a named export; CommonJS require is still supported but ESM is preferred.","wrong":"const { check } = require('prettier')","symbol":"check","correct":"import { check } from 'prettier'"}],"quickstart":{"code":"import prettier from 'prettier';\n\nconst code = `foo(reallyLongArg(), omgSoManyParameters(), IShouldRefactorThis(), isThereSeriouslyAnotherOne());`;\n\nconst formatted = prettier.format(code, {\n  parser: 'babel',\n  semi: true,\n  singleQuote: true,\n});\n\nconsole.log(formatted);\n// Output:\n// foo(\n//   reallyLongArg(),\n//   omgSoManyParameters(),\n//   IShouldRefactorThis(),\n//   isThereSeriouslyAnotherOne(),\n// );","lang":"typescript","description":"Shows basic usage: importing prettier and formatting a JavaScript snippet with options."},"warnings":[{"fix":"npm uninstall prettier-sdk && npm install prettier","message":"If you import prettier-sdk instead of prettier, you get a dummy package that only re-exports the real prettier. Always use the official 'prettier' npm package.","severity":"gotcha","affected_versions":">=0.0.0"},{"fix":"Create a .prettierrc file in project root with your desired settings.","message":"Prettier formatting is non-configurable by default; using .prettierrc file is required for custom options.","severity":"gotcha","affected_versions":">=1.0.0"},{"fix":"Use prettier-ignore comments for files that should not be formatted.","message":"Prettier may break code that depends on specific formatting (e.g., template literals, comments). Always review changes in a pre-commit hook.","severity":"gotcha","affected_versions":">=0.0.0"}],"env_vars":null,"search_vec":"'1.0.2':39 'activ':42 'adopt':84 'autom':60 'cadenc':44 'ci':57 'code':2,11,20,61 'commit':54 'configur':66,81 'consist':16 'css':74 'current':35 'customiz':79 'differenti':64 'ecosystem':88 'editor':48 'enforc':14 'file':82 'format':62 'formatt':3,12 'high':78 'hook':55 'html':75 'integr':46 'javascript':72,87,103 'key':63 'languag':69 'length':33 'line':32 'mani':68 'maximum':31 'note':89 'npm':102 'on-sav':49 'opinion':10 'packag':91 'pars':19 'pipelin':58 'placehold':94 'pre':53 'pre-commit':52 'prettier':1,6,97,100 'prettier-sdk':5 'print':24 're':23 're-print':22 'real':96 'releas':43 'respect':30 'rule':29 'save':51 'sdk':4,7 'stabl':36 'style':17 'support':70 'typescript':73,104 'version':37 'via':80 'wide':83 'zero':65","created_at":"2026-06-04T18:54:04.245033+00:00","updated_at":"2026-06-04T18:54:04.245033+00:00","problems":[{"fix":"Uninstall prettier-sdk and install prettier: npm uninstall prettier-sdk && npm install prettier","cause":"Installed the wrong package (prettier-sdk instead of prettier).","error":"Could not resolve 'prettier-sdk' from '<file>'"}],"ecosystem":"npm","meta_description":null,"install_score":null,"quickstart_score":null,"quickstart_tag":null,"pypi_latest":null,"cli_name":null,"cli_version":null,"type":"library","homepage":"https://prettier.io","github":"https://github.com/prettier/prettier","docs":null,"changelog":null,"pypi":null,"npm":"prettier-sdk","openapi_spec":null,"status_page":null,"smithery":null,"categories":["devops"],"base_url":null,"auth_type":null,"provenance":{"verified_status":null,"verified_at":null,"last_verified":"2026-06-04","next_check":"2026-09-02","install_tag":null}}