frame icon indicating copy to clipboard operation
frame copied to clipboard

Formatting

Open goosewobbler opened this issue 2 years ago • 2 comments

Using prettier, lint-staged and husky to remove formatting nits from all PRs going forward. This does not include linting, saving that for another PR.

Prettier options: https://prettier.io/docs/en/options.html

Changes

  • lint-staged runs on husky pre-commit, which runs the format script, which runs prettier on TS, JS, MD, YML, JSON files.
  • formatting can be run and checked manually with npm run format and npm run format:check
  • unit tests run on husky pre-push - so no more PRs with broken tests, and zero tolerance for flaky tests

Prettier settings

printWidth: 120 (better display on larger monitors) singleQuote: true (single quotes used for all string literals apart from JSX) jsxSingleQuote: true (single quotes used for all JSX string literals) semi: false (no semicolons)

In-editor formatting

Prettier VSCode formatter - not required for development but I usually have this configured to format on save: https://marketplace.visualstudio.com/items?itemName=esbenp.prettier-vscode

goosewobbler avatar Jun 27 '22 15:06 goosewobbler

one more thing is we should wait until we rebase develop off of 0.5 before we do this otherwise the rebase will be an absolute nightmare. which direction makes more sense, to do this on 0.5 and port it to develop or vice versa?

mholtzman avatar Jul 01 '22 14:07 mholtzman

I think we might actually want to wait until the first develop/canary release goes to production before making these types of changes. Also, please wait for my review on this one as well.

floating avatar Jul 01 '22 14:07 floating

Closing in favour of #1113

goosewobbler avatar Oct 20 '22 19:10 goosewobbler