Skip to content

Latest commit

 

History

History
61 lines (45 loc) · 1.74 KB

no-console.md

File metadata and controls

61 lines (45 loc) · 1.74 KB
warning layout title
This is a dynamically generated file. Do not edit manually.
default
no-console | Solhint

no-console

Recommended Badge Category Badge Default Severity Badge error

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

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 of rule severity. Must be one of "error", "warn", "off". Default to error.

Example Config

{
  "rules": {
    "no-console": "error"
  }
}

Notes

  • Solhint allows this rule to automatically fix the code with --fix option

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 3.4.0

Resources