This fork of prettier has the following changes
- CSS embedded in javascript/typescript files is not forced onto multiple lines.
To save the hassle of building prettier, we modify the already bundled code rather than the original source. The following instructions describe how the embedded CSS change is carried out.
- obtain the released prettier code, e.g. from an npm/yarn install of prettier
- find the original code that should be changed in the prettier repo. In this case we are interested in
transformCssDoc
in src/language-js/embed/css.js - locate this code in the bundled version of prettier (likely in index.js)
- modify it
- amend the package.json version number by suffixing -fork{version}
- push the changes to github
- install the forked prettier directly from github through npm/yarn
TODO: it may be worth pulling the modified code out into a separate js file and require()
ing it to make rebasing easier in future...
JavaScript
· TypeScript
· Flow
· JSX
· JSON
CSS
· SCSS
· Less
HTML
· Vue
· Angular
GraphQL
· Markdown
· YAML
Your favorite language?
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.
foo(reallyLongArg(), omgSoManyParameters(), IShouldRefactorThis(), isThereSeriouslyAnotherOne());
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!
Show the world you're using Prettier →
[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg?style=flat-square)](https://github.com/prettier/prettier)
See CONTRIBUTING.md.