Skip to content

Conversation

@BPScott
Copy link
Member

@BPScott BPScott commented Sep 3, 2019

WHY are these changes introduced?

This version of prettier formats hooks a bit more cleanly which is handy
as we're going to be using them a lot

WHAT is this pull request doing?

Updates to latest prettier, and runs yarn run format over the content.
One manual fix to Sheet.tsx had to be applied as prettier's formatting and ignoring the exhaustive-deps check didn't play nice.

Tophatting

  • Check lint/tests pass
  • Review code while supressing whitespace-only changes to make it easier to review (a bit over half of this PR is whitespace changes)

This version of prettier formats hooks a bit more cleanly which is handy
as we're going to be using them a lot
// eslint-disable-next-line react-hooks/exhaustive-deps
[],
);
// eslint-disable react-hooks/exhaustive-deps
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's the issue here? can you disable prettier instead? I'd feel better disabling the styling tool than the linter

Copy link
Member Author

@BPScott BPScott Sep 3, 2019

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We were originally disabling the react-hooks/exhaustive-deps rule because we were explictly saying the dependency array is empty, while linting things it should contain handleResize and prettier didn't like having that disable-next-line comment in the middle of the code.

It looks like vscode not spotting linting config updates means the handleResize had snuck back in when I wasn't looking. After a vscode restart it seems like we can keep to ignoring the exhaustive deps rule without using the block formatting - I've pushed a new commit to fix this up.


Not specifying this feels like a potential subtle bug but I'd like to keep this PR focused on formatting updates only

@BPScott BPScott merged commit b383b9a into master Sep 3, 2019
@BPScott BPScott deleted the prettier-bump branch September 3, 2019 18:58
chloerice pushed a commit that referenced this pull request Sep 6, 2019
This version of prettier formats hooks a bit more cleanly which is handy
as we're going to be using them a lot
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants