solhint
solhint copied to clipboard
Feature request: no-duplicated-import
I'd like to suggest a new rule to catch when something is imported twice in a Solidity file, example below.
File ./Imported.sol
:
contract Imported {}
File ./Contract.sol
:
// The following line should trigger the suggested linting rule.
import {Imported, Imported} from "./Imported.sol`;
[... Solidity code that actually uses `Imported` ...]
A repeating import like the one above compiles successfully. A repetition can also happen in different import lines and from different files, as long as the import resolves to the same object.