build: avoid false positives in ESLint rule jsdoc-doctest-decimal-point - #14644
Merged
Conversation
…cimal-point`
---
type: pre_commit_static_analysis_report
description: Results of running static analysis checks when committing changes.
report:
- task: lint_filenames
status: passed
- task: lint_editorconfig
status: passed
- task: lint_markdown_pkg_readmes
status: na
- task: lint_markdown_docs
status: na
- task: lint_markdown
status: na
- task: lint_package_json
status: na
- task: lint_repl_help
status: na
- task: lint_javascript_src
status: passed
- task: lint_javascript_cli
status: na
- task: lint_javascript_examples
status: na
- task: lint_javascript_tests
status: passed
- task: lint_javascript_benchmarks
status: na
- task: lint_python
status: na
- task: lint_r
status: na
- task: lint_c_src
status: na
- task: lint_c_examples
status: na
- task: lint_c_benchmarks
status: na
- task: lint_c_tests_fixtures
status: na
- task: lint_shell
status: na
- task: lint_typescript_declarations
status: passed
- task: lint_typescript_tests
status: na
- task: lint_license_headers
status: passed
---
---
type: pre_commit_static_analysis_report
description: Results of running static analysis checks when committing changes.
report:
- task: lint_filenames
status: passed
- task: lint_editorconfig
status: passed
- task: lint_markdown_pkg_readmes
status: na
- task: lint_markdown_docs
status: na
- task: lint_markdown
status: na
- task: lint_package_json
status: na
- task: lint_repl_help
status: na
- task: lint_javascript_src
status: passed
- task: lint_javascript_cli
status: na
- task: lint_javascript_examples
status: na
- task: lint_javascript_tests
status: na
- task: lint_javascript_benchmarks
status: na
- task: lint_python
status: na
- task: lint_r
status: na
- task: lint_c_src
status: na
- task: lint_c_examples
status: na
- task: lint_c_benchmarks
status: na
- task: lint_c_tests_fixtures
status: na
- task: lint_shell
status: na
- task: lint_typescript_declarations
status: passed
- task: lint_typescript_tests
status: na
- task: lint_license_headers
status: passed
---
Contributor
Coverage Report
The above coverage report was generated for the changes in this PR. |
---
type: pre_commit_static_analysis_report
description: Results of running static analysis checks when committing changes.
report:
- task: lint_filenames
status: passed
- task: lint_editorconfig
status: passed
- task: lint_markdown_pkg_readmes
status: na
- task: lint_markdown_docs
status: na
- task: lint_markdown
status: na
- task: lint_package_json
status: na
- task: lint_repl_help
status: na
- task: lint_javascript_src
status: passed
- task: lint_javascript_cli
status: na
- task: lint_javascript_examples
status: na
- task: lint_javascript_tests
status: passed
- task: lint_javascript_benchmarks
status: na
- task: lint_python
status: na
- task: lint_r
status: na
- task: lint_c_src
status: na
- task: lint_c_examples
status: na
- task: lint_c_benchmarks
status: na
- task: lint_c_tests_fixtures
status: na
- task: lint_shell
status: na
- task: lint_typescript_declarations
status: passed
- task: lint_typescript_tests
status: na
- task: lint_license_headers
status: passed
---
kgryte
reviewed
Aug 27, 2026
kgryte
reviewed
Aug 27, 2026
kgryte
reviewed
Aug 27, 2026
kgryte
reviewed
Aug 27, 2026
Co-authored-by: Athan <kgryte@gmail.com> Signed-off-by: Athan <kgryte@gmail.com>
kgryte
approved these changes
Aug 27, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Resolves https://github.com/stdlib-js/todo/issues/1517 and stdlib-js/metr-issue-tracker#1237.
Description
This pull request:
fixes false positives in the
jsdoc-doctest-decimal-pointESLint rule, which applied a documented function's@returnstype to every annotation in every@example:@returns {integer}(e.g., a LAPACK status code) which mutates aFloat64Arrayargument, annotations such as// D => <Float64Array>[ 3.0, 5.0 ]were incorrectly flagged for containing decimal points (see, e.g., the incorrect diagnostic surfaced in the review of feat: addlapack/base/dlasrt#12354). Annotations of the form// <identifier> => ...describe mutated values, not return values, and are now skipped.// => <Float32Array>[ 1.0, 2.0 ]) do not have the documented return type and are no longer validated against it (previously only enforced in the "must include a decimal point" branch, but not in the "must NOT include a decimal point" branch).@returns {number}which returns elements of an integer typed array parameter (e.g.,function getUint8( arr, idx ) { return arr[ idx ]; }with@param {Uint8Array} arr), annotations such as// returns 3were incorrectly required to include a decimal point (see stdlib-js/todo#1517). The rule now resolves@paramtypes and, when a function only ever returns elements of typed array parameters whose element type conflicts with the documented return type, skips validation, as the correct annotation format cannot be inferred from the return type alone. When the element type matches the documented return type, validation still applies.adds test fixtures covering each of the above scenarios.
removes
eslint-disabledirectives which are no longer needed under the fixed rule (inarray/base/getter, theblas/base/wasm/*packages, andlapack/base/dgttrf); the directives inutils/type-maxandutils/type-minremain, as those functions return integer-valued constants and are not covered by the accessor heuristic.To validate beyond the unit tests, the previous and fixed rule were run over 5,538 source files across the
array,blas,lapack,number, andstridednamespaces: the previous rule reported 76 diagnostics (all false positives, each suppressed via aneslint-disabledirective), while the fixed rule reports 0, with no new diagnostics introduced.Related Issues
This pull request has the following related issues:
Questions
No.
Other
No.
Checklist
AI Assistance
If you answered "yes" above, how did you use AI assistance?
Disclosure
This PR was written primarily by Claude Code under my direction, with the approach and validation reviewed by myself.
@stdlib-js/reviewers