Skip to content

Feature request: no-duplicated-import #588

@fedgiac

Description

@fedgiac

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions