我越来约爱用 eslint 来格式化代码了,尤其是在有 antfu 的 https://github.com/antfu/eslint-plugin-antfu/blob/main/src/rules/consistent-list-newline.md 规则用的情况下。 这种给 lint 工具一个提示让它帮我做事情的策略真的很棒。还有一个不容错过的插件就是 https://eslint-plugin-command.antfu.me/commands/keep-sorted,keep-sorted 在你需要对特定位置排序时非常舒服。
我不太能适应 prettier 强制决定代码什么时候该换行,主要是它的决定在不少的场景下不会让代码变得更好看。