Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat add prettier #40

Closed
wants to merge 2 commits into from
Closed

Feat add prettier #40

wants to merge 2 commits into from

Conversation

fyangstudio
Copy link
Contributor

@fyangstudio fyangstudio commented Apr 27, 2021

#36

测试发现 eslint-config-ali 可能会跟 Prettier 格式化结果有冲突,例如这条规则

为避免冲突,使用 eslint-config-prettiereslint-plugin-prettier

测试进度

  • 单测
  • spec 项目示例
  • 示例项目
  • Doctor cli

@alvinhui
Copy link
Member

alvinhui commented May 8, 2021

如果这个加了的话,从模板层面,是不是不再需要主动引用 prettier 了?

比方说 https://github.com/alibaba-fusion/materials/blob/master/scaffolds/scaffold-lite/_prettierrc.js

@fyangstudio
Copy link
Contributor Author

如果这个加了的话,从模板层面,是不是不再需要主动引用 prettier 了?

比方说 https://github.com/alibaba-fusion/materials/blob/master/scaffolds/scaffold-lite/_prettierrc.js

对的,可以不加

@alvinhui
Copy link
Member

materials 也帮忙更新一下吧

@fyangstudio
Copy link
Contributor Author

经过更详尽的测试,不推荐在 ESlint 中加入 prettier。原因如下:

  1. 较 ESLint config 体系,eslint-config-prettier 的质量是不合格的。所有错误都是 prettier/prettier
    image

  2. 想要更精细控制 prettier,用户需要再项目中再配置 .prettierrc.js 。不使用 prettier 的用户较困惑。

@fyangstudio
Copy link
Contributor Author

ESLint 已可以满足大部分格式问题。

秉承简单易用原则,我们将主要推荐 ESLint 修复链路,淡化 prettier 配置。

@fyangstudio fyangstudio deleted the feat-add-prettier branch May 12, 2021 02:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants