Skip to content

Latest commit

 

History

History
59 lines (41 loc) · 1.7 KB

no-unused-import.md

File metadata and controls

59 lines (41 loc) · 1.7 KB
warning layout title
This is a dynamically generated file. Do not edit manually.
default
no-unused-import | Solhint

no-unused-import

Recommended Badge Category Badge Default Severity Badge warn

The {"extends": "solhint:recommended"} property in a configuration file enables this rule.

Description

Imported object name is not being used by the contract.

Options

This rule accepts a string option of rule severity. Must be one of "error", "warn", "off". Defaults to warn.

Example Config

{
  "rules": {
    "no-unused-import": "warn"
  }
}

Examples

👍 Examples of correct code for this rule

Imported object is being used

            import { ERC20 } from "@openzeppelin/contracts/token/ERC20/ERC20.sol";
            contract MyToken is ERC20 {}
          

👎 Examples of incorrect code for this rule

Imported object is not being used

          import { ERC20 } from "@openzeppelin/contracts/token/ERC20/ERC20.sol";
            contract B {}
          

Version

This rule was introduced in Solhint 5.0.4

Resources