Skip to content

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

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

daniel-stoian-lgp wants to merge 7 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 and eslint-plugin-react-hooks 7.1.1.

Resolution

no-useless-assignment (new in ESLint 10's recommended rules): removed initial values that are always overwritten before being read

  • core/handle/handle.js (result), i18n/src/zoneinfo.js (mid), spotlight/Accelerator/Accelerator.js (toSkip)
  • ui/Touchable/Drag.js, ui/Touchable/Pinch.js (bounds), ui/useScroll/useScroll.js (overDistance)
  • ui/VirtualList/VirtualListBasic.js (offset, newFirstIndex, newThresholdMin, newThresholdMax)

react/no-children-prop

  • ui/Transition/Transition.js: children is passed as JSX children of TransitionBase instead of through the spread childProps. children was already excluded from rest, so the rendered output is the same.

max-nested-callbacks

  • i18n/Text/Text.js: moved the reduce in the setMap updater to a module-level translateTextMap() helper (same behavior).

React Compiler rules (eslint-plugin-react-hooks 7.1.1)

  • core/useChainRefs/useChainRefs.js: added react-hooks/use-memo to the existing exhaustive-deps disable comment. The hook memoizes on a variable list of refs, so the dependency list cannot be an array literal.
  • sampler/stories/default/ResolutionDecorator.js: disabled react-hooks/static-components for the story's <View>. The story re-decorates the component from the controls on purpose; the existing comment explains why.

Unused disable directives (reported with --report-unused-disable-directives)

  • Removed react/forbid-foreign-prop-types (core/kind/kind.js, core/kind/functionalKind.js, core/util/util.js) and react/sort-prop-types (ui/Changeable/Changeable.js). These rules have no replacement in the ESLint 10 config and no longer report anything.
  • Removed react-hooks/refs in ui/Toggleable/Toggleable.js, which eslint-plugin-react-hooks 7.1.1 no longer reports.

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 86.33%. Comparing base (695f09d) to head (33f9bb9).
⚠️ Report is 3 commits behind head on develop.

Additional details and impacted files
@@           Coverage Diff            @@
##           develop    #3464   +/-   ##
========================================
  Coverage    86.33%   86.33%           
========================================
  Files          156      156           
  Lines         7623     7616    -7     
  Branches      2015     2015           
========================================
- Hits          6581     6575    -6     
+ Misses         831      830    -1     
  Partials       211      211           

☔ 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.

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