Skip to content

chore: fix JavaScript lint errors (issue #16784) - #16788

Open
devnaldo wants to merge 1 commit into
stdlib-js:developfrom
devnaldo:fix-lint-issue-16784
Open

devnaldo wants to merge 1 commit into
stdlib-js:developfrom
devnaldo:fix-lint-issue-16784

Conversation

@devnaldo

Copy link
Copy Markdown
Contributor

Resolves #16784.

Description

What is the purpose of this pull request?

This pull request:

  • updates the rffti example in fft/base/fftpack/ndarray/float32/rffti (lib/main.js, lib/index.js, README.md, docs/repl.txt, docs/types/index.d.ts) to read the radix factors through a Uint32Array view and annotate them as <Uint32Array>[ 8, 2, 2, 4 ], matching fft/base/fftpack/float32/rffti and resolving the stdlib/jsdoc-doctest lint error.
  • updates string/uppercase/lib/main.js to delegate to @stdlib/string/base/uppercase instead of calling String.prototype.toUpperCase directly, following string/lowercase and resolving the no-restricted-syntax lint error.

Related Issues

Does this pull request have any related issues?

This pull request has the following related issues:

Reference Packages

Did the content of this pull request follow one or more existing packages? Answering is optional.

This pull request followed these packages:

  • fft/base/fftpack/float32/rffti (its README example reads the integer factors through a Uint32Array view)
  • string/lowercase (its lib/main.js delegates to string/base/lowercase)

What carried over from the reference(s)?

  • the new Uint32Array( ... ) view over the float32 workspace and the <Uint32Array>[ 8, 2, 2, 4 ] annotation
  • the var base = require( '@stdlib/string/base/...' ); + return base( str ); delegation pattern

What differed, or what did you have to work out yourself?

  • The base float32 package receives a raw Float32Array, whereas the ndarray package receives a workspace ndarray, so the view is built from the underlying data buffer (w.data.buffer, w.data.byteOffset, w.data.length).

Questions

Any questions for reviewers of this pull request?

  • For fft/base/fftpack/ndarray/float32/rffti, do you prefer this explicit Uint32Array view example (as in the base float32 package), or would you rather keep a float32 factors slice annotated with ~0 values? We chose the explicit view because the float32 workspace stores the integer factors as uint32 bit patterns, so reading them through a float32 slice yields denormals.

Other

Any other information relevant to this pull request? This may include screenshots, references, and/or implementation notes.

  • Verification (OpenCode): package tests 97/97 (rffti) and 35/35 (string/uppercase); package examples exit 0; make lint-javascript-files clean on both changed library files; lint-typescript-declarations-files clean on the changed index.d.ts; the REPL help linter is clean on docs/repl.txt.
  • The new rffti example was executed standalone: the twiddle factors are [ 0.7071067690849304, 0.7071067690849304, 0, 0, 0, 0, 0, 0 ] and the factors are Uint32Array(4) [ 8, 2, 2, 4 ]. The float32 workspace stores the radix factors as uint32 bit patterns, exactly as in fft/base/fftpack/float32/rffti, so the docs now read them through a Uint32Array view instead of a float32 slice.
  • string/uppercase was checked against @stdlib/string/base/uppercase and the native String.prototype.toUpperCase on empty, multi-word, and non-ASCII inputs (├ƒ, ─░, ∩¼ü, combining accent), with identical results; invalid, missing, and null arguments throw the same TypeError. It now delegates to the base package exactly like string/lowercase.

Checklist

Please ensure the following tasks are completed before submitting this pull request.

AI Assistance

When authoring the changes proposed in this PR, did you use any kind of AI assistance?

  • Yes
  • No

If you answered "yes" above, how did you use AI assistance?

  • Code generation (e.g., when writing an implementation or fixing a bug)
  • Test/benchmark generation
  • Documentation (including examples)
  • Research and understanding

Disclosure

If you answered "yes" to using AI assistance, please provide a short disclosure indicating how you used AI assistance. This helps reviewers determine how much scrutiny to apply when reviewing your contribution. Example disclosures: "This PR was written primarily by Claude Code." or "I consulted ChatGPT to understand the codebase, but the proposed changes were fully authored manually by myself.".


@stdlib-js/reviewers

---
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: passed
  - task: lint_markdown_docs
    status: na
  - task: lint_markdown
    status: na
  - task: lint_package_json
    status: na
  - task: lint_repl_help
    status: passed
  - 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: passed
  - task: lint_license_headers
    status: passed
---
@devnaldo
devnaldo requested a review from a team November 23, 2026 11:13
@stdlib-bot stdlib-bot added Needs Review A pull request which needs code review. Good First PR A pull request resolving a Good First Issue. labels Nov 23, 2026
@stdlib-bot

Copy link
Copy Markdown
Contributor

Coverage Report

Package Statements Branches Functions Lines
fft/base/fftpack/ndarray/float32/rffti $\\color{green}147/147$
$\\color{green}+100.00\\%$
$\\color{green}3/3$
$\\color{green}+100.00\\%$
$\\color{green}1/1$
$\\color{green}+100.00\\%$
$\\color{green}147/147$
$\\color{green}+100.00\\%$
string/uppercase $\\color{green}91/91$
$\\color{green}+100.00\\%$
$\\color{green}4/4$
$\\color{green}+100.00\\%$
$\\color{green}1/1$
$\\color{green}+100.00\\%$
$\\color{green}91/91$
$\\color{green}+100.00\\%$

The above coverage report was generated for the changes in this PR.

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

Good First PR A pull request resolving a Good First Issue. Needs Review A pull request which needs code review.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Fix JavaScript lint errors

2 participants