Skip to content

NXT-10859: Adapted code for eslint 10 - #877

Open
daniel-stoian-lgp wants to merge 3 commits into
developfrom
feature/NXT-10859
Open

daniel-stoian-lgp wants to merge 3 commits into
developfrom
feature/NXT-10859

Conversation

@daniel-stoian-lgp

Copy link
Copy Markdown
Contributor

Checklist

  • I have read and understand the contribution guide
  • A CHANGELOG entry is included
  • At least one test case is included for this feature or bug fix
  • I have run automated testing and it is passed
  • Documentation was added or is not needed
  • This is an API breaking change

Issue Resolved / Feature Added

Fixed the lint errors and warnings reported by the ESLint 10 version of eslint-config-enact.

Resolution

react/no-access-state-in-setstate

  • MediaPlayer/MediaPlayer.js: handleShuffle read the current media from this.state before calling setState and used it inside the updater, where it could be stale. The updater now reads playlist and sourceIndex from its state argument, and the post-update logic moved to a handleShuffleUpdated method. Enabling shuffle only changes shuffle, so the same media is passed to shufflePlaylist.

no-useless-assignment (new in ESLint 10's recommended rules)

  • ContextualPopupDecorator/ContextualPopupDecorator.js (direction), TooltipDecorator/TooltipDecorator.js (tooltipDirection, arrowAnchor): removed initial values that are always overwritten.
  • useScroll/useEvent.js: direction was assigned in the arrow-key branch but never read. It is now a const scoped to the page-key branch. Also removed the initial values of scrollPossible and y.
  • samples/qa-virtualgridlist/src/store/index.js: removed dead newDataOrder = state.dataOrder.

no-use-before-define (ESLint 10 tracks JSX references)

  • tests/ui/apps/VirtualList/VirtualList/VirtualList-View.js: moved StatefulSwitchItem above renderItem, which uses it. The class itself is unchanged.

Unused disable directives

  • samples/sampler/src/ThemeEnvironment/ThemeEnvironment.js: removed two react/sort-prop-types disable comments. The rule has no replacement in the ESLint 10 config and no longer reports anything.

Additional Considerations

Links

NXT-10859

Comments

Enact-DCO-1.0-Signed-off-by: Daniel Stoian (daniel.stoian@lgepartner.com)

@codecov

codecov Bot commented Oct 5, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 85.58%. Comparing base (cdeceeb) to head (009b56c).

Additional details and impacted files
@@             Coverage Diff             @@
##           develop     #877      +/-   ##
===========================================
- Coverage    85.60%   85.58%   -0.03%     
===========================================
  Files          118      118              
  Lines         4495     4488       -7     
  Branches      1226     1226              
===========================================
- Hits          3848     3841       -7     
  Misses         503      503              
  Partials       144      144              

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

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

This branch has not been deployed

No deployments
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.

2 participants