Solhint

Solhint

Community Analyzer

Import statement includes an entire file instead of selected symbols SOLHINT-W1009

Anti-pattern
Minor

Import statement includes an entire file instead of selected symbols.

Bad Practice

  1. import all members from a file
import * from "foo.sol"
  1. import an entire file
import "foo.sol"

Recommended

  1. import names explicitly
import {A} from "./A.sol"
  1. import entire file into a name
import "./A.sol" as A
  1. import entire file into a name
import * as A from "./A.sol"

Learn more

no-global-import on Solhint's documentation.