Add ast-grep rule to prevent String() function usage
Prefer .toString() or .toLocaleString() over String() for more predictable behavior and consistency. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
id: no-string-function
|
||||
snapshots:
|
||||
String(123):
|
||||
labels:
|
||||
- source: String(123)
|
||||
style: primary
|
||||
start: 0
|
||||
end: 11
|
||||
String(Date.now()):
|
||||
labels:
|
||||
- source: String(Date.now())
|
||||
style: primary
|
||||
start: 0
|
||||
end: 18
|
||||
String(value):
|
||||
labels:
|
||||
- source: String(value)
|
||||
style: primary
|
||||
start: 0
|
||||
end: 13
|
||||
Reference in New Issue
Block a user