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

Formatter and linter for the frontend #107

Closed
WardBrian opened this issue Jun 28, 2024 · 5 comments
Closed

Formatter and linter for the frontend #107

WardBrian opened this issue Jun 28, 2024 · 5 comments

Comments

@WardBrian
Copy link
Collaborator

I think at least a few of the recent merge conflicts we've had on PRs have been due to formatting differences between editors rather than actual content changing. It would be nice to have a consistent style we can all just tell our editor to use and then forget about it.

I don't have a super strong opinion on which, but to make this concrete I would suggest Prettier with a minimal config. For Stan-Web-Demo I used

{
  "tabWidth": 2,
  "semi": true,
  "arrowParens": "avoid"
}
@magland
Copy link
Collaborator

magland commented Jun 28, 2024

Sounds good. Shall we try to get to a place where we have no outstanding PRs and then sweep through the code and (a) change Analysis to Project (b) enforce prettier formatting?

@WardBrian
Copy link
Collaborator Author

I think it would be beneficial to do it earlier (at least before the webr/pyodide stuff gets merged)

Right now is probably the fewest outstanding PRs we’ve had in a while, especially if we merge #102 and #97 today, so I would propose doing it ~now

@magland
Copy link
Collaborator

magland commented Jun 28, 2024

Cool. Once those two are merged (from my perspective they are ready to go), could you make a utility script that formats all .ts/.tsx files, and then we can review whether that is suitable? Do we want to have a pre commit hook? CI check? VSCode setting?

Then I'll fix any conflicts in the other 2 PRs.

@WardBrian
Copy link
Collaborator Author

We already have pre-commit on the backend — that seems like a good choice locally, but setting up your VSCode can also help obviously.

I will update our config and run the full format after they’re merged

@magland
Copy link
Collaborator

magland commented Jun 28, 2024

Sounds good... I snuck one more in there #108 which I think could be merged right away.

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

2 participants