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

Add prettier formatting for www #29768

Merged
merged 4 commits into from
Feb 27, 2023

Conversation

pierrejeambrun
Copy link
Member

Issue:
Formatting with eslint is too permissive. 2 different formatting style can be considered 'valid' for eslint but quite different in practice. Also formatting with eslint is not the most common so switching for prettier might be helpful. (most front-end dev have their IDE already working with prettier)

Solution:
This introduce an opinionated formatter to have better consistency in our front-end code base.

  • Integrate with our eslint config
  • Integrate with our stylelint config
  • Add the prettier formatting step to the pre-commit hook, and rename/clarify the hook id/description

@boring-cyborg boring-cyborg bot added area:dev-tools area:UI Related to UI/UX. For Frontend Developers. area:webserver Webserver related Issues labels Feb 25, 2023
@pierrejeambrun pierrejeambrun force-pushed the add-prettier-for-formatting branch from c884366 to c82b6d6 Compare February 25, 2023 20:28
@@ -0,0 +1,10 @@
{
Copy link
Member Author

@pierrejeambrun pierrejeambrun Feb 25, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is necessary because prettier is otherwise using the default config in .editorconfig that will format with an indent size of 4 json files.

.mypy_cache/
templates/**/*.html
dist/
*.md
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't prettier format yaml and md. Those are handled by other dedicated pre-commit hook.

@pierrejeambrun pierrejeambrun added this to the Airflow 2.5.2 milestone Feb 25, 2023
@pierrejeambrun pierrejeambrun added the changelog:skip Changes that should be skipped from the changelog (CI, tests, etc..) label Feb 25, 2023
Copy link
Contributor

@bbovenzi bbovenzi left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking good! Let's update the contributing documentation too.

@pierrejeambrun pierrejeambrun force-pushed the add-prettier-for-formatting branch 3 times, most recently from 8a18ac3 to 8d549ef Compare February 27, 2023 18:14
@pierrejeambrun pierrejeambrun force-pushed the add-prettier-for-formatting branch from 8d549ef to 40dfa42 Compare February 27, 2023 18:50
@bbovenzi bbovenzi merged commit 0db38ad into apache:main Feb 27, 2023
@pierrejeambrun pierrejeambrun deleted the add-prettier-for-formatting branch February 27, 2023 20:11
@jedcunningham
Copy link
Member

jedcunningham commented Mar 8, 2023

(Kicking this to 2.6, a ton of churn for no functional differences)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area:dev-tools area:UI Related to UI/UX. For Frontend Developers. area:webserver Webserver related Issues changelog:skip Changes that should be skipped from the changelog (CI, tests, etc..)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants