no-console
March 24, 2025 ยท View on GitHub
The {"extends": "solhint:default"} property in a configuration file enables this rule. THIS IS DEPRECATED SINCE VERSION 5.1.0
The {"extends": "solhint:recommended"} property in a configuration file enables this rule.
Description
No console.log/logInt/logBytesX/logString/etc & No hardhat and forge-std console.sol import statements.
Options
This rule accepts a string option for rule severity. Must be one of "error", "warn", "off". Defaults to error.
Example Config
{
"rules": {
"no-console": "error"
}
}
Notes
- Solhint allows this rule to automatically fix the code with
--fixoption
Examples
๐ Examples of incorrect code for this rule
No console.logX statements
console.log('test')
No hardhat/console.sol import statements
import "hardhat/console.sol"
No forge-std console.sol & console2.sol import statements
import "forge-std/consoleN.sol"
Version
This rule was introduced in Solhint 5.0.4