codebuddies / cb-connect

Platform to connect mentors with mentees, accountability partners, and OS project maintainers with new contributors
GNU General Public License v3.0
14 stars 8 forks source link

Add prop validations through prop-types to our React Components #65

Closed angelocordon closed 5 years ago

angelocordon commented 5 years ago

Currently we have 31 warnings on missing prop validations. To follow modern best practices when composing React components, we should include prop types in our components (both for documentation purposes and type checking; will help us improve our tests).

To see all components with missing prop types, run meteor npx lint in your terminal and it should return you a similar list of warnings:

image

The goal of this issue is to reduce the list down to 0.

For reference, see: https://github.com/yannickcr/eslint-plugin-react/blob/master/docs/rules/prop-types.md https://reactjs.org/docs/typechecking-with-proptypes.html https://www.npmjs.com/package/prop-types

lpatmo commented 5 years ago

Word. Thanks for flagging! We should be using the prop-types library, right?

angelocordon commented 5 years ago

Yup! I believe as of React 15, it's now a separate library.

Dan-Y-Ko commented 5 years ago

why not just use typescript? :D

angelocordon commented 5 years ago

I thought about switching over to TSX, but I think that might add another barrier for entry to other contributors. I'd like to keep our prerequisites as low as possible.

We could potentially add Flow down the line as that can be a bit more optional, but for now this seems like the correct path to go on in our current state.

angelocordon commented 5 years ago

Assigned to @mcsmithers