warning | layout | title |
---|---|---|
This is a dynamically generated file. Do not edit manually. |
default |
imports-order | Solhint |
Order the imports of the contract to follow a certain hierarchy (read "Notes section")
This rule accepts a string option of rule severity. Must be one of "error", "warn", "off". Defaults to warn.
{
"rules": {
"imports-order": "warn"
}
}
- Paths starting with "@" like "@openzeppelin/" and urls ("http" and "https") will go first
- Order by hierarchy of directories first, e.g. ./../../ comes before ./../, which comes before ./, which comes before ./foo
- Direct imports come before relative imports
- Order alphabetically for each path at the same level, e.g. ./contract/Zbar.sol comes before ./interface/Ifoo.sol
- Rule does NOT support this kind of import "import * as Alias from "./filename.sol"
- When "--fix", rule will re-write this notation "../folder/file.sol" or this one "../file.sol" to "./../folder/file.sol" or this one "./../file.sol"
This rule does not have examples.
This rule is introduced in the latest version.