Use leading underscore solhint rule for private constants (#4542)
Co-authored-by: Francisco Giordano <fg@frang.io>
This commit is contained in:
committed by
GitHub
parent
a5ed318634
commit
812404cee8
@ -48,9 +48,9 @@ module.exports = [
|
||||
|
||||
VariableDeclaration(node) {
|
||||
if (node.isDeclaredConst) {
|
||||
if (/^_/.test(node.name)) {
|
||||
// TODO: re-enable and fix
|
||||
// this.error(node, 'Constant variables should not have leading underscore');
|
||||
// TODO: expand visibility and fix
|
||||
if (node.visibility === 'private' && /^_/.test(node.name)) {
|
||||
this.error(node, 'Constant variables should not have leading underscore');
|
||||
}
|
||||
} else if (node.visibility === 'private' && !/^_/.test(node.name)) {
|
||||
this.error(node, 'Non-constant private variables must have leading underscore');
|
||||
|
||||
Reference in New Issue
Block a user