FriendsOfFlarum / terms

Ask your users to accept TOS and Privacy Policy
https://discuss.flarum.org/d/11714
MIT License
14 stars 9 forks source link

Exported things for extensibility (& added linting with prettier) #23

Closed iPurpl3x closed 3 years ago

iPurpl3x commented 3 years ago

@clarkwinkelmann Sure I can do that. I just thought that taking the config from another FoF extension and formatting the code here would be OK, but whatever.

luceos commented 3 years ago

@iPurpl3x even though fof extensions all fall under the same group, most of them are often still individually maintained. The intent is that multiple people can maintain them should the need arise (my extensions being a great example).

@clarkwinkelmann I would prefer having team wide conventions, not sure if we could enforce most through the github global team repository? (cc @datitisev)

clarkwinkelmann commented 3 years ago

We had a quick chat in the Discord server yesterday and you're right, the prettier config you used is the one we decided to use internally.

However we have not yet used it on any of the extensions originally created by myself, and I only realize now that the formatting doesn't play very nice with my personal preference of not using JSX and instead using m() / plain javascript objects for the templates. Prettier adds a ton of whitespace and newlines which defeat the compactness of using m() IMO.

I'd need to check whether there's a config for Prettier that allows keeping more things on their own lines as to not lose the compact templates. Or we should convert everything to JSX, but I'm personally not a fan of JSX.

I do think we should have a single prettier config for all our repos. But right now there's also that big difference between extensions that use JSX, those that don't, and those that have a strange hybrid solution. And soon there will probably be even more differences with typescript...

clarkwinkelmann commented 3 years ago

I cherry-picked 9bf04bcb887ee3f30c3a569e0e4d06ee7d588949 into the latest release, thanks for the help :+1: