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

frontend: make styling consistent and remove dead code #394

Merged
merged 5 commits into from
Apr 5, 2023

Conversation

AmrSaber
Copy link
Contributor

Feature or Bug-fix

  • Refactoring

Details

This PR does 2 things:

  • Makes the styling consistent across the project
  • Removes dead code (unused variables, functions, and imports)

This is done through eslint rules, I noticed that the project has prettier rules and uses prettier, but the rules were not in sync with eslint and were not enforced, so the styling was in consistent. So for this matter I configured eslint to enforce prettier rules so that the styling is consistent. And that's what the first commit does, there are no code changes what so ever in it, just styling updates.

For the second commit, I removed all unused variables, functions, and imports, there is also no logic changes, only removing the unused parts.

The third commit removes == in favour of === as this may cause some unintentional bugs (see this stackoverflow question).

The last commit is the actual configuration enforcing all the rules -- this commit is at the end not the beginning because the configuration kept changing until I reached the final state, and I didn't want to pollute the PR with a lot of configuration commits.

As stated, the PR's commits are meaningful and I recommend reviewing the PR by going through each commit individually


By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@AmrSaber AmrSaber changed the title Frontend/update lint frontend: make styling consistent and remove dead code Mar 30, 2023
{`Pending items: ${share.statistics.pendingItems}`}
</Typography>
</Box>
<Box
Copy link
Contributor

Choose a reason for hiding this comment

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

This code is identical to frontend/src/views/Shares/ShareInboxListItem.js. Let's extract it into dedicated form

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Refactoring and moving parts around will come in the subsequent PRs, I want this PR to be free from any logic so that it's easy to review and can be merged quickly. But I noted the comment and will apply it when working on the refactoring.

@AmrSaber AmrSaber requested a review from dlpzx March 31, 2023 08:46
@AmrSaber AmrSaber merged commit fefc45c into modularization-main Apr 5, 2023
@AmrSaber AmrSaber deleted the frontend/update-lint branch April 5, 2023 14:27
dlpzx pushed a commit that referenced this pull request Apr 11, 2023
### Feature or Bug-fix
- Refactoring

### Detail
My recent PR #394 has a lot
of changes but all of these changes are to styles only and not the code
itself, this way the blame history for all the changed files is lost (it
will always blame me).

This PR adds the file`.git-blame-ignore-revs` which contains the id of
the styling commit and the command that you need to run once to fix the
blame history for you.

Also Github understands that file and will show the history correctly.

This PR is based on [this
article](https://www.stefanjudis.com/today-i-learned/how-to-exclude-commits-from-git-blame/)
and is suggested by Raul.

This file works for the whole repository, and in the future one only
needs to add ids of styling commits and the history will be preserved
correctly.

---
By submitting this pull request, I confirm that my contribution is made
under the terms of the Apache 2.0 license.
dlpzx pushed a commit to dlpzx/aws-dataall that referenced this pull request May 25, 2023
)

### Feature or Bug-fix
- Refactoring

### Details
This PR does 2 things:
- Makes the styling consistent across the project
- Removes dead code (unused variables, functions, and imports)

---
By submitting this pull request, I confirm that my contribution is made
under the terms of the Apache 2.0 license.
dlpzx pushed a commit to dlpzx/aws-dataall that referenced this pull request May 25, 2023
### Feature or Bug-fix
- Refactoring

### Detail
My recent PR data-dot-all#394 has a lot
of changes but all of these changes are to styles only and not the code
itself, this way the blame history for all the changed files is lost (it
will always blame me).

This PR adds the file`.git-blame-ignore-revs` which contains the id of
the styling commit and the command that you need to run once to fix the
blame history for you.

Also Github understands that file and will show the history correctly.

This PR is based on [this
article](https://www.stefanjudis.com/today-i-learned/how-to-exclude-commits-from-git-blame/)
and is suggested by Raul.

This file works for the whole repository, and in the future one only
needs to add ids of styling commits and the history will be preserved
correctly.

---
By submitting this pull request, I confirm that my contribution is made
under the terms of the Apache 2.0 license.
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.

3 participants