Skip to content

import-used

Protobufstyleno fixdefault: offprotobuf/buf-standard

Reports an import of a file none of whose names the file uses. A public import is left alone. It needs the imported files, found from the folder with the module’s buf.yaml; an import it cannot read is not reported.

An import that nothing uses makes the file depend on another one for no reason: a change there can break this file, and tools load it for nothing.

To fix, remove the import.

protobuf:
lint:
rules:
import-used: warn # off (default), warn, error

Enabled by the presets: protobuf/buf-standard.

Suppress one line with sudsy-disable-next-line import-used in a comment of the file’s language.

The same check in other tools; Sudsy reports what each upstream rule reports.

Tool Rule Match
buf IMPORT_USED full