Fix JavaScript lint errors

Open Beginner friendly
#14,759 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
76/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
javascript
Domain
ci-cd, tooling

Research direction

Start with lib/node_modules/@stdlib/array/base/zip2views/lib/main.js and lib/node_modules/@stdlib/utils/group/examples/index.js, then run the JavaScript lint workflow or the make target shown in the failure. Address the five reported ESLint errors in those files and confirm the lint run completes without errors.

Written by the indexing model from the issue text.

Description

Good First Issue

JavaScript Linting Failures

Linting failures were detected in the automated JavaScript lint workflow run.

Workflow Details
Error Details
make[1]: Entering directory '/home/runner/work/stdlib/stdlib'

Linting file: lib/node_modules/@stdlib/_tools/changelog/parse-commits/lib/conventional_changelog.js

Linting file: lib/node_modules/@stdlib/blas/ext/base/slinspace/lib/native.js

Linting file: lib/node_modules/@stdlib/blas/ext/base/gtriu2tril/lib/base.js

Linting file: lib/node_modules/@stdlib/repl/presentation/lib/style_line.js

Linting file: lib/node_modules/@stdlib/ndarray/base/every/lib/4d_complex.js

Linting file: lib/node_modules/@stdlib/stats/base/dists/geometric/quantile/lib/native.js

Linting file: lib/node_modules/@stdlib/blas/ext/base/gsort2ins/lib/index.js

Linting file: lib/node_modules/@stdlib/stats/base/dists/binomial/cdf/lib/index.js

Linting file: lib/node_modules/@stdlib/array/base/zip2views/lib/main.js

/home/runner/work/stdlib/stdlib/lib/node_modules/@stdlib/array/base/zip2views/lib/main.js
114:2  error  Function 'Datum' should be moved to module scope     stdlib/no-unnecessary-nested-functions
143:2  error  Function 'getValue' should be moved to module scope  stdlib/no-unnecessary-nested-functions
165:2  error  Function 'setValue' should be moved to module scope  stdlib/no-unnecessary-nested-functions

✖ 3 problems (3 errors, 0 warnings)

Linting failed.

Linting file: lib/node_modules/@stdlib/random/base/gumbel/lib/index.js

Linting file: lib/node_modules/@stdlib/random/array/gamma/lib/main.js

Linting file: lib/node_modules/@stdlib/math/base/special/expf/scripts/evalpoly.js

Linting file: lib/node_modules/@stdlib/ndarray/base/count-truthy/lib/8d.js

Linting file: lib/node_modules/@stdlib/constants/float16/ninf/lib/index.js

Linting file: lib/node_modules/@stdlib/repl/lib/regexp_workspace.js

Linting file: lib/node_modules/@stdlib/plot/components/svg/symbols/lib/props/y-scale/set.js

Linting file: lib/node_modules/@stdlib/stats/base/dists/t/mode/lib/native.js

Linting file: lib/node_modules/@stdlib/stats/base/dists/pareto-type1/cdf/lib/factory.js

Linting file: lib/node_modules/@stdlib/ndarray/base/napi/dtype-string-to-dtype/lib/index.js

Linting file: lib/node_modules/@stdlib/random/cauchy/lib/index.js

Linting file: lib/node_modules/@stdlib/ndarray/base/binary/lib/nd.js

Linting file: lib/node_modules/@stdlib/_tools/github/create-repo/lib/request.js

Linting file: lib/node_modules/@stdlib/blas/ext/base/zindex-of-truthy/lib/ndarray.native.js

Linting file: lib/node_modules/@stdlib/ndarray/base/any/lib/3d_blocked_accessors.js
make[1]: *** [/home/runner/work/stdlib/stdlib/tools/make/lib/lint/javascript/eslint.mk:261: eslint-files] Error 1
make[1]: Leaving directory '/home/runner/work/stdlib/stdlib'
make: *** [/home/runner/work/stdlib/stdlib/tools/make/lib/lint/javascript/Makefile:158: lint-javascript-files] Error 2
make[1]: Entering directory '/home/runner/work/stdlib/stdlib'

Linting file: lib/node_modules/@stdlib/stats/base/ndarray/mskmidrange/examples/index.js

Linting file: lib/node_modules/@stdlib/math/strided/special/ahaversin-by/examples/index.js

Linting file: lib/node_modules/@stdlib/blas/base/gsyr/examples/index.js

Linting file: lib/node_modules/@stdlib/_tools/eslint/rules/jsdoc-no-duplicate-headings-in-section/examples/index.js

Linting file: lib/node_modules/@stdlib/blas/ext/base/dapxsumors/examples/index.js

Linting file: lib/node_modules/@stdlib/stats/base/dists/levy/stdev/examples/index.js

Linting file: lib/node_modules/@stdlib/blas/base/zswap/examples/index.js

Linting file: lib/node_modules/@stdlib/blas/ext/base/zone-to/examples/index.js

Linting file: lib/node_modules/@stdlib/stats/strided/dmeanlipw/examples/index.js

Linting file: lib/node_modules/@stdlib/utils/group/examples/index.js

/home/runner/work/stdlib/stdlib/lib/node_modules/@stdlib/utils/group/examples/index.js
35:7  error  Using the `new Array()` constructor is not allowed; use an array literal with push instead  stdlib/no-new-array
42:5  error  Using the `new Array()` constructor is not allowed; use an array literal with push instead  stdlib/no-new-array

✖ 2 problems (2 errors, 0 warnings)

Linting failed.

Linting file: lib/node_modules/@stdlib/array/datespace/examples/index.js
make[1]: *** [/home/runner/work/stdlib/stdlib/tools/make/lib/lint/javascript/eslint.mk:261: eslint-files] Error 1
make[1]: Leaving directory '/home/runner/work/stdlib/stdlib'
make: *** [/home/runner/work/stdlib/stdlib/tools/make/lib/lint/javascript/Makefile:158: lint-javascript-files] Error 2
Pull Request Instructions
  • Please use the following PR title format:
    "chore: fix JavaScript lint errors (issue #<ISSUE_NUMBER>)".
  • Reference this issue in the "Related Issues" section of the PR body as "resolves #<ISSUE_NUMBER>".
Dominant language
JavaScript
Stars
6k
Forks
1.3k
Avg merge
1d 1h
Merged PRs (30d)
559

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from stdlib-js/stdlib

All issues in stdlib-js/stdlib

Similar issues

More JavaScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.