Skip to content

[Bug]: eval?.() wrongly reported as direct eval #8856

@Josh-Cena

Description

@Josh-Cena

Reproduction link or steps

REPL

eval?.("foo")

What is expected?

No warnings; this is the shortest indirect eval

What is actually happening?

Warning:

index.ts (1:0) [EVAL] Warning: Use of direct `eval` function is strongly discouraged as it poses security risks and may cause issues with minification.
   ╭─[ index.ts:1:1 ]
   │
 1 │ eval?.("foo")
   │ ──┬─  
   │   ╰─── Use of direct `eval` here.
   │ 
   │ Help: Consider using indirect eval. For more information, check the documentation: https://rolldown.rs/guide/troubleshooting#avoiding-direct-eval
───╯

System Info

REPL

Any additional comments?

No response

Metadata

Metadata

Labels

No labels
No labels

Type

Priority

None yet

Effort

None yet

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions