Prefer .toString() or .toLocaleString() over String() for more predictable behavior and consistency. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
8 lines
304 B
YAML
8 lines
304 B
YAML
id: no-string-function
|
|
language: typescript
|
|
severity: error
|
|
message: "Don't use String() - use .toString() or .toLocaleString() instead."
|
|
note: "String() can have unexpected behavior. Use .toString() for general conversion or .toLocaleString() for locale-aware formatting."
|
|
rule:
|
|
pattern: String($VAL)
|