Skip to content

Commit

Permalink
fix: imports-order for direct paths
Browse files Browse the repository at this point in the history
  • Loading branch information
dbale-altoros committed Aug 3, 2024
1 parent 0f0f313 commit e06930b
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
6 changes: 6 additions & 0 deletions docs/rules/naming/func-named-parameters.md
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,12 @@ functionName({ sender: '0xA81705c8C247C413a19A244938ae7f4A0393944e', amount: 1e1
functionName({ sender: _senderAddress, amount: 1e18, token: _tokenAddress, receiver: _receiverAddress })
```

#### abi.encodeX call with four UNNAMED parameters

```solidity
abi.encodePacked(_senderAddress, 1e18, _tokenAddress, _receiverAddress )
```

### 👎 Examples of **incorrect** code for this rule

#### Function call with four UNNAMED parameters (default 4)
Expand Down
3 changes: 2 additions & 1 deletion docs/rules/naming/imports-order.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ This rule accepts a string option of rule severity. Must be one of "error", "war
### Notes
- 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"
Expand All @@ -34,7 +35,7 @@ This rule accepts a string option of rule severity. Must be one of "error", "war
This rule does not have examples.

## Version
This rule is introduced in the latest version.
This rule was introduced in [Solhint 5.0.2](https://github.com/protofire/solhint/tree/v5.0.2)

## Resources
- [Rule source](https://github.com/protofire/solhint/tree/master/lib/rules/naming/imports-order.js)
Expand Down

0 comments on commit e06930b

Please sign in to comment.