Fix: AbsoluteCellRange.ts JSDoc lint errors on Node 22#1680
Fix: AbsoluteCellRange.ts JSDoc lint errors on Node 22#1680marcin-kordas-hoc wants to merge 2 commits into
Conversation
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.
✅ Deploy Preview for hyperformula-dev-docs ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
✅ Deploy Preview for hyperformula-docs ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
Performance comparison of head (85fc91c) vs base (508d78f) |
…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.
|
Correction on the The first commit on this branch ( 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 Report❌ Patch coverage is
Additional details and impacted files@@ 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
🚀 New features to boost your workflow:
|
Summary
Adds missing JSDoc blocks to every class, method, getter, and exported helper in
src/AbsoluteCellRange.ts, clearing all 68jsdoc/require-jsdocwarnings 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)src/AbsoluteCellRange.tsAll 68 disappeared warnings are
jsdoc/require-jsdoc(no errors before or after; no other rule classes touched).Fixes (one-liner each)
simpleCellRangehelper — JSDoc with@param/@returns.AbsoluteCellRangeclass header +sheetgetter.start,end.fromSimpleCellAddresses,fromAst,fromAstOrUndef,fromCellRange,spanFrom,spanFromOrUndef,fromCoordinates.isFinite,doesOverlap,addressInRange,columnInRange,rowInRange,containsRange,includesRow,includesColumn,shouldBeRemoved,exceedsSheetSizeLimits,sameDimensionsAs,sameAs.intersectionWith,shiftByRows,shiftByColumns,expandByRows,expandByColumns,shifted,moveToSheet,removeSpan,rangeWithSameWidth,rangeWithSameHeight,withStart,width,height,size,toString.arrayOfAddressesInRange,addressesArrayMap(@template T),addresses,addressesWithDirection(@yields),getAddress.effectiveEndColumn,effectiveEndRow,effectiveWidth,effectiveHeight.removeRows,removeColumns.AbsoluteColumnRangeclass header + ctor +fromColumnRange+ overrides (shouldBeRemoved,shiftByRows,expandByRows,shifted,rangeWithSameHeight,exceedsSheetSizeLimits,effectiveEndRow,effectiveHeight,removeRows).AbsoluteRowRangeclass 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)"Includes the dedicated
test/hyperformula-tests/unit/AbsoluteCellRange.spec.ts.npx tsc --noEmitalso passes — JSDoc edits compile cleanly.eslint-disablelines addedNone. All 68 findings were fixable with proper JSDoc blocks.
Notes
eslint --fixrun on the file or repo.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.tsso ESLint’sjsdoc/require-jsdocpasses on Node 22—68 warnings cleared in that file with no intended behavior change.Coverage includes the
simpleCellRangehelper,AbsoluteCellRange(class, constructor,sheetgetter, static factories, geometry/overlap/containment, mutation and iteration APIs, effective bounds), and subclassesAbsoluteColumnRange/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.shiftedto_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) renamedbyCols→_byColsonAbsoluteRowRange.shiftedto match the sibling_byRows. This is a parameter-name edit visible in published.d.tstypings (TS treats_x: numberandx: numberas 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.