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

linter: allow expressions in JSX fragment #621

Conversation

ptamarit
Copy link
Member

@ptamarit ptamarit commented Apr 26, 2024

❤️ Thank you for your contribution!

Description

We get quite a lot of ESLint warnings across inveniosoftware repositories for following the pattern <>{foo}</>.
There are a few places were we explicitly inline-disable the check, and other places were we ignore the warning.

This pull request proposes to relax this ESLint rule to allow this pattern (see the react/jsx-no-useless-fragment documentation).
If you agree with it, I will apply this change to:

Checklist

Ticks in all boxes and 🟢 on all GitHub actions status checks are required to merge:

Frontend

Reminder

By using GitHub, you have already agreed to the GitHub’s Terms of Service including that:

  1. You license your contribution under the same terms as the current repository’s license.
  2. You agree that you have the right to license your contribution under the current repository’s license.

@ptamarit
Copy link
Member Author

After some discussion, we decided that we should fix these useless fragment problems instead of relaxing the ESLint rule.
FYI, an example of how to fix the useless fragment problems can be found here: inveniosoftware/invenio-app-rdm@59bfa2b

@ptamarit ptamarit closed this May 17, 2024
@ptamarit ptamarit deleted the eslint-jsx-fragment-allow-expressions branch May 17, 2024 08:27
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.

None yet

2 participants