Skip to content

Commit

Permalink
fix super incorrecto (#318)
Browse files Browse the repository at this point in the history
* fix super incorrecto

* Linter fix

---------

Co-authored-by: Fernando Dodino <[email protected]>
  • Loading branch information
MEUFAJ and fdodino authored Dec 13, 2024
1 parent f96dd12 commit a733ac9
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/validator/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ export const methodShouldHaveDifferentSignature = error<Method>(node =>
export const shouldNotOnlyCallToSuper = warning<Method>(node => {
const callsSuperWithSameArgs = (sentence?: Sentence) => sentence?.is(Super) && sentence.args.every((arg, index) => arg.is(Reference) && arg.target === node.parameters[index])
return isEmpty(node.sentences) || !node.sentences.every(sentence =>
callsSuperWithSameArgs(sentence) || sentence.is(Return) && callsSuperWithSameArgs(sentence.value)
callsSuperWithSameArgs(sentence) && node.sentences.length == 1 || sentence.is(Return) && callsSuperWithSameArgs(sentence.value)
)
}, undefined, sourceMapForBody)

Expand Down

0 comments on commit a733ac9

Please sign in to comment.