Skip to content
SheepTester-forksPublic
forked from prettier/prettier

About

@sheeptester/prettier, a fork of prettier because prettierx hasn't been updated in 5 years and I don't want to reformat my entire repo

Resources

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

 
 

Latest commit

 

History

11,265 Commits

Folders and files

NameName
Last commit message
Last commit date
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Fork of Prettier

This is a fork of Prettier to support StandardJS. As the years pass, prettier-standard and prettierX get increasingly out of date, and my formatters are unable to format new JavaScript/TypeScript syntax features like import attributes. And now the Prettier VS Code extension no longer accepts prettierX's version number.

The goal of this fork is to port the following four new config options from prettierX:

  • generatorStarSpacing
  • spaceBeforeFunctionParen
  • offsetTernaryExpressions
  • yieldStarSpacing

With those extra options, the following config should satisfy most of StandardJS's formatting rules.

arrowParens: avoid
generatorStarSpacing: true
spaceBeforeFunctionParen: true
singleQuote: true
jsxSingleQuote: true
semi: false
offsetTernaryExpressions: true
yieldStarSpacing: true
trailingComma: none

Usage

Install my fork with

npm install -D @sheeptester/prettier

Then put the above config in .prettierrc.yml.

The API should otherwise be identical to Prettier, so for example, npx prettier . --write will format all your files.

In VS Code, you can specify the Prettier instance you're using with

{
  "prettier.prettierPath": "./node_modules/@sheeptester/prettier/index.mjs"
}

Other IDEs probably have an equivalent setting.

Known differences

See the StandardJS test snapshot diff. Compared to prettierX,

  • Top-level comma expressions are now wrapped in parentheses ;(a, b).
  • Long template literals now get wrapped.

Development

See CONTRIBUTING.md for how testing works.

yarn build
cd dist/prettier
# Add `--tag alpha` if publishing a prerelease version
npm publish --access public

Prettier Banner

Opinionated Code Formatter

JavaScript · TypeScript · Flow · JSX · JSON
CSS · SCSS · Less
HTML · Vue · Angular
GraphQL · Markdown · YAML
Your favorite language?

CI Status Coverage Status Blazing Fast
npm version weekly downloads from npm code style: prettier Follow Prettier on X

Intro

Prettier is an opinionated code formatter. It enforces a consistent style by parsing your code and re-printing it with its own rules that take the maximum line length into account, wrapping code when necessary.

Input

foo(reallyLongArg(), omgSoManyParameters(), IShouldRefactorThis(), isThereSeriouslyAnotherOne());

Output

foo(
  reallyLongArg(),
  omgSoManyParameters(),
  IShouldRefactorThis(),
  isThereSeriouslyAnotherOne(),
);

Prettier can be run in your editor on-save, in a pre-commit hook, or in CI environments to ensure your codebase has a consistent style without devs ever having to post a nit-picky comment on a code review ever again!


Documentation

Install · Options · CLI · API

Playground


Badge

Show the world you're using Prettier → code style: prettier

[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg?style=flat-square)](https://github.com/prettier/prettier)

Contributing

See CONTRIBUTING.md.

About

@sheeptester/prettier, a fork of prettier because prettierx hasn't been updated in 5 years and I don't want to reformat my entire repo

Resources

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages