impress-org / givewp

GiveWP - The #1 Donation Plugin for WordPress. Easily accept donations and fundraise using your WordPress website.
https://givewp.com/
GNU General Public License v3.0
344 stars 191 forks source link

Enforce coding standards on importing from @wordpress/element instead of react #6988

Open pauloiankoski opened 1 year ago

pauloiankoski commented 1 year ago

Details

In our recent discussion, it was pointed out that our project has inconsistent import statements when it comes to React components. Some parts of our code import from the react package while others import from @wordpress/element. Given that we are using wp-scripts to build our project and WordPress handles these packages for us, it seems more appropriate to import from @wordpress/element.

Reference discussion: https://lw.slack.com/archives/C04SLRDD9CK/p1696274616679709

Points highlighted from the discussion:

We need to decide on a standard and enforce it to maintain consistency across our codebase. It might require some research on how to set up linting rules or PhpStorm configurations to ensure we adhere to this standard.

kjohnson commented 1 year ago

Related reading: https://github.com/woocommerce/woocommerce/issues/37503