Registry / devops / prettier-sdk

prettier-sdk

JSON →
library1.0.2jsnpmunverified

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.

npm install prettier-sdk
INSTALL
IMPORT
SIG · PRETTIER-SDK
P
prettier-sdk
devopsjavascriptv1.0.2
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

prettier
✓ import prettier from 'prettier'
✗ import { prettier } from 'prettier'
Prettier uses a default export; named exports are deprecated.
format
✓ import { format } from 'prettier'
✗ import format from 'prettier'
format is a named export; using it as default is incorrect.
check
✓ import { check } from 'prettier'
✗ const { check } = require('prettier')
check is a named export; CommonJS require is still supported but ESM is preferred.

Shows basic usage: importing prettier and formatting a JavaScript snippet with options.

import prettier from 'prettier'; const code = `foo(reallyLongArg(), omgSoManyParameters(), IShouldRefactorThis(), isThereSeriouslyAnotherOne());`; const formatted = prettier.format(code, { parser: 'babel', semi: true, singleQuote: true, }); console.log(formatted); // Output: // foo( // reallyLongArg(), // omgSoManyParameters(), // IShouldRefactorThis(), // isThereSeriouslyAnotherOne(), // );
Debug
Known issues
gotchaIf 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.
fix
npm uninstall prettier-sdk && npm install prettier
affects: >=0.0.0
gotchaPrettier formatting is non-configurable by default; using .prettierrc file is required for custom options.
fix
Create a .prettierrc file in project root with your desired settings.
affects: >=1.0.0
gotchaPrettier may break code that depends on specific formatting (e.g., template literals, comments). Always review changes in a pre-commit hook.
fix
Use prettier-ignore comments for files that should not be formatted.
affects: >=0.0.0
Errors
Common errors & fixes
Could not resolve 'prettier-sdk' from '<file>'
Installed the wrong package (prettier-sdk instead of prettier).
fix
Uninstall prettier-sdk and install prettier: npm uninstall prettier-sdk && npm install prettier
Upgrade
Version history
1.0.2latest on npm
Audit
Dependencies
prettierrequiredDepends on the official Prettier package for formatting logic
Agent activity
5 hits · last 30 days
node
4
Bingbot
1
Resources
prettier-sdk — npm install prettier-sdk · libregistry