dprint / dprint

Pluggable and configurable code formatting platform written in Rust.

Home Page:https://dprint.dev

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Error when a plugin returns an empty string for non-whitespace text with char length over certain amount

dsherret opened this issue · comments

If a formatter is provided a string length greater than say 100 and the output is an empty text (then double check for non-whitespace char length of greater than 100), then dprint should error because this is most likely a mistake.

I thought I already had this built into dprint, but I can't find the code atm. Maybe it was just in a branch (Edit: Oh, it was in the exec plugin https://github.com/dprint/dprint-plugin-exec/blob/5637a11b28260264a331b66d516a9f5432e2bdb4/src/handler.rs#L243C9-L255)

Related: dprint/dprint-plugin-typescript#563