Skip to content

feat: add _tools/repl-txt/rules/no-global-collision - #16143

Open
headlessNode wants to merge 2 commits into
stdlib-js:developfrom
headlessNode:repl/lint/name-collisions
Open

headlessNode wants to merge 2 commits into
stdlib-js:developfrom
headlessNode:repl/lint/name-collisions

Conversation

@headlessNode

Copy link
Copy Markdown
Member

Resolves stdlib-js/metr-issue-tracker#31.

Description

What is the purpose of this pull request?

This pull request:

  • add _tools/repl-txt/rules/no-global-collision

Related Issues

Does this pull request have any related issues?

This pull request has the following related issues:

  • add _tools/repl-txt/rules/no-global-collision

Questions

Any questions for reviewers of this pull request?

No.

Other

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

No.

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.".

Primarily written by Claude Code.


@stdlib-js/reviewers

@headlessNode
headlessNode requested a review from a team October 14, 2026 11:24
@stdlib-bot stdlib-bot added Tools Issue or pull request related to project tooling. Needs Review A pull request which needs code review. labels Oct 14, 2026
@headlessNode headlessNode added Feature Issue or pull request for adding a new feature. METR Pull request associated with the METR project. labels Oct 14, 2026

@kgryte kgryte left a comment •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is entirely incorrect. You misunderstood the issue. Our REPL environment uses the project's global namespace. Here, you are just checking for JavaScript globals. That is incorrect.

@kgryte kgryte added Needs Changes Pull request which needs changes before being merged. review: 2 and removed Needs Review A pull request which needs code review. labels Oct 14, 2026
@headlessNode

headlessNode commented Oct 14, 2026 •

Copy link
Copy Markdown
Member Author

@kgryte should the rule only check exact matches against entries in the aliases list (i.e., non-dotted aliases like abs, acartesianPower), or should it also flag variables matching namespace prefixes like base, random, strided, and fastmath (the first segment of dotted aliases like base.abs)?

@kgryte

kgryte commented Oct 14, 2026

Copy link
Copy Markdown
Member

Given that base, random, etc are reserved aliases (i.e., they are in the global namespace and we should not be overwriting them), I believe the answer should be self-evident.

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

Feature Issue or pull request for adding a new feature. METR Pull request associated with the METR project. Needs Changes Pull request which needs changes before being merged. review: 2 Tools Issue or pull request related to project tooling.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[RFC]: add stdlib REPL text lint rule to prevent name collisions with global identifiers

3 participants