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

[SUGGESTION]: Improve ESLint configs to sort props #377

Merged
merged 2 commits into from
Aug 2, 2022

Conversation

dsousa12
Copy link
Contributor

@dsousa12 dsousa12 commented Jul 26, 2022

Relates to #376

Proposed Changes

With this changes, a component/element props will be sort using rules like:

  • Callbacks and multi-line props by last;
  • key prop as first;
  • Sort other props alphabetically;
  • Short hands props as first props too.
    • Example: if isActive prop is a boolean value, to set as true you can do it two ways: isActive={true} or isActive. When you use the second way (the short way), this props are show first (after the key prop).

Note:
The change is on .eslintrc.js, but to fix the errors, I need to format every file, so the 89 files are only formatted to fix the sorting error.

This pull request closes #376

@dsousa12 dsousa12 added enhancement New feature or request frontend labels Jul 26, 2022
@dsousa12 dsousa12 requested review from nunocaseiro and a team July 26, 2022 20:50
@dsousa12 dsousa12 linked an issue Jul 26, 2022 that may be closed by this pull request
@dsousa12 dsousa12 self-assigned this Jul 26, 2022
Copy link
Contributor

@joaosantos99 joaosantos99 left a comment

Choose a reason for hiding this comment

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

LGTM 🚀

@dsousa12 dsousa12 merged commit 9e423dd into main Aug 2, 2022
@dsousa12 dsousa12 deleted the feat/eslint-sort-props branch August 2, 2022 10:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request frontend
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

[SUGGESTION]: Improve ESLint configs to sort props
2 participants