rusackas opened a new pull request, #37625: URL: https://github.com/apache/superset/pull/37625
## Summary This PR delivers a comprehensive TypeScript quality improvement across the Superset frontend, removing legacy JavaScript patterns and modernizing the codebase. ### Key Changes **TypeScript Migration & Type Safety** - Migrated all remaining dashboard JS/JSX files to TypeScript - Added proper `ThunkAction`/`ThunkDispatch` typing to SqlLab and dashboard actions - Removed legacy PropTypes from TypeScript files (use TS interfaces instead) - Migrated `@ts-ignore` to `@ts-expect-error` with explanatory comments - Consolidated duplicate type definitions across utility files - Fixed all type errors (0 `tsc --noEmit` errors) **Testing Modernization** - Migrated all sinon usage to Jest (`jest.fn()`, `jest.spyOn()`, `jest.useFakeTimers()`) - Removed `sinon` and `@types/sinon` dependencies entirely **Dependency Cleanup** - Removed `prop-types` (unused since TypeScript migration) - Removed `react-hot-loader`, `@hot-loader/react-dom` (replaced by React Refresh) - Removed `babel-plugin-typescript-to-proptypes` (obsolete) - Updated `use-query-params` to ^2.2.2 - Cleaned webpack vendors chunk and babel.config.js **Dead Code Removal** - Removed orphaned type definition files - Removed orphaned test files for deleted modules - Removed unused `.swcrc` configuration **Documentation Updates** - Updated testing docs: Enzyme → React Testing Library - Fixed file references: `MainPreset.js` → `MainPreset.ts` ### Stats - **55 commits** - **525 files changed** - **-7,640 net lines** (14,026 insertions, 21,666 deletions) ## BEFORE/AFTER | Metric | Before | After | |--------|--------|-------| | `@ts-ignore` in src/ | Many | 0 | | `@ts-nocheck` in src/ | Some | 0 | | sinon usage | 17 test files | 0 | | prop-types imports | Listed in package.json | Removed | | react-hot-loader | Active | Removed (React Refresh) | | TypeScript errors | 0 | 0 | ## TESTING INSTRUCTIONS 1. Run `npm install` in superset-frontend 2. Run `npm run build` - should complete successfully 3. Run `npm run test` - all tests should pass 4. Start dev server and verify HMR works with React Refresh ## ADDITIONAL INFORMATION This work was done across multiple sessions with careful attention to: - Maintaining zero TypeScript errors throughout - Preserving all existing functionality - Following the project's TypeScript migration guidelines from CLAUDE.md 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude Opus 4.5 <[email protected]> -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: [email protected] For queries about this service, please contact Infrastructure at: [email protected] --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
