From e3cfe22072e6da7c3efd0c09d9d31b38fc0e3c27 Mon Sep 17 00:00:00 2001 From: VolodymyrBg Date: Tue, 11 Mar 2025 22:09:55 +0200 Subject: [PATCH] Fix leading-underscore rule for constant variables --- scripts/solhint-custom/index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/scripts/solhint-custom/index.js b/scripts/solhint-custom/index.js index 9625027eefe..34eac353f36 100644 --- a/scripts/solhint-custom/index.js +++ b/scripts/solhint-custom/index.js @@ -48,8 +48,8 @@ module.exports = [ VariableDeclaration(node) { if (node.isDeclaredConst) { - // TODO: expand visibility and fix - if (node.visibility === 'private' && /^_/.test(node.name)) { + // Check all constant variables regardless of visibility + if (/^_/.test(node.name)) { this.error(node, 'Constant variables should not have leading underscore'); } } else if (node.visibility === 'private' && !/^_/.test(node.name)) {