Stand up ESLint with a TypeScript + react-hooks baseline - #130
Merged
Conversation
Fixes the ~30 findings the config surfaced across src/ (dead imports, unused vars, non-null-safe optional calls), triages the flagged ConfirmDialog onClose and useSSO stale-closure bugs, and scopes no-explicit-any to a warning under theme/**/LegacyTheme/** only. Pins Node via volta/.nvmrc to satisfy both ESLint 9's engine requirement and Storybook 6's webpack 4 OpenSSL provider (flag added to the storybook/build-storybook scripts). Closes #128 Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Parameterizes the components object as Components<Omit<Theme, "components">> so MUI can actually check styleOverrides callbacks, then types the ~56 previously-any theme params as Theme. Fixes a real gap this exposed: body3 was only augmented on TypographyVariantsOptions (createTheme input), never on TypographyVariants (what theme.typography.body3 reads at runtime). The one any that can't be typed (MuiAutocomplete.inputRoot's ownerState — MUI's AutocompleteOwnerState generics don't unify against the untyped styleOverrides slot) gets a scoped disable comment instead. With nothing left for it to cover, removes the theme/**/LegacyTheme/** no-explicit-any override added for #128 so future any usage there is caught as an error again. Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Code Review — ✅ No blockers |
agalin920
approved these changes
Sep 2, 2026
# Conflicts: # package-lock.json # package.json # src/ConfirmDialog/ConfirmDialog.stories.tsx # src/ConfirmDialog/index.tsx # src/FieldTypeColor/index.tsx # src/FieldTypeNumber/index.tsx # src/FieldTypeOneToMany/index.tsx # src/FieldTypeOneToOne/index.tsx # src/FieldTypeSort/index.tsx # src/SSOButtonGroup/SSOButtonGroup.stories.tsx # src/TextField.stories.tsx # src/VitualizedAutocomplete/index.tsx # src/theme/index.tsx
Code Review — ✅ No blockers |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
eslint.config.js) withtypescript-eslint'srecommendedconfig andeslint-plugin-react-hooks'srecommendedconfig againstsrc/**/*.{ts,tsx}, plus annpm run lintscript.theme/**/LegacyTheme/**(dead imports/args in.stories.tsxfiles, unused vars,let→const, etc.).theme: anyparams insrc/theme/index.tsxas MUI'sTheme(parameterizingcomponentsasComponents<Omit<Theme, "components">>so this type-checks), which also surfaced and fixed a real gap:body3was only augmented onTypographyVariantsOptions(createTheme input) and never onTypographyVariants(whattheme.typography.body3reads at runtime). One remainingany(MuiAutocomplete.inputRoot'sownerState) can't be typed — MUI'sAutocompleteOwnerStategenerics don't unify against the untypedstyleOverridesslot — so it's a scoped inline disable instead. Net effect: the directory-wideno-explicit-any→warnoverride called for in the issue is no longer needed and has been removed;no-explicit-anyis back toerrorrepo-wide.ConfirmDialog/index.tsx— the unusedonClosedestructure was a real bug silently strippingonClosebefore it reached MUI'sDialog, so backdrop/Escape-driven close never fired. Fixed.FieldTypeSort/index.tsx— the twoonChange && onChange(...)were functionally fine, just an unused-expression lint shape; rewritten asonChange?.(...).SSOButtonGroup/index.tsx— the exhaustive-deps warning is not a bug: adding the missing deps would re-fireonSuccess/onErroron every parent re-render for unmemoized callbacks. Left as-is with a justified inline disable.utils/useSSO.ts— genuine stale-closure bug: the message listener closed overauthServiceUrlbut only ran on mount, so a changedauthServiceUrlafter mount kept validating against the stale origin. Fixed withuseCallback.LegacyTheme/index.ts's file-wide@ts-nocheckgets a scoped, justified disable instead of being left as a raw finding.volta/.nvmrcto18.20.4— needed for ESLint 9'sstructuredClonerequirement, while keeping Storybook 6/webpack 4 working viaNODE_OPTIONS=--openssl-legacy-provideron thestorybook/build-storybookscripts specifically (rather than a project-wide Node downgrade).Out of scope (per issue)
recommendedconfigs.Test plan
npm run lintexits 0 (0 errors, 0 warnings)tsc --noEmit -p tsconfig.jsonexits 0ConfirmDialognow closes on backdrop click/Escape; other touched stories render without console errorsCloses #128
🤖 Generated with Claude Code