100mslive / 100ms-web

A conferencing and streaming UI built with 100ms SDK.
https://examples-videoconferencing.app.100ms.live/preview/tmz-qdi-cyp
MIT License
198 stars 165 forks source link

feat: add no-nested-ternary to eslint rules #679

Closed rvermootenct closed 1 year ago

rvermootenct commented 1 year ago

Scope

A developer girl shouldn't have to hurt her brain to understand the logic flow in the application. Adding in warnings that nested-ternaries are not acceptable is a step in that direction.

More context

The app is littered in deeply nested ternaries, which by their nature is super hard to reason about and read. Considering this is a sample app, a lot of people are going to be reading the code.

Work Done

Added 'no-nested-ternary': 'error' to the eslint rules. Ideally this would be an error, but would create a lot of code needing to be updated before this could go in.

Steps to test

Add a nested ternary. Eslint should give you a warning.

GIF tax

vercel[bot] commented 1 year ago

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
100ms-web ❌ Failed (Inspect) Sep 20, 2023 11:45am
100ms-web-2-for-wiki ❌ Failed (Inspect) Sep 20, 2023 11:45am
vercel[bot] commented 1 year ago

@rvermootenct is attempting to deploy a commit to the 100mslive Team on Vercel.

A member of the Team first needs to authorize it.

ygit commented 1 year ago

@rvermootenct Thanks for contributing 🙌