Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add eslint rule that sorts keys in objects and props #55

Merged
merged 6 commits into from Dec 5, 2023
Merged

add eslint rule that sorts keys in objects and props #55

merged 6 commits into from Dec 5, 2023

Conversation

avelynhc
Copy link
Contributor

@avelynhc avelynhc commented Dec 2, 2023

resolves #39

  • instead of using prettier, new eslint rule is added to sort any keys in objects and props
  • examples of unsorted prop
Screenshot 2023-12-01 at 6 51 06 PM
  • unsorted props will give you an error.
Screenshot 2023-12-01 at 6 51 12 PM
  • With the help of command, npm run fix, it will automatically sort everything as expected.
Screenshot 2023-12-01 at 7 18 49 PM
  • after the fix, there is no error.
Screenshot 2023-12-01 at 7 19 06 PM

@atb-brown atb-brown changed the base branch from main to pull-request-staging December 5, 2023 02:31
@atb-brown
Copy link
Owner

This is great! Thank you! :)

I changed the target branch so that I can fix up some of the conflict issues that I caused.

@atb-brown atb-brown merged commit cd959bc into atb-brown:pull-request-staging Dec 5, 2023
1 check passed
@avelynhc avelynhc deleted the issue-39 branch December 5, 2023 02:36
@atb-brown atb-brown mentioned this pull request Dec 5, 2023
atb-brown added a commit that referenced this pull request Dec 5, 2023
* add eslint rule that sorts keys in objects and props (#55)

* added rule to sort component in ascending order

* installed eslint-plugin-sort-keys-fix to enforce eslint rule that sorts keys in object

* installed eslint-plugin-sort-keys-fix to enforce eslint rule that sorts keys in object

* added script to fix the linting problem with the single command

* files formatted due to changes in eslint rule

---------

Co-authored-by: Austin Brown <atb.austin@gmail.com>

* Resolve Discrepancies

---------

Co-authored-by: Avelyn Hyunjeong Choi <75185537+avelynhc@users.noreply.github.com>
Co-authored-by: atb-brown <austin.brown@wealthcounsel.com>
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.

Prettier Rule for React Component Property Sorting
2 participants