Skip to content
New issue

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

chore: Fix no-unnecessary-condition linting errors #667

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

gcko
Copy link
Contributor

@gcko gcko commented Mar 20, 2025

PR checklist

  • Ensure you have added or ran the appropriate tests for your PR.
  • DCO signed

What type of PR is this?

Chore

What this PR does / why we need it:

  • Update pnpm to latest
  • Fix @typescript-eslint/no-unnecessary-condition - 54 errors

Which issue(s) this PR fixes:

N/A

Special notes for your reviewer:

  • ChangeSummary.tsx
    • Add better conditional logic, note that base.columns[col] is checked for existence, however the underlying typing does not include conditional existence
  • CheckBreadcrumb.tsx
    • Add missing typing to useRef
    • Fix typing for event handlers
  • CheckDetail.tsx
    • Check for window.isSecureContext (proper way to check)
  • CheckList.tsx
    • Disable type check for this line (need to fix check.type typing)
  • DropdownValuesInput.tsx
    • Correctly check for inputRef.current
  • EnvInfo.tsx
    • Check if the object is empty rather than exists (it always exists)
  • Filename.tsx
    • disable check for cloudMode
  • formatters.tsx
    • Fix typing for topK
  • graph.ts
    • visited record could be undefined
    • use != null check - idiomatic
  • GraphNode.tsx
    • disable lint checks on data for now
  • lineage.ts
    • Add TODO - LineageData typing needs to be fully thought out to handle the edge-cases
  • LineageGraphContext.tsx
    • disable lineage check
  • LineageViewTopBar.tsx
    • add missing type on useRef
  • mergeKeys.ts
    • Add typing on Record to allow for undefined type
  • PresetCheckRecommendation.tsx
    • disable lint check for querySelectModels
  • profile.ts
    • Add undefined type for TopKResult
  • ProfileDiffForm.tsx
    • Add proper logic for onChange
  • QueryResultView.tsx
    • run.result can be undefined, use default type and treat it as such
  • RecceActionContext.tsx
    • RunForm could be undefined
  • RunView.tsx
    • Fix null type checking
  • schema.test.ts
    • Fix typing (mergeColumns always returns truthy)
  • schemaDiff.ts
    • Disable type checking
  • SchemaSummary.tsx
    • Remove unused imports
  • ScreenShot.tsx
    • Add missing type to useRef
  • TopKSummaryList.tsx
    • Fix v typing, fix null type check
  • useMultiNodesAction.ts
    • Disable checking on while(true)
  • valuediff.tsx
    • disable checking on columnMap
  • ValueDiffForm.tsx
    • Add proper logic for onChange
  • ValueDiffResultView.tsx
    • fix typing

Does this PR introduce a user-facing change?:

NONE

gcko added 2 commits March 20, 2025 15:43
- Update pnpm to latest
- Fix `@typescript-eslint/no-unnecessary-condition` - 54 errors

Details:
ChangeSummary.tsx
- Add better conditional logic, note that `base.columns[col]` is checked for existence, however the underlying typing does not include conditional existence
CheckBreadcrumb.tsx
- Add missing typing to `useRef`
- Fix typing for event handlers
CheckDetail.tsx
- Check for `window.isSecureContext` (proper way to check)
CheckList.tsx
- Disable type check for this line (need to fix `check.type` typing)
DropdownValuesInput.tsx
- Correctly check for `inputRef.current`
EnvInfo.tsx
- Check if the object is empty rather than exists (it always exists)
Filename.tsx
- disable check for `cloudMode`
formatters.tsx
- Fix typing for `topK`
graph.ts
- `visited` record could be undefined
- use `!= null` check - idiomatic
GraphNode.tsx
- disable lint checks on `data` for now
lineage.ts
- Add TODO - LineageData typing needs to be fully thought out to handle the edge-cases
LineageGraphContext.tsx
- disable lineage check
LineageViewTopBar.tsx
- add missing type on `useRef`
mergeKeys.ts
- Add typing on Record to allow for `undefined` type
PresetCheckRecommendation.tsx
- disable lint check for `querySelectModels`
profile.ts
- Add undefined type for `TopKResult`
ProfileDiffForm.tsx
- Add proper logic for `onChange`
QueryResultView.tsx
- `run.result` can be undefined, use default type and treat it as such
RecceActionContext.tsx
- `RunForm` could be undefined
RunView.tsx
- Fix null type checking
schema.test.ts
- Fix typing (`mergeColumns` always returns truthy)
schemaDiff.ts
- Disable type checking
SchemaSummary.tsx
- Remove unused imports
ScreenShot.tsx
- Add missing type to `useRef`
TopKSummaryList.tsx
- Fix `v` typing, fix null type check
useMultiNodesAction.ts
- Disable checking on `while(true)`
valuediff.tsx
- disable checking on `columnMap`
ValueDiffForm.tsx
- Add proper logic for `onChange`
ValueDiffResultView.tsx
- fix typing

Signed-off-by: Jared Scott <[email protected]>
Signed-off-by: Jared Scott <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant