solhint icon indicating copy to clipboard operation
solhint copied to clipboard

Feature request: no-duplicated-import

Open fedgiac opened this issue 7 months ago • 2 comments

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.

fedgiac avatar Jul 19 '24 13:07 fedgiac