coderaiser / putout

🐊 Pluggable and configurable JavaScript Linter, code transformer and formatter, drop-in ESLint superpower replacement 💪 with built-in support for js, jsx, typescript, flow, markdown, yaml and json. Write declarative codemods in a simplest possible way 😏
https://putout.cloudcmd.io/
MIT License
698 stars 40 forks source link

remove-unused-expressions: "use client" false warning #211

Closed EvgenyOrekhov closed 2 months ago

EvgenyOrekhov commented 2 months ago

Example code:

"use client";

Expected: no warning from remove-unused-expressions

Actual: warning from remove-unused-expressions - Unused expression statement

"use client"; is a special React directive and should be allowed, see https://react.dev/reference/rsc/use-client

coderaiser commented 2 months ago

Just excluded use client and landed in v35.36.1 🎉.

Is it works for you?

EvgenyOrekhov commented 2 months ago

Yes, it works now, thank you!