metadata icon indicating copy to clipboard operation
metadata copied to clipboard

[Frontend] Standardize code style using prettier

Open kwasi opened this issue 6 years ago • 3 comments

A kubeflow/metadata version of kubeflow/pipelines issue #2406.

As mentioned in that issue, Prettier will save formatting cycles in code review. It can also be setup with a file watcher to auto-format changed lines or files on save.

Sub-tasks

  • [ ] Create a Prettier config
  • [ ] Allow a week for comments on the config
  • [ ] Format the whole code base after syncing with people with PRs in flight
  • [ ] Add a section on code style to frontend/README.md

The last sub-task is blocked by updating the README.md file (#140).

kwasi avatar Oct 25 '19 18:10 kwasi

Thanks for putting these together!

For sync with kubeflow/pipelines. I recommend we use the same config as https://github.com/kubeflow/pipelines/blob/master/frontend/.prettierrc.yaml

trailingComma: all
singleQuote: true
jsxSingleQuote: true
printWidth: 100

Let me know if there's anything you want to change. We can discuss and adjust the config back to kubeflow/pipelines too.

Bobgy avatar Oct 29 '19 09:10 Bobgy

Sounds good! We definitely want to keep all the frontend projects in sync so we'll start with your .prettierrc.yaml.

kwasi avatar Nov 02 '19 22:11 kwasi

/area front-end /kind feature /priority p2

jtfogarty avatar Jan 08 '20 15:01 jtfogarty