oasisprotocol / oasisprotocol/explorer

[Bug]: Lint prevent unexpected values being rendered

Open
#259 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

bug
Dominant language
TypeScript
Stars
13
Forks
13
Avg merge
58m
Merged PRs (30d)
2

Description

Is there an existing issue for this?
  • I have searched the existing issues
SUMMARY

No response

STEPS TO REPRODUCE

DecodedLogEvent would print "0" if event.evm_log_params=[] because {event.evm_log_params?.length && ( renders "0".

For usual if (array.length) I would prefer a lint rule to enforce if (array.length > 0).
But in case of event.evm_log_params?.length > 0 that's incorrect. It needs
event.evm_log_params && event.evm_log_params.length > 0

EXPECTED BEHAVIOR

No response

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by locating DecodedLogEvent and the rendering of event.evm_log_params, then inspect the project's lint configuration and existing rules. Reproduce the empty-array case and determine how the rule should distinguish optional lengths from ordinary array lengths. Done means the unexpected "0" is avoided and the intended conditional pattern is covered by the lint behavior.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
frontend, tooling
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.