Remove Unused bindings for Annotations Imports?
See original GitHub issueMy .proto file includes imports that are never used by the generated JS client - eg.
import google/api/annotations.proto
import "protoc-gen-swagger/options/annotations.proto"
I was able to generate the JS client with protoc-get-grpc-web
, however, the generated code includes those imports even though they are not used by the client:
var google_api_annotations_pb = require('../../google/api/annotations_pb.js')
var protoc$gen$swagger_options_annotations_pb = require('../../protoc-gen-swagger/options/annotations_pb.js')
// Lint Errors:
>>> var `google_api_annotations_pb` is declared but its value is never read
>>> var `google_protobuf_empty_pb` is declared but its value is never read
Is there something in place to prevent unused bindings from being included in the generated code?
Similar issue with grpc-gateway code gen: https://github.com/grpc-ecosystem/grpc-gateway/issues/310
Issue Analytics
- State:
- Created 4 years ago
- Reactions:17
- Comments:8 (1 by maintainers)
Top Results From Across the Web
"Remove annotation" quick fix doesn't remove unused import
"Remove annotation" quick fix doesn't remove unused import. Open the following code ... NotNull; import org.jetbrains.annotations.Nullable; public class Foo ...
Read more >org.eclipse.jdt.core.dom.rewrite.ImportRewrite.addStaticImport java ...
public String addStaticImport(IBinding binding) { return ... If a import for a type is recorded to be removed, this record is discarded instead....
Read more >Guice binding not done with @Named annotation
Now if I remove the @Named annotation, it works. The getName() method is succesfully called. When adding the @Named annotation though, getName() ...
Read more >Invalid 'import is never used' warning for annotations - Eclipse
And if I organize the imports, the annotation import is removed and my ... your sample works fine for me too, no unused...
Read more >Common issues and solutions - mypy 0.991 documentation
Functions that do not have any annotations (neither for any argument nor for the ... In some cases, linters will complain about unused...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
would love to see some progress on this one, since it’s a really annoying issue
I ended up with lines like this in my Makefile: