Skip to content

chore: fix JavaScript lint errors (issue #11750)#11794

Merged
kgryte merged 2 commits intostdlib-js:developfrom
vedparkasharya:fix-lint-marsaglia-11750
Apr 27, 2026
Merged

chore: fix JavaScript lint errors (issue #11750)#11794
kgryte merged 2 commits intostdlib-js:developfrom
vedparkasharya:fix-lint-marsaglia-11750

Conversation

@vedparkasharya
Copy link
Copy Markdown
Contributor

Description

This PR fixes JavaScript linting errors reported in #11750 in the test.marsaglia.js file.

Problem

The automated lint workflow detected the following errors in lib/node_modules/@stdlib/stats/kstest/test/test.marsaglia.js:

  46:65  error  Unused eslint-disable directive (no problems were reported from 'array-element-newline')
  47:70  error  Unused eslint-disable directive (no problems were reported from 'array-element-newline')
  49:13  error  There should be a linebreak after this element                                            array-element-newline
  49:18  error  There should be a linebreak after this element                                            array-element-newline
  ...

Solution

Changes Made

  1. Removed unused eslint-disable-line directives from the d and n array declarations (lines 46–47). These directives were no longer needed and triggered unused-eslint-disable errors.

  2. Reformatted the expected array so each element is on its own line, satisfying the array-element-newline ESLint rule.

Before:

d = [ 0.3, -0.1, 1.5, 0.5, 0.1, 0.1, 0.05, 0.05, 0.8, 0.274 ]; // eslint-disable-line array-element-newline
n = [ 10.0, 10.0, 10.0, 20.0, 10.0, 20.0, 300.0, 80.0, 1.0, 10.0 ]; // eslint-disable-line array-element-newline
expected = [
	0.7294644, 0.0, 1.0, 0.9999621, 0.0003629,
	0.0237449, 0.5725584, 0.0175789, 0.6, 0.6284796
];

After:

d = [ 0.3, -0.1, 1.5, 0.5, 0.1, 0.1, 0.05, 0.05, 0.8, 0.274 ];
n = [ 10.0, 10.0, 10.0, 20.0, 10.0, 20.0, 300.0, 80.0, 1.0, 10.0 ];
expected = [
	0.7294644,
	0.0,
	1.0,
	0.9999621,
	0.0003629,
	0.0237449,
	0.5725584,
	0.0175789,
	0.6,
	0.6284796
];

Why this solution is correct

  • The d and n arrays are concise single-line declarations that do not violate the project's array-element-newline configuration, making the disable comments redundant.
  • The expected array spans multiple lines, so the array-element-newline rule requires each element to be on its own line for consistency and readability.
  • No test logic or values were changed; only formatting was updated.

Related Issues

resolves #11750

Checklist

- Remove unused eslint-disable-line array-element-newline directives
- Format expected array with each element on its own line to comply with array-element-newline rule
@vedparkasharya vedparkasharya requested a review from a team April 26, 2026 11:53
@stdlib-bot stdlib-bot added Statistics Issue or pull request related to statistical functionality. Needs Review A pull request which needs code review. Good First PR A pull request resolving a Good First Issue. First-time Contributor A pull request from a contributor who has never previously committed to the project repository. labels Apr 26, 2026
@github-actions github-actions Bot mentioned this pull request Apr 26, 2026
Comment thread lib/node_modules/@stdlib/stats/kstest/test/test.marsaglia.js
Co-authored-by: Athan <kgryte@gmail.com>
Signed-off-by: Athan <kgryte@gmail.com>
@kgryte kgryte added difficulty: 1 Low degree of difficulty. Should be straightforward to implement and/or resolve. review: 4 and removed Needs Review A pull request which needs code review. labels Apr 26, 2026
@stdlib-bot
Copy link
Copy Markdown
Contributor

Coverage Report

Package Statements Branches Functions Lines
stats/kstest $\color{green}885/885$
$\color{green}+100.00%$
$\color{green}128/128$
$\color{green}+100.00%$
$\color{green}10/10$
$\color{green}+100.00%$
$\color{green}885/885$
$\color{green}+100.00%$

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

@kgryte kgryte merged commit 8775511 into stdlib-js:develop Apr 27, 2026
46 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

difficulty: 1 Low degree of difficulty. Should be straightforward to implement and/or resolve. 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. review: 4 Statistics Issue or pull request related to statistical functionality.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Fix JavaScript lint errors

3 participants