Skip to content

feat(core): enable no-nested-ternary lint rule#286

Merged
IzumiSy merged 1 commit into
mainfrom
enable-no-nested-ternary
May 26, 2026
Merged

feat(core): enable no-nested-ternary lint rule#286
IzumiSy merged 1 commit into
mainfrom
enable-no-nested-ternary

Conversation

@IzumiSy
Copy link
Copy Markdown
Contributor

@IzumiSy IzumiSy commented May 26, 2026

Summary

Enable the eslint/no-nested-ternary rule in oxlint for packages/core and fix all existing violations.

Changes

  • Added "no-nested-ternary": "error" to .oxlintrc.jsonc
  • Refactored nested ternaries into:
    • Named helper functions (nextSortDirection, resolveRawValue, resolveDateFormatOptions, resolveCollapsibleMode, stepClassForIndex)
    • Record lookups (LIST_VARIANT_CLASSES, TAB_VARIANT_CLASSES, GAP_CLASSES)
    • Conditional JSX rendering (CsvImporter status icons)

Files modified

  • packages/core/.oxlintrc.jsonc
  • packages/core/src/components/data-table/data-table.tsx
  • packages/core/src/components/data-table/cell-renderers.tsx
  • packages/core/src/components/csv-importer/process-rows.ts
  • packages/core/src/components/csv-importer/CsvImporter.tsx
  • packages/core/src/components/layout/Layout.tsx
  • packages/core/src/components/tabs.tsx
  • packages/core/src/components/sidebar/default-sidebar.tsx

Enable eslint/no-nested-ternary in oxlint and refactor all violations
into named helper functions or Record lookups for improved readability.
@IzumiSy IzumiSy requested a review from erickteowarang May 26, 2026 01:40
@IzumiSy IzumiSy merged commit 276d0f4 into main May 26, 2026
5 checks passed
@IzumiSy IzumiSy deleted the enable-no-nested-ternary branch May 26, 2026 02:25
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.

2 participants