Skip to content

chore: enforce arrow style functions#2149

Merged
chrismclarke merged 6 commits intomasterfrom
chore/enforce-arrow-style-functions
Mar 22, 2023
Merged

chore: enforce arrow style functions#2149
chrismclarke merged 6 commits intomasterfrom
chore/enforce-arrow-style-functions

Conversation

@thisislawatts
Copy link
Contributor

@thisislawatts thisislawatts commented Mar 19, 2023

PR Checklist

PR Type

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)
  • Developer experience (improves developer workflows for contributing to the project)

Description

An exploration at using automation to standardise on arrow style function declaration. Based on the following comment in another PR.

Suggestion (not-blocking) : Could change this to be an arrow function to be in line with the other functions
#2133 (comment)


What happens next?

Thanks for the contribution! We try to make sure all PRs are reviewed ahead of a monthly dev call (first Monday of the month, open to all!).

If the PR is working as intended it'll be merged and included in the next platform release, if not changes will be requested and re-reviewed once updated.

If you need more immediate feedback you can try reaching out on Discord in the Community Platform development channel.

@thisislawatts thisislawatts force-pushed the chore/enforce-arrow-style-functions branch from 02bb55f to 52454b9 Compare March 19, 2023 20:35
@thisislawatts thisislawatts mentioned this pull request Mar 19, 2023
9 tasks
@cypress
Copy link

cypress bot commented Mar 19, 2023

1 flaky tests on run #3069 ↗︎

0 78 3 0 Flakiness 1

Details:

Merge branch 'master' of https://github.com/ONEARMY/community-platform into chor...
Project: onearmy-community-platform Commit: 5d98bf4078
Status: Passed Duration: 03:29 💡
Started: Mar 22, 2023 2:41 PM Ended: Mar 22, 2023 2:45 PM
Flakiness  src/integration/common.spec.ts • 1 flaky test • ci-chrome

View Output Video

Test Artifacts
[Common] > [User Menu] > [By Authenticated] Output Screenshots

This comment has been generated by cypress-bot as a result of this project's GitHub integration settings.

@thisislawatts thisislawatts marked this pull request as ready for review March 19, 2023 20:52
@thisislawatts thisislawatts requested a review from a team as a code owner March 19, 2023 20:52
Copy link
Contributor

@AlfonsoGhislieri AlfonsoGhislieri left a comment

Choose a reason for hiding this comment

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

Praise @thisislawatts this was so satisfying to look at! Looks good to me 👍🏻

The only thing I was worried about was the implicit returns like mentioned here, but it seems that all the non one liners are wrapped in parathenses which should not cause any issues.

Copy link
Member

@chrismclarke chrismclarke left a comment

Choose a reason for hiding this comment

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

Looks good to me also, I similarly took a quick google of any use-cases when it might be better to keep function notation and couldn't find any examples in the changes mentioned so say should be good to go once conflicts resolved (will take a quick look)
https://www.javascripttutorial.net/es6/when-you-should-not-use-arrow-functions

@thisislawatts
Copy link
Contributor Author

thisislawatts commented Mar 22, 2023

Thanks @chrismclarke, I think the quickest way to do this would be drop 52454b9, then rebase against master addressing any merge conflicts on .eslintrc.json and then run yarn format which will apply all of the necessary changes.

@chrismclarke
Copy link
Member

I think the quickest way to do this would be drop 52454b9, then rebase against master addressing any merge conflicts on .eslintrc.json and then run yarn format which will apply all of the necessary changes.

Dropping commits extends a bit beyond my git-foo, so for now I've just manually resolved for a second time (expect a few minor conflicts like this as trying to get more of the backlog merged in) - cool to know it auto-formats the rule though, I've just re-run on the merged branch and no new changes detected so will merge ahead of other PRs once tests complete

@chrismclarke chrismclarke merged commit 315de33 into master Mar 22, 2023
@chrismclarke chrismclarke deleted the chore/enforce-arrow-style-functions branch March 22, 2023 14:47
@cypress cypress bot mentioned this pull request Mar 22, 2023
@onearmy-bot
Copy link
Collaborator

🎉 This PR is included in version 1.41.0 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Archived in project

Development

Successfully merging this pull request may close these issues.

4 participants