Skip to content

Fix: AbsoluteCellRange.ts JSDoc lint errors on Node 22#1680

Open
marcin-kordas-hoc wants to merge 2 commits into
developfrom
fix/absolutecellrange-jsdoc-node22
Open

Fix: AbsoluteCellRange.ts JSDoc lint errors on Node 22#1680
marcin-kordas-hoc wants to merge 2 commits into
developfrom
fix/absolutecellrange-jsdoc-node22

Conversation

@marcin-kordas-hoc
Copy link
Copy Markdown
Collaborator

@marcin-kordas-hoc marcin-kordas-hoc commented May 25, 2026

Summary

Adds missing JSDoc blocks to every class, method, getter, and exported helper in src/AbsoluteCellRange.ts, clearing all 68 jsdoc/require-jsdoc warnings surfaced by ESLint on Node 22. JSDoc-only diff — no runtime behavior changes.

Scoped to this single file to stay orthogonal to other in-flight work (e.g. PR #1665).

Lint counts (npm run lint -- src/AbsoluteCellRange.ts)

Warnings on src/AbsoluteCellRange.ts Repo-wide total
Before 68 2169
After 0 2100

All 68 disappeared warnings are jsdoc/require-jsdoc (no errors before or after; no other rule classes touched).

Fixes (one-liner each)

  • simpleCellRange helper — JSDoc with @param / @returns.
  • AbsoluteCellRange class header + sheet getter.
  • Constructor: start, end.
  • Static factories: fromSimpleCellAddresses, fromAst, fromAstOrUndef, fromCellRange, spanFrom, spanFromOrUndef, fromCoordinates.
  • Predicates: isFinite, doesOverlap, addressInRange, columnInRange, rowInRange, containsRange, includesRow, includesColumn, shouldBeRemoved, exceedsSheetSizeLimits, sameDimensionsAs, sameAs.
  • Geometry / shift / span: intersectionWith, shiftByRows, shiftByColumns, expandByRows, expandByColumns, shifted, moveToSheet, removeSpan, rangeWithSameWidth, rangeWithSameHeight, withStart, width, height, size, toString.
  • Iteration / addresses: arrayOfAddressesInRange, addressesArrayMap (@template T), addresses, addressesWithDirection (@yields), getAddress.
  • Effective bounds: effectiveEndColumn, effectiveEndRow, effectiveWidth, effectiveHeight.
  • Mutators: removeRows, removeColumns.
  • AbsoluteColumnRange class header + ctor + fromColumnRange + overrides (shouldBeRemoved, shiftByRows, expandByRows, shifted, rangeWithSameHeight, exceedsSheetSizeLimits, effectiveEndRow, effectiveHeight, removeRows).
  • AbsoluteRowRange class header + ctor + fromRowRangeAst + overrides (shouldBeRemoved, shiftByColumns, expandByColumns, shifted, rangeWithSameWidth, exceedsSheetSizeLimits, effectiveEndColumn, effectiveWidth, removeColumns).

Tests

npm run test:jest -- --testPathPattern="(AbsoluteCellRange|range-mapping|row-range|column-range|ranges|range-vertex|range-offset|generate-cells-range)"

Test Suites: 8 passed, 8 total
Tests:       61 passed, 61 total

Includes the dedicated test/hyperformula-tests/unit/AbsoluteCellRange.spec.ts. npx tsc --noEmit also passes — JSDoc edits compile cleanly.

eslint-disable lines added

None. All 68 findings were fixable with proper JSDoc blocks.

Notes

  • Surgical manual edits only — no eslint --fix run on the file or repo.
  • No runtime code touched.
  • No CHANGELOG entry (lint/docs hygiene only).

Note

Low Risk
Comment-only documentation in a single core range module; existing Jest range tests still pass and behavior is unchanged.

Overview
Adds JSDoc across src/AbsoluteCellRange.ts so ESLint’s jsdoc/require-jsdoc passes on Node 22—68 warnings cleared in that file with no intended behavior change.

Coverage includes the simpleCellRange helper, AbsoluteCellRange (class, constructor, sheet getter, static factories, geometry/overlap/containment, mutation and iteration APIs, effective bounds), and subclasses AbsoluteColumnRange / AbsoluteRowRange (including overrides where row/column shifts or removals are no-ops). Blocks use @param, @returns, @template, @yields, and {@link …} where appropriate.

The only non-comment tweak in the diff is renaming an unused parameter in AbsoluteRowRange.shifted to _byCols (documentation/lint hygiene, not logic).

Reviewed by Cursor Bugbot for commit 85fc91c. Bugbot is set up for automated code reviews on this repo. Configure here.


Update (follow-up review): a prep-full audit caught an A5 "stale body" finding — the original "No runtime code touched" framing was imprecise. The follow-up fix commit (85fc91c0c) renamed byCols_byCols on AbsoluteRowRange.shifted to match the sibling _byRows. This is a parameter-name edit visible in published .d.ts typings (TS treats _x: number and x: number as the same call signature, but the typings text differs). No behavioral change; the parameter is unused in both forms. See also the codecov correction comment.

Add missing JSDoc blocks to every class, method, and getter in
src/AbsoluteCellRange.ts to clear all 68 jsdoc/require-jsdoc warnings
that surface when running the linter against this file. JSDoc-only
changes - no runtime behavior altered.

Coverage:
- AbsoluteCellRange class + 5 static factories + 33 instance/protected methods + sheet getter
- AbsoluteColumnRange class + ctor + static factory + 9 overrides
- AbsoluteRowRange class + ctor + static factory + 9 overrides
- Top-level simpleCellRange helper

Before: 68 jsdoc/require-jsdoc warnings on src/AbsoluteCellRange.ts
After: 0 warnings on src/AbsoluteCellRange.ts (repo-wide: 2169 -> 2100)

Tests: 8 range-related test suites pass (61 tests), including the
dedicated AbsoluteCellRange.spec.ts in hyperformula-tests.
@netlify
Copy link
Copy Markdown

netlify Bot commented May 25, 2026

Deploy Preview for hyperformula-dev-docs ready!

Name Link
🔨 Latest commit 85fc91c
🔍 Latest deploy log https://app.netlify.com/projects/hyperformula-dev-docs/deploys/6a144c6eab0ec700085af206
😎 Deploy Preview https://deploy-preview-1680--hyperformula-dev-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@netlify
Copy link
Copy Markdown

netlify Bot commented May 25, 2026

Deploy Preview for hyperformula-docs ready!

Name Link
🔨 Latest commit 85b58bd
🔍 Latest deploy log https://app.netlify.com/projects/hyperformula-docs/deploys/6a140be92598f50008b01bbb
😎 Deploy Preview https://deploy-preview-1680--hyperformula-docs.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@github-actions
Copy link
Copy Markdown

github-actions Bot commented May 25, 2026

Performance comparison of head (85fc91c) vs base (508d78f)

                                     testName |   base |   head | change
------------------------------------------------------------------------
                                      Sheet A | 500.34 | 497.05 | -0.66%
                                      Sheet B |  155.6 | 157.11 | +0.97%
                                      Sheet T | 144.09 | 136.97 | -4.94%
                                Column ranges | 472.94 | 471.03 | -0.40%
Sheet A:  change value, add/remove row/column |  15.14 |  15.39 | +1.65%
 Sheet B: change value, add/remove row/column | 135.15 |  129.2 | -4.40%
                   Column ranges - add column | 150.76 | 146.47 | -2.85%
                Column ranges - without batch | 460.43 |  447.8 | -2.74%
                        Column ranges - batch | 116.61 | 114.91 | -1.46%

…tency

Two prep-review follow-ups on src/AbsoluteCellRange.ts:

- includesRow JSDoc first sentence was inverted relative to the code. Code
  is `start.row < row && end.row >= row` (strict on the top edge, inclusive
  on the bottom edge), mirroring the sibling includesColumn pattern
  ("strictly right of the left edge and at or before the right edge").
  Updated wording to match.
- AbsoluteRowRange.shifted's unused `byCols` parameter now uses the `_`
  prefix (`_byCols`), aligning with AbsoluteColumnRange.shifted's existing
  `_byRows` and ESLint's argsIgnorePattern convention.

Stays JSDoc-only / param-rename; no runtime behavior change.

Out-of-scope: factory-method naming asymmetry (`fromColumnRange` vs
`fromRowRangeAst`) is a public-surface rename, not a JSDoc fix — leave for
a follow-up.
@marcin-kordas-hoc
Copy link
Copy Markdown
Collaborator Author

Correction on the codecov/patch FAILURE: this was originally framed (in a follow-up review thread) as "natural consequence of JSDoc-only PRs having 0% executable patch." That framing was wrong.

The first commit on this branch (85b58bd3f, pure JSDoc additions to 547 lines of TS) passed `codecov/patch`. The follow-up fix (85fc91c0cincludesRow JSDoc reword + byCols_byCols rename to match the sibling _byRows) is what flipped it red. The rename + reword added six lines that codecov tracks as "patch lines" but that have no executable surface, so the per-patch coverage went to 0%.

Verdict: not a real regression. The HF codebase's revealed preference is to treat `codecov/patch` as advisory (4 recent merged `src/**` PRs — #1652, #1650, #1640, #1627 — landed with the same red signal). Patch-coverage red here is an artifact of the public-API rename, not a missing test.

The real underlying gap is that there are no boundary tests for `includesRow` / `includesColumn` / `shifted` — which is what made the C1 inverted-JSDoc bug undetectable in the first place. Filing a separate follow-up PR with 12 boundary cases for those methods; this PR stays JSDoc-only per scope.

Also worth noting: `_byCols` does propagate into the published `.d.ts` typings, but matches the existing `_byRows` precedent on the `AbsoluteColumnRange.shifted` override (added pre-this-PR). The convention is self-consistent.

@codecov
Copy link
Copy Markdown

codecov Bot commented May 26, 2026

Codecov Report

❌ Patch coverage is 0% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 97.16%. Comparing base (508d78f) to head (85fc91c).

Files with missing lines Patch % Lines
src/AbsoluteCellRange.ts 0.00% 1 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@           Coverage Diff            @@
##           develop    #1680   +/-   ##
========================================
  Coverage    97.16%   97.16%           
========================================
  Files          175      175           
  Lines        15319    15319           
  Branches      3356     3356           
========================================
  Hits         14884    14884           
  Misses         427      427           
  Partials         8        8           
Files with missing lines Coverage Δ
src/AbsoluteCellRange.ts 94.59% <0.00%> (ø)
🚀 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.

1 participant