prettier-miscellaneous
raw JSON → 1.5.3 verified Sat Apr 25 auth: no javascript maintenance
A fork of Prettier (v1.5.3) that aims to support minor extra options not accepted by the official Prettier project. It provides an opinionated code formatter for JavaScript, TypeScript, JSX, Flow, CSS, LESS, SCSS, JSON, and GraphQL. The fork appears to be in maintenance mode with no recent updates; the last version is 1.5.3 from 2018. Unlike the actively maintained Prettier, this fork is no longer being developed, but it may still be useful for users who want specific customization options that were proposed but not merged upstream.
Common errors
error Error: Cannot find module 'prettier-miscellaneous' ↓
cause Package not installed or wrong import path.
fix
Run 'npm install prettier-miscellaneous' and ensure import is correct.
error TypeError: prettierMiscellaneous is not a function ↓
cause Default import used instead of named import.
fix
Use import { format } from 'prettier-miscellaneous' instead of import prettierMiscellaneous from ...
error Error: Cannot resolve parser 'babel' ↓
cause Parser not bundled; may need to install additional parser plugins.
fix
Use 'babylon' parser instead: { parser: 'babylon' }
Warnings
deprecated prettier-miscellaneous is a fork of Prettier v1.5.3 and is no longer actively maintained. Consider using the official Prettier or another actively maintained fork. ↓
fix Switch to prettier (official) or prettier-fork with maintained options.
breaking This fork may have options that differ from official Prettier. Check documentation for extra options not present in Prettier core. ↓
fix Review the README or source for custom options; be aware of compatibility.
gotcha The API is not guaranteed to be stable; breaking changes may occur between minor versions. ↓
fix Pin to exact version and test upgrades.
gotcha Some editor integrations may not work with this fork; use CLI or API directly. ↓
fix Use command-line tool or Node.js API; avoid editor plugins.
Install
npm install prettier-miscellaneous yarn add prettier-miscellaneous pnpm add prettier-miscellaneous Imports
- format wrong
import prettierMiscellaneous from 'prettier-miscellaneous'correctimport { format } from 'prettier-miscellaneous' - check wrong
const check = require('prettier-miscellaneous').checkcorrectimport { check } from 'prettier-miscellaneous' - resolveConfig
import { resolveConfig } from 'prettier-miscellaneous'
Quickstart
import { format } from 'prettier-miscellaneous';
const sourceCode = `function hello(name) { return 'Hello, ' + name; }`;
const formatted = format(sourceCode, {
parser: 'babel',
printWidth: 80,
singleQuote: true,
trailingComma: 'es5'
});
console.log(formatted);