We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
this pattern of using a negative condition to return early and prevent subsequent execution can be excessively verbose and confusing.
example:
prax/packages/query/src/block-processor.ts
Lines 630 to 647 in 7bcf54d
suggestion:
private async maybeUpsertAuctionWithNoteCommitment(spendableNoteRecord: SpendableNoteRecord) { const assetId = spendableNoteRecord.note?.value?.assetId; if (assetId) { const metadata = await this.indexedDb.getAssetsMetadata(assetId); const captureGroups = assetPatterns.auctionNft.capture(metadata?.display ?? ''); if (captureGroups) { const auctionId = new AuctionId(auctionIdFromBech32(captureGroups.auctionId)); await this.indexedDb.upsertAuction(auctionId, { noteCommitment: spendableNoteRecord.noteCommitment, }); } } }
this suggestion could still be improved, e.g.
private async maybeUpsertAuctionWithNoteCommitment({ note, noteCommitment, }: SpendableNoteRecord) { const assetId = note?.value?.assetId; const metadata = assetId && (await this.indexedDb.getAssetsMetadata(assetId)); const auctionId = metadata && assetPatterns.auctionNft.capture(metadata.display)?.auctionId; if (auctionId) { await this.indexedDb.upsertAuction(new AuctionId(auctionIdFromBech32(auctionId)), { noteCommitment, }); } }
there may be linter rules available to discourage the early-void-return pattern.
The text was updated successfully, but these errors were encountered:
No branches or pull requests
this pattern of using a negative condition to return early and prevent subsequent execution can be excessively verbose and confusing.
example:
prax/packages/query/src/block-processor.ts
Lines 630 to 647 in 7bcf54d
suggestion:
this suggestion could still be improved, e.g.
there may be linter rules available to discourage the early-void-return pattern.
The text was updated successfully, but these errors were encountered: