solhint
solhint copied to clipboard
no-unused-import does not recognize @inheritdoc reference
Description
If a contract is only referenced by @inheritdoc documentation tag, you need to import it, but then the no-unused-import fails.
Example
A.sol
contract A {
/**
* @notice my cool foo funtion
*/
function foo() virtual view { ... }
}
B.sol
import { A } from A;
contract B is A {
}
C.sol
import { A } from A; // ----------------------------------------> THIS FAILS WITH no-unused-import
import { B } from B;
contract C is B {
/**
* @inheritdoc A -------------------------------------------> THIS REQUIRES "A" to be imported
*/
function foo() override view { ... }
}
Version: 5.0.5