Skip to content

Commit ec90db0

Browse files
committed
adding comments explaining each scenario
.
1 parent 5b99726 commit ec90db0

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/comments/handlers/ContractDefinition.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@ function handleContractDefinitionComments(
2626
options.locEnd
2727
);
2828

29+
// In this scenario we are in between jus after a base contract declaration.
2930
if (precedingNode && precedingNode.type === 'InheritanceSpecifier') {
3031
if (
3132
(followingNode && followingNode.type === 'InheritanceSpecifier') ||
@@ -36,6 +37,8 @@ function handleContractDefinitionComments(
3637
}
3738
}
3839

40+
// In this scenario we have a comment just after the contract's name
41+
// TODO: at the moment we prepended it but this should be kept after the name.
3942
if (
4043
(followingNode && followingNode.type === 'InheritanceSpecifier') ||
4144
nextCharacter === '{'
@@ -44,6 +47,8 @@ function handleContractDefinitionComments(
4447
return true;
4548
}
4649

50+
// When the contract is empty and contain comments.
51+
// Most likely disabling a linter rule.
4752
if (enclosingNode.subNodes.length === 0) {
4853
addDanglingComment(enclosingNode, comment);
4954
return true;

0 commit comments

Comments
 (0)