FluidFramework icon indicating copy to clipboard operation
FluidFramework copied to clipboard

add prettier to shared tree

Open daesun-park opened this issue 3 years ago • 3 comments

Description

This PR adds prettier to the shared tree portion of our repo.

This PR is a portion of PR https://github.com/microsoft/FluidFramework/pull/11613, as it was suggested to split the PR up into several PRs. Running the prettier will be done in separate PRs.

Reviewer Guidance

Questions

  1. It currently seems to be running into a build error when running the lint test, as I only added the prettier (and did not run it). Is there a way to pass this ci test without running the prettier?

daesun-park avatar Sep 14 '22 10:09 daesun-park

Have you check that this does not add any more warnings to npm run build:fast? Currently we have a bunch of warnings from things like non-conformant build scripts and this change could easily add more if its not just right: be sure to check for that (and double check it just before we actually merge this). There is no CI enforcement of this.

CraigMacomber avatar Sep 14 '22 18:09 CraigMacomber

I removed the prettier from the lint command, and checked npm run build:fast to see if there were any additional warnings. Aside from some "non-conformant script" warnings (which should go away when we add the prettier back to the lint commands), there were no additional warnings.

@fluid-internal/tree: warning: non-conformant script "lint"
@fluid-internal/tree: warning:   expect: npm run prettier && npm run eslint
@fluid-internal/tree: warning:   actual: npm run eslint
@fluid-internal/tree: warning: non-conformant script "lint:fix"
@fluid-internal/tree: warning:   expect: npm run prettier:fix && npm run eslint:fix
@fluid-internal/tree: warning:   actual: npm run eslint:fix

daesun-park avatar Sep 15 '22 18:09 daesun-park

I removed the prettier from the lint command, and checked npm run build:fast to see if there were any additional warnings. Aside from some "non-conformant script" warnings (which should go away when we add the prettier back to the lint commands), there were no additional warnings.

@fluid-internal/tree: warning: non-conformant script "lint"
@fluid-internal/tree: warning:   expect: npm run prettier && npm run eslint
@fluid-internal/tree: warning:   actual: npm run eslint
@fluid-internal/tree: warning: non-conformant script "lint:fix"
@fluid-internal/tree: warning:   expect: npm run prettier:fix && npm run eslint:fix
@fluid-internal/tree: warning:   actual: npm run eslint:fix

I assumed this cause a warning: looks like I was wrong! Searching fluid-build for "prettier" shows it detects prettier use by searching the package for a script named "prettier". Since that script won't pass until all the formatting is done anyway, I guess we can just remove that one for now, and confirm that fixes the warnings, and add it back in when enabling enforcement of prettier formatting.

We should be able to keep the prettier:fix script, which will be useful during the migration.

CraigMacomber avatar Sep 15 '22 18:09 CraigMacomber

This commit is queued for merging with the next branch! Please ignore this PR for now. Contact @microsoft/fluid-cr-infra for help.

github-actions[bot] avatar Sep 26 '22 18:09 github-actions[bot]