Repository navigation
fix(lint/no-base-to-string): look through parentheses around operands and callees - #1203
Merged
camc314 merged 1 commit intoDec 1, 2026
Merged
Conversation
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues were identified for the parenthesized-expression handling changes.
No open issues 🎉
What changed in this PR
Updates no-base-to-string to match upstream handling of parenthesized operands and callees, improving diagnostic locations and detecting previously missed stringification calls.
Changes:
- Unwraps parentheses when checking operands and recognizing
String,toString,toLocaleString, andjoincalls. - Preserves the exclusion for grouped optional-chain callees.
- Updates regression baselines and upstream tracking to
a3ff7d40.
| File | Description |
|---|---|
crates/tsrs_lint/tests/baselines/PROGRESS.md |
Records the updated upstream revision. |
crates/tsrs_lint/tests/baselines/no-base-to-string/REFERENCE |
Pins the baseline’s new tsgolint reference commit. |
crates/tsrs_lint/tests/baselines/no-base-to-string/baseline.json |
Adds grouped-call cases and updates diagnostic ranges and text. |
crates/tsrs_lint/src/rules/no_base_to_string.rs |
Skips parentheses while preserving optional-chain exclusions. |
Review effort: Balanced
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Ports oxc-project/tsgolint#1448 (
a3ff7d40), including its baseline update.Parentheses around stringified operands,
Stringcallees andtoStringorjoincallees weren't skipped, so multiline reports started at the opening parenthesis, and grouped callees such as(String)(obj)or(obj.toString)()weren't checked. Like typescript-eslint, which drops these parentheses, the rule now skips them. A grouped optional-chain callee such as(obj?.toString)()is still not checked, as in typescript-eslint.