Registry / devops / ah-prettier

ah-prettier

JSON →
library2.8.4jsnpmunverified

A fork of Prettier (v2.8.4) that moves binary operators to the beginning of new lines in long expressions instead of the end of the previous line. This is the only difference from upstream Prettier. The package is designed to be installed as an alias so that require('prettier') resolves to this fork transparently. It supports JavaScript, TypeScript, Flow, JSX, JSON, CSS, SCSS, Less, HTML, Vue, Angular, GraphQL, Markdown, and YAML. Releases are rebased on top of Prettier version tags. Not actively maintained as a separate project; it follows upstream releases with a single feature change.

npm install ah-prettier
INSTALL
IMPORT
SIG · AH-PRETTIER
A
ah-prettier
devopsjavascriptv2.8.4
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
npm install --save-dev prettier@npm:@btmills/prettier
npm install --save-dev @btmills/prettier
Must be installed as an alias so that require('prettier') resolves to the fork. Direct install of @btmills/prettier won't work.
prettier
const prettier = require('prettier');
const prettier = require('@btmills/prettier');
After installing as an alias, require('prettier') gives the fork. Do not require the scoped name.

Demonstrates installing as alias and using the fork via require('prettier').

// Install: npm install --save-dev prettier@npm:@btmills/prettier const prettier = require('prettier'); const code = `const x = a && b || c && d;`; const options = { parser: 'babel' }; prettier.format(code, options).then(result => { console.log(result); });
Debug
Known issues
gotchaMust install as alias (prettier@npm:@btmills/prettier) not directly. Direct installation will fail to resolve.
fix
Use npm install --save-dev prettier@npm:@btmills/prettier
affects: all
gotchaDoes not include all upstream Prettier features; only line-before-operator is different.
fix
Check upstream for recent changes if needed.
affects: all
gotchaEditor integrations expecting 'prettier' may still use upstream unless configured.
fix
Ensure editor uses the locally installed 'prettier' package.
affects: all
Errors
Common errors & fixes
Cannot find module 'prettier'
Installed @btmills/prettier directly without alias.
fix
Uninstall @btmills/prettier and install using prettier@npm:@btmills/prettier
Module not found: Can't resolve 'prettier'
Using require('@btmills/prettier') instead of require('prettier').
fix
Change import to require('prettier') after alias install.
Upgrade
Version history
2.8.4latest on npm
Audit
Dependencies

No dependency data recorded yet.

Agent activity
61 hits · last 30 days
node
56
OpenAI (training)
1
Resources
ah-prettier — npm install ah-prettier · libregistry