Skip to content

Fix remaining lint warnings (82 total) #146

Description

@pglevy

Background

PR #131 fixed lint errors (hooks order violations, renderer import, brace-expansion), but 82 warnings remain across the codebase. These are all from two rules set to "warn" in eslint.config.js.

Summary

Rule Count Notes
@typescript-eslint/no-explicit-any 65 Mostly form field value/saveInto props and ReadOnlyGrid row data
@typescript-eslint/no-unused-vars 16 Mix of intentional _ prefix vars and actual dead code
react-hooks/exhaustive-deps 1 ReadOnlyGrid useMemo conditional

Root cause: _ prefix not respected

PR #131 introduced underscore-prefixed destructuring (_validationGroup, _data, _sort) to signal intentionally unused variables, but the ESLint config doesn't ignore that pattern. Fix:

"@typescript-eslint/no-unused-vars": ["warn", { argsIgnorePattern: "^_", varsIgnorePattern: "^_" }]

This alone eliminates ~12 of the 16 no-unused-vars warnings.

Actual dead code to clean up

These are real unused references (not intentional _ prefix):

  • src/components/MessageBanner/MessageBanner.tsx — unused X import from lucide-react
  • src/components/ReadOnlyGrid/ReadOnlyGrid.tsx — unused totalPages variable
  • src/components/Tag/TagItem.tsx — unused _props parameter
  • scripts/generate-css.ts — unused TokenGroup type
  • scripts/token-server.ts — unused err in catch
  • src/components/Dropdown/DropdownField.test.tsx — unused openDropdown
  • src/components/RadioButton/RadioButtonField.test.tsx — unused container
  • src/components/ReadOnlyGrid/ReadOnlyGrid.properties.test.tsx — unused matchingHeaders

Suggested approach

  1. Fix ESLint config to respect _ prefix convention
  2. Remove actual dead code (unused imports/variables listed above)
  3. Leave no-explicit-any warnings as-is for now — address per-component over time (form fields may benefit from generics)
  4. Fix the one react-hooks/exhaustive-deps warning in ReadOnlyGrid

Files with warnings

  • scripts/generate-css.ts
  • scripts/token-server.ts
  • src/components/Button/ButtonWidget.tsx
  • src/components/ButtonToggle/ButtonToggle.tsx
  • src/components/Checkbox/CheckboxField.tsx
  • src/components/Dialog/DialogField.test.tsx
  • src/components/Dropdown/DropdownField.test.tsx
  • src/components/Dropdown/DropdownField.tsx
  • src/components/Dropdown/DropdownFieldBase.tsx
  • src/components/Dropdown/MultipleDropdownField.tsx
  • src/components/MessageBanner/MessageBanner.tsx
  • src/components/Milestone/MilestoneField.tsx
  • src/components/RadioButton/RadioButtonField.test.tsx
  • src/components/RadioButton/RadioButtonField.tsx
  • src/components/ReadOnlyGrid/GridColumn.tsx
  • src/components/ReadOnlyGrid/ReadOnlyGrid.properties.test.tsx
  • src/components/ReadOnlyGrid/ReadOnlyGrid.stories.tsx
  • src/components/ReadOnlyGrid/ReadOnlyGrid.tsx
  • src/components/Slider/SliderField.tsx
  • src/components/Stamp/StampField.tsx
  • src/components/Tag/TagItem.tsx
  • src/components/Toggle/ToggleField.tsx

Metadata

Metadata

Assignees

Labels

bugSomething isn't working

Projects

Status
Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions