inveniosoftware / react-invenio-app-ils

Single Page App built with React for InvenioILS.
https://react-invenio-app-ils.readthedocs.io
MIT License
5 stars 19 forks source link

linter: allow expressions in JSX fragment #621

Closed ptamarit closed 4 months ago

ptamarit commented 5 months ago

:heart: 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 commented 4 months ago

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: https://github.com/inveniosoftware/invenio-app-rdm/pull/2662/commits/59bfa2b65e7dfc10a238765c77541a8f548677b9