RolnickLab / ami-platform

GNU General Public License v3.0
8 stars 2 forks source link

Make FE code formatting more clear #395

Closed annavik closed 1 month ago

annavik commented 1 month ago

I realized after checking https://github.com/RolnickLab/ami-platform/pull/375 that how we format the frontend code is perhaps not super clear. In this PR we update the README and also we include a format check in the GitHub workflow. The commit history in this PR shows how the format check is first failing, then successful after code is auto formatted.

netlify[bot] commented 1 month ago

Deploy Preview for ami-web canceled.

Name Link
Latest commit 4dafe877e91e20832e68bcd65cf5ea0ed35d2145
Latest deploy log https://app.netlify.com/sites/ami-web/deploys/665f73b178107b000781d505
netlify[bot] commented 1 month ago

Deploy Preview for ami-storybook canceled.

Name Link
Latest commit 4dafe877e91e20832e68bcd65cf5ea0ed35d2145
Latest deploy log https://app.netlify.com/sites/ami-storybook/deploys/665f73b1fa18030008eb5ceb
mihow commented 1 month ago

Thanks @annavik! My formatter in VSCode was fighting with the existing formatting. I pushed two commits to enforce eslint & prettier on-save & pre-commit (then you don't have to wait for the github workflow to reject the changes to know something is wrong). Will you review the settings in .vscode/settings.json and the recommended extensions in .vscode/extensions.json? I like to have shared settings for the project workspace so everyone shares the same formatting during development. I just took a guess at the typescript settings. VS Code recently changed somethings in regards to formatting & linting extensions and I don't totally understand the new approach, but I believe this settings file uses the latest style now.

annavik commented 1 month ago

Thanks @annavik! My formatter in VSCode was fighting with the existing formatting. I pushed two commits to enforce eslint & prettier on-save & pre-commit (then you don't have to wait for the github workflow to reject the changes to know something is wrong). Will you review the settings in .vscode/settings.json and the recommended extensions in .vscode/extensions.json? I like to have shared settings for the project workspace so everyone shares the same formatting during development. I just took a guess at the typescript settings. VS Code recently changed somethings in regards to formatting & linting extensions and I don't totally understand the new approach, but I believe this settings file uses the latest style now.

Ah yes! Thanks for updating the VSCode recommendations and settings, looks perfect to me!