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

front: add eslint rule to ban React.FC #8664

Merged
merged 1 commit into from
Sep 3, 2024

Conversation

clarani
Copy link
Contributor

@clarani clarani commented Aug 30, 2024

closes #8663

@clarani clarani requested a review from a team as a code owner August 30, 2024 16:17
@codecov-commenter
Copy link

codecov-commenter commented Aug 30, 2024

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

Attention: Patch coverage is 11.55556% with 199 lines in your changes missing coverage. Please review.

Project coverage is 36.83%. Comparing base (074ce44) to head (9655fc9).
Report is 15 commits behind head on dev.

Files with missing lines Patch % Lines
...r/tools/pointEdition/components/CustomPosition.tsx 0.00% 16 Missing ⚠️
...src/applications/editor/components/EntitySumUp.tsx 0.00% 10 Missing and 1 partial ⚠️
front/src/common/BootstrapSNCF/DropdownSNCF.tsx 0.00% 10 Missing and 1 partial ⚠️
...or/tools/routeEdition/components/RouteMetadata.tsx 0.00% 9 Missing and 1 partial ⚠️
front/src/common/Map/WarpedMap/WarpedMap.tsx 0.00% 9 Missing and 1 partial ⚠️
...editor/tools/routeEdition/components/EndPoints.tsx 0.00% 8 Missing and 1 partial ⚠️
...tor/tools/rangeEdition/speedSection/SpeedInput.tsx 0.00% 6 Missing and 1 partial ⚠️
...ront/src/common/Map/Settings/MapSettingsLayers.tsx 0.00% 6 Missing and 1 partial ⚠️
...mon/Map/Settings/MapSettingsBackgroundSwitches.tsx 0.00% 5 Missing and 1 partial ⚠️
...or/components/InfraErrors/InfraErrorMapControl.tsx 0.00% 4 Missing and 1 partial ⚠️
... and 53 more

❗ Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files
@@             Coverage Diff              @@
##                dev    #8664      +/-   ##
============================================
- Coverage     36.87%   36.83%   -0.05%     
- Complexity     2177     2217      +40     
============================================
  Files          1255     1255              
  Lines        113719   113832     +113     
  Branches       3203     3187      -16     
============================================
- Hits          41938    41931       -7     
- Misses        69886    70009     +123     
+ Partials       1895     1892       -3     
Flag Coverage Δ
core 74.77% <ø> (-0.03%) ⬇️
editoast 71.72% <ø> (-0.02%) ⬇️
front 14.93% <11.55%> (-0.03%) ⬇️
gateway 2.20% <ø> (ø)
osrdyne 2.71% <ø> (ø)
railjson_generator 87.49% <ø> (ø)
tests 86.45% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

Copy link
Member

@emersion emersion left a comment

Choose a reason for hiding this comment

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

Nice!

Copy link
Contributor

@SharglutDev SharglutDev left a comment

Choose a reason for hiding this comment

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

Thank you for this PR ! The eslint config doesn't catch type FC in import React (FC is still there in all IncompatibleConstraints components)

@emersion emersion self-assigned this Sep 2, 2024
Copy link
Contributor

@Caracol3 Caracol3 left a comment

Choose a reason for hiding this comment

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

Lgtm

@emersion emersion force-pushed the cni/8663-ban-react-fc-eslint branch from 7e37183 to 9655fc9 Compare September 2, 2024 13:37
@emersion
Copy link
Member

emersion commented Sep 2, 2024

Thank you for this PR ! The eslint config doesn't catch type FC in import React (FC is still there in all IncompatibleConstraints components)

Indeed! Added a rule for lone FC and dropped all remaining references (there were quite a few... !).

@emersion emersion requested a review from SharglutDev September 2, 2024 13:38
Copy link
Contributor

@SharglutDev SharglutDev left a comment

Choose a reason for hiding this comment

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

Lgtm, thank you for the follow up @emersion :)

@SharglutDev SharglutDev added this pull request to the merge queue Sep 3, 2024
Merged via the queue into dev with commit e4e2738 Sep 3, 2024
22 checks passed
@SharglutDev SharglutDev deleted the cni/8663-ban-react-fc-eslint branch September 3, 2024 07:32
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.

front: add an eslint rule to ban the React.FC
5 participants