Skip to content

Conversation

@newswim
Copy link
Collaborator

@newswim newswim commented Feb 17, 2019

Summary

VS Code was yelling at me about ESLint not being found. I had installed the Prettier extension and noticed some of the code wasn't getting formatted correctly. Those issues seem to be resolved with these changes. I followed Prettier's recommendations for integrating with ESLint.

Also I wanted to try out the new eslint rule that will check react hooks.. haven't been able to get the warnings to display yet, so maybe we should wait to merge this until I can get it working.

Links

eslint-plugin-react-hooks
using Prettier alongside ESLint

@newswim newswim requested a review from pwcsquared February 17, 2019 17:12
@newswim newswim marked this pull request as ready for review February 17, 2019 18:26

export const aberrationRatio = (rect: Rect, height: number, amt: number) =>
(height - rect.top - rect.bottom) / height * amt;
((height - rect.top - rect.bottom) / height) * amt
Copy link
Contributor

Choose a reason for hiding this comment

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

lol

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

lol, prettier did that!

const { height } = useWindowSize();
const [rect, setRect] = useState({top: 0, bottom: 0});
const [ratio, setRatio] = useState(0);
const Aberration: FunctionComponent<{ text?: string }> = ({ text }) => {
Copy link
Contributor

Choose a reason for hiding this comment

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

Is importing FunctionComponent from react a special typescript thing?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Yep, that's the type for a function component. It used to be SFC but that name was deprecated since "stateless functional component" was kind of a misnomer, given function components can now have state, with hooks!

@pwcsquared
Copy link
Contributor

Looks good! Let's revisit eslint later.

@newswim newswim merged commit 20ba1f9 into master Feb 22, 2019
@newswim newswim deleted the feature/add-prettier branch February 22, 2019 04:47
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.

3 participants