@adamjlev/prettier 中文文档教程
PURPOSE OF THIS FORK:
修复了 Prettier 团队不想修复的难看的 html/vue 格式:
https://github.com/prettier/prettier/issues/5377
Opinionated Code Formatter
JavaScript · 打字稿 · 流动 · 捷信 · JSON
CSS · SCSS · 较少的
HTML · 视图 · 棱角分明
图形QL · 降价 · YAML
你最喜欢的语言?
Intro
Prettier 是一个自以为是的代码格式化程序。 它通过解析您的代码并使用自己的规则重新打印它来强制执行一致的样式,这些规则考虑了最大行长度,并在必要时包装代码。
Input
foo(reallyLongArg(), omgSoManyParameters(), IShouldRefactorThis(), isThereSeriouslyAnotherOne());
Output
foo(
reallyLongArg(),
omgSoManyParameters(),
IShouldRefactorThis(),
isThereSeriouslyAnotherOne()
);
Prettier 可以在在你的编辑器中运行,在保存时,在 pre-commit hook,或者在 CI 环境中 以确保您的代码库具有一致的风格,而开发人员无需再次在代码审查中发表挑剔的评论!
Badge
[![code style: prettier](https://img.shields.io/badge/code_style-prettier-ff69b4.svg?style=flat-square)](https://github.com/prettier/prettier)
Contributing
请参阅 CONTRIBUTING.md。
PURPOSE OF THIS FORK:
Fixes ugly html/vue formatting that Prettier team doesn't want to fix:
https://github.com/prettier/prettier/issues/5377
Opinionated Code Formatter
JavaScript · TypeScript · Flow · JSX · JSON
CSS · SCSS · Less
HTML · Vue · Angular
GraphQL · Markdown · YAML
Your favorite language?
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!
Badge
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)
Contributing
See CONTRIBUTING.md.