chore(frontend): comprehensive TypeScript quality improvements (#37625)

Co-authored-by: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
Evan Rusackas
2026-02-06 16:16:57 -05:00
committed by GitHub
parent e9ae212c1c
commit fc5506e466
441 changed files with 14136 additions and 9956 deletions

View File

@@ -41,7 +41,6 @@ beforeEach(() => {
});
afterEach(() => {
// @ts-ignore
window.location = originalLocation;
fetchMock.clearHistory().removeRoutes();
jest.clearAllMocks(); // Clears mock history but keeps spy in place
@@ -524,9 +523,9 @@ test('should show missing params state', () => {
});
test('should show missing dataset state', () => {
// @ts-ignore
// @ts-expect-error - overriding window.location for test
delete window.location;
// @ts-ignore
// @ts-expect-error - overriding window.location for test
window.location = { search: '?slice_id=152' };
const props = createProps({ datasource: fallbackExploreInitialData.dataset });
render(<DatasourceControl {...props} />, { useRedux: true, useRouter: true });
@@ -539,9 +538,9 @@ test('should show missing dataset state', () => {
});
test('should show forbidden dataset state', () => {
// @ts-ignore
// @ts-expect-error - overriding window.location for test
delete window.location;
// @ts-ignore
// @ts-expect-error - overriding window.location for test
window.location = { search: '?slice_id=152' };
const error = {
error_type: 'TABLE_SECURITY_ACCESS_ERROR',

View File

@@ -19,7 +19,6 @@
*/
import React, { PureComponent } from 'react';
import PropTypes from 'prop-types';
import { DatasourceType, SupersetClient, Datasource } from '@superset-ui/core';
import { t } from '@apache-superset/core';
import {
@@ -119,25 +118,6 @@ interface DatasourceControlState {
showDatasource?: boolean;
}
const propTypes = {
actions: PropTypes.object.isRequired,
onChange: PropTypes.func,
value: PropTypes.string,
datasource: PropTypes.object.isRequired,
form_data: PropTypes.object.isRequired,
isEditable: PropTypes.bool,
onDatasourceSave: PropTypes.func,
user: PropTypes.object.isRequired,
// ControlHeader-related props
hovered: PropTypes.bool,
type: PropTypes.string,
label: PropTypes.string,
default: PropTypes.any,
description: PropTypes.string,
validationErrors: PropTypes.array,
name: PropTypes.string,
};
const defaultProps = {
onChange: () => {},
onDatasourceSave: null,
@@ -258,8 +238,6 @@ class DatasourceControl extends PureComponent<
DatasourceControlProps,
DatasourceControlState
> {
static propTypes = propTypes;
static defaultProps = defaultProps;
constructor(props: DatasourceControlProps) {