Commit f04a0dc
fix(profiling-node): Fix NODE_VERSION rendered as [object Object] in warning (#19788)
I found this while working on `no-base-to-string` rule, this is the only
valid violation, the rest are buggy.
## Summary
- `NODE_VERSION` is a `SemVer` object (`{ major, minor, patch }`) from
`parseSemver()` with no custom `toString()`. Interpolating it in a
template literal produced `[object Object]` instead of the actual
version number.
- Since the surrounding check is `![16, 18, 20, 22,
24].includes(NODE_MAJOR)`, it makes more sense to log `NODE_MAJOR` (a
number) in the warning message anyway.
- Added a test verifying that `NODE_VERSION` has no custom `toString()`
to prevent future misuse.
## Test plan
- [x] Added unit test confirming `NODE_VERSION` stringifies as `[object
Object]`
- [x] Existing profiling-node tests pass
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Closes #19789 (added automatically)
Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>1 parent 81d1b97 commit f04a0dc
File tree
2 files changed
+13
-2
lines changed- packages/profiling-node
- src
- test
2 files changed
+13
-2
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
15 | 15 | | |
16 | 16 | | |
17 | 17 | | |
18 | | - | |
| 18 | + | |
19 | 19 | | |
20 | 20 | | |
21 | 21 | | |
| |||
634 | 634 | | |
635 | 635 | | |
636 | 636 | | |
637 | | - | |
| 637 | + | |
638 | 638 | | |
639 | 639 | | |
640 | 640 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| 8 | + | |
8 | 9 | | |
9 | 10 | | |
10 | 11 | | |
| |||
984 | 985 | | |
985 | 986 | | |
986 | 987 | | |
| 988 | + | |
| 989 | + | |
| 990 | + | |
| 991 | + | |
| 992 | + | |
| 993 | + | |
| 994 | + | |
| 995 | + | |
| 996 | + | |
| 997 | + | |
987 | 998 | | |
988 | 999 | | |
989 | 1000 | | |
| |||
0 commit comments