ts-proto
ts-proto copied to clipboard
Add option to allow for a generated code comment
We'd like for GH / Reviewable to understand these files are generated. Would you be open to adding a flag like: --ts_proto_opt=header=true
Which would prepend something like // Code generated by protoc-gen-ts. DO NOT EDIT.
to the first line of every file.
If this seems reasonable, I'd be happy to implement.
@adayNU yep, that sounds like a good idea; a PR would be great!
It could even be there by default. It's a comment so it will be stripped in most cases by webpack anyway.
Yep, good point / +1 to a hard-coded value. We could someday have like a prefixFile=./my-custom-prefix.txt
opt to override it, but I assume for now we could drop basically any known string into prefixDisableLinter
and be good enough.
I think this might be a nice feature to add. We could include additional information, like how the protoc-gen-go
plugin does
// Code generated by protoc-gen-go. DO NOT EDIT.
// versions:
// protoc-gen-go v1.29.0
// protoc v4.22.2
// source: foo.proto
Better late than never :-) thank you @dasco144 ! :tada: