:叉 和 刀:这是叉.
比较 prettier, (中文(简体) ), @btmills/prettier 将二进制运算符移动到长表达式中的新行开头,而不是上行的结尾。 就是这样.
// prettier:
const before =
bom.length >= 2 &&
((bom.charCodeAt(0) === 0xff && bom.charCodeAt(1) === 0xfe) ||
(bom.charCodeAt(0) === 0xfe && bom.charCodeAt(1) === 0xff));
// @btmills/prettier:
const after =
bom.length >= 2
&& ((bom.charCodeAt(0) === 0xff && bom.charCodeAt(1) === 0xfe)
|| (bom.charCodeAt(0) === 0xfe && bom.charCodeAt(1) === 0xff));
使用量
使用别名安装( I)无, (中文(简体) ), 线条所以,这样 require('prettier') 透明地决定了这个分叉:
npm install --save-dev prettier@npm:@btmills/prettier
yarn add --dev prettier@npm:@btmills/prettier
此软件包将像 prettier,编辑集成器应该用它来当真.
释放
叉套件的放出是通过重置 line-before-operator 在最近版本标签上方的分支 main。 。 。 .
# Get the latest changes and update the main branch:
git checkout main
git pull
git push fork
# Rebase the release branch on the latest version:
git checkout line-before-operator
git rebase x.y.z
# Fix conflicts as necessary.
git rebase --continue
# There will be a merge conflict in `yarn.lock`. To resolve it:
yarn && yarn dedupe && yarn dedupe --check
# If any conflicts in snapshots, discard and update automatically:
yarn test -u
# With rebasing done, run tests, push tags, build, and publish:
yarn run lint
yarn test
git tag x.y.z-fork
git push --force-with-lease
git push --tags
yarn run build
yarn run test:dist
cd dist
npm publish
预览代码
Java 脚本
类型脚本
流动
联合来文X
• JSON
支助科
• 常设委员会
减
HTML 语言
· 韦
角 角
图QL
降级
- 也门
你最喜欢的语言?
介绍
Pretier是一个有观点的代码 对于物质。 它通过解析你的代码并用自己的规则重新打印来执行一个一致的样式,这些规则考虑到了最大行长,必要时会包接代码.
投入
foo(reallyLongArg(), omgSoManyParameters(), IShouldRefactorThis(), isThereSeriouslyAnotherOne());
产出
foo(
reallyLongArg(),
omgSoManyParameters(),
IShouldRefactorThis(),
isThereSeriouslyAnotherOne(),
);
Pretier 可以运行 在编辑器中 保存,在一个 承诺前钩,或在 CI 环境 保证你的代码库有一致的风格 不再让devs在代码审查上贴出一首非选评论!
安装 • 妇女 选项 • 妇女 国 际 • 妇女 API 密码
徽标
[](https://github.com/prettier/prettier)
捐款
见 捐款额。 。 。 .