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

Design Review 2019-03-06 21:00 UTC (prettier for code formatting) #20844

Closed
mrjoro opened this issue Feb 13, 2019 · 5 comments
Closed

Design Review 2019-03-06 21:00 UTC (prettier for code formatting) #20844

mrjoro opened this issue Feb 13, 2019 · 5 comments
Assignees
Milestone

Comments

@mrjoro
Copy link
Member

mrjoro commented Feb 13, 2019

Time: 2019-03-06 21:00 UTC (add to Google Calendar)
Location: Video conference via Google Meet

The AMP Project holds weekly engineering design reviews. We encourage everyone in the community to participate in these design reviews.

If you are interested in bringing your design to design review, read the design review documentation and add a link to your design doc by the Monday before your design review.

When attending a design review please read through the designs before the design review starts. This allows us to spend more time on discussion of the design.

We rotate our design review between times that work better for different parts of the world as described in our design review documentation, but you are welcome to attend any design review. If you cannot make any of the design reviews but have a design to discuss please let mrjoro@ know on Slack and we will find a time that works for you.

@mrjoro mrjoro added this to the Docs Updates milestone Feb 13, 2019
@mrjoro mrjoro self-assigned this Feb 13, 2019
@nainar
Copy link
Contributor

nainar commented Mar 2, 2019

Potential topic: #20237

@rsimha
Copy link
Contributor

rsimha commented Mar 4, 2019

Adopt prettier for code formatting: #17086 and #21212

@nainar
Copy link
Contributor

nainar commented Mar 5, 2019

Taking the loaders topic of the agenda, since we don't have the approvals on the designs yet.

@aghassemi
Copy link
Contributor

Adopt prettier for code formatting: #17086 and #21212

  • Partially replace eslint with prettier which will auto format code automatically
  • We do lots of nits related to formatting during code review
  • We also do lots of lint commits after the fact
  • Adopting prettier will remove the need for the 2 points mentioned above.
  • Currently AMP uses eslint for both formatting and code correctness (e.g. unused variables, custom rules)
  • Proposal: We keep using eslint for code correctness but we use prettier for formatting.
  • @sparhami : Did you explore clag format, do you know how it compares to prettier?
  • @rsimha: We haven't played with clag format, we went with prettier because it is common in JS and it is OSS.
  • @erwinmombay We tried it in https://github.com/ampproject/amphtml/pull/774/files
  • @cramforce clag format is not as pretty and does not have idiomatic JS formatting.
  • @torch2424 I like to bring up points raised and maybe prettier is not the best for us.
  • @alanorozco it may change template literals, @jridgewell it must be a setting we can configure since it is a semantic change when it does it on template literals.
  • Next Steps:
  • Outstanding bug that prettier is fixing (automatic removal of quotes around object field names_
  • We need to do one run across all code considering directives currently used for ignoring certain eslints at file and line level
  • Test our code
  • Merging this change will be fun!
  • @jridgewell if we breakup into multiple folders, it can help with merge. @rsimha I will probably do this late Friday to avoid conflict.
  • @jridgewell people can avoid conflict to rejecting prettier changes and running a lint --fix after. We can automate this for others.
  • @alanorozco For comments that are inline, we should move them to line above before formatting
  • @sparhami Does this impact /*ok*/? @jridgewell We can change that to use eslint
  • @sparhami Does this work fine with closer type cast? because it is inline (/* @type .. ). It probably works because of parentheses.
  • issue Line 86 in file: 3p/messaging.js , it made the wrong parentheses for CC type.

@rsimha
Copy link
Contributor

rsimha commented Mar 6, 2019

Today's presentation: AMP + Prettier.pdf

@mrjoro mrjoro changed the title Design Review 2019-03-06 21:00 UTC (Americas) Design Review 2019-03-06 21:00 UTC (prettier for code formatting) Apr 25, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants