Skip to content

chore: fix JavaScript lint errors (issue #6355)#10698

Open
chinanuj wants to merge 1 commit intostdlib-js:developfrom
chinanuj:fix-lint-6355-v2
Open

chore: fix JavaScript lint errors (issue #6355)#10698
chinanuj wants to merge 1 commit intostdlib-js:developfrom
chinanuj:fix-lint-6355-v2

Conversation

@chinanuj
Copy link

@chinanuj chinanuj commented Mar 4, 2026

Description

This PR addresses the max-lines linting failure in predicate_loops.js reported by the automated JavaScript lint workflow.

The predicate_loops.js file previously exceeded the strict 300-line limit. To resolve this without altering the core logic, I refactored the script by extracting four helper functions into their own files within the lib/ directory:

  • callbackBody -> lib/callback_body.js
  • signatures -> lib/signatures.js
  • updateManifest -> lib/update_manifest.js
  • updateMainHeader -> lib/update_main_header.js

The main script was updated to require() these modules, bringing it comfortably under the maximum line limit. All new files strictly adhere to stdlib project conventions, including proper Apache license headers and the required // MODULES //, // MAIN //, and // EXPORTS // block dividers. Unused variables were also removed from the main script.

Related Issues

resolves #6355

Checklist

---
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
    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
---
@stdlib-bot stdlib-bot added First-time Contributor A pull request from a contributor who has never previously committed to the project repository. Needs Review A pull request which needs code review. Good First PR A pull request resolving a Good First Issue. labels Mar 4, 2026
@Lokeshranjan8
Copy link
Contributor

@chinanuj Hey, I suggest you re-read the issue again. The max-lines 300 limit you tried to fix here is just a warning, not an actual error. The real error was in-> @stdlib/math/base/special/log2/scripts/precision.js
see::
image

@chinanuj
Copy link
Author

chinanuj commented Mar 4, 2026

Hey @lokesh, I actually looked for precision.js first, but it looks like that file doesn't even exist on the develop branch anymore (probably deleted/moved a while ago). Since the predicate_loops.js warning was still lingering in the codebase, I figured I'd just knock it out to help clean things up.

As you can see below there is no scripts folder which was suppose to contain precision.js inside log2 folder .

Screenshot 2026-03-04 at 9 25 54 PM

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

First-time Contributor A pull request from a contributor who has never previously committed to the project repository. 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

3 participants