Skip to content

chore: fix JavaScript lint errors (issue #16126) - #16833

Closed
Aryan-Jangra07 wants to merge 2 commits into
stdlib-js:developfrom
Aryan-Jangra07:fix/lint-16126
Closed

Aryan-Jangra07 wants to merge 2 commits into
stdlib-js:developfrom
Aryan-Jangra07:fix/lint-16126

Conversation

@Aryan-Jangra07

@Aryan-Jangra07 Aryan-Jangra07 commented Nov 25, 2026 •

Copy link
Copy Markdown

Resolves #16126.

Description

What is the purpose of this pull request?

This pull request:

  • fixes _tools/doctest/compare-values so that \uXXXX escape sequences in string return annotations are converted to their corresponding characters before comparison. Previously, an annotation such as // => 'boop' was compared verbatim against the actual output, which contains a literal (invisible) BOM, so it could never match. This was the cause of the stdlib/doctest failures in string/remove-utf8-bom/examples/index.js. The example itself is left unchanged, and its output still includes the BOM, since the BOM is not at the start of those strings (as noted in chore: fix JavaScript lint errors (issue #16126) #16139 (comment)).
  • adds tests to _tools/doctest/compare-values for matching and non-matching annotations containing a  escape.
  • adds stdlib/eol-open-bracket-spacing to the eslint-disable directive in assert/is-configurable-property-in/examples/index.js, matching sibling packages such as assert/is-data-property-in and assert/has-property.

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:

  • assert/is-data-property-in
  • assert/has-property

What carried over from the reference(s)?

  • The eslint-disable directive for the example file.

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

  • The compare-values fix. Existing code already harmonizes \n, \t and \' for strings, so the Unicode escape handling was added alongside those.

Questions

Any questions for reviewers of this pull request?

The same stdlib/eol-open-bracket-spacing error also shows up in other assert/*-property-in examples (e.g., is-enumerable-property-in). I only touched the file listed in the issue. Happy to update the others here or in a follow-up if preferred.

Other

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

The new compare-values tests fail without the fix and pass with it. make lint-javascript-files passes for all changed files, and the stdlib/doctest errors in string/remove-utf8-bom/README.md are also resolved by the fix.

@stdlib-js/reviewers

Return annotations such as `// => 'boop\ufeff'` were compared verbatim
against the actual string, so any annotation using a `\uXXXX` escape for
a non-printing character (e.g., a byte order mark) could never match.

Ref: stdlib-js#16126

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---
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
---
Disable `stdlib/eol-open-bracket-spacing` in the example, matching
sibling packages such as `assert/is-data-property-in` and
`assert/has-property`.

Ref: stdlib-js#16126

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>

---
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: na
  - 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
---
@Aryan-Jangra07
Aryan-Jangra07 requested a review from a team November 25, 2026 21:16
@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 25, 2026
@stdlib-bot

Copy link
Copy Markdown
Contributor

👋 Hi there! 👋

And thank you for opening your first pull request! We will review it shortly. 🏃 💨

Getting Started

Next Steps

  1. A project maintainer will approve GitHub Actions workflows for your PR.
  2. All CI checks must pass before your submission can be fully reviewed.
  3. You'll need to address any failures in linting or unit tests.

Running Tests Locally

You can use make to run any of the CI commands locally from the root directory of the stdlib repository:

# Run tests for all packages in the math namespace:
make test TESTS_FILTER=".*/@stdlib/math/.*"

# Run benchmarks for a specific package:
make benchmark BENCHMARKS_FILTER=".*/@stdlib/math/base/special/sin/.*"

If you haven't heard back from us within two weeks, please ping us by tagging the "reviewers" team in a comment on this PR.

If you have any further questions while waiting for a response, please join our Zulip community to chat with project maintainers and other community members.

We appreciate your contribution!

Documentation Links

@stdlib-bot stdlib-bot added the First-time Contributor A pull request from a contributor who has never previously committed to the project repository. label Nov 25, 2026
@stdlib-bot

Copy link
Copy Markdown
Contributor

Hello! Thank you for your contribution to stdlib.

We noticed that the contributing guidelines acknowledgment is missing from your pull request. Here's what you need to do:

  1. Please read our contributing guidelines.

  2. Update your pull request description to include this checked box:

    - [x] Read, understood, and followed the [contributing guidelines](https://github.com/stdlib-js/stdlib/blob/develop/CONTRIBUTING.md)

This acknowledgment confirms that you've read the guidelines, which include:

  • The developer's certificate of origin
  • Your agreement to license your contributions under the project's terms

We can't review or accept contributions without this acknowledgment.

Thank you for your understanding and cooperation. We look forward to reviewing your contribution!

@stdlib-bot stdlib-bot removed the Needs Review A pull request which needs code review. label Nov 25, 2026
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.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Fix JavaScript lint errors

2 participants