You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@superset.apache.org by ru...@apache.org on 2025/02/26 04:35:07 UTC

(superset) 03/03: typescript and linting passes

This is an automated email from the ASF dual-hosted git repository.

rusackas pushed a commit to branch rtl-part-4
in repository https://gitbox.apache.org/repos/asf/superset.git

commit 491a9e045dc87b22c60d76a713781624fb84fee4
Author: Evan Rusackas <ev...@rusackas.com>
AuthorDate: Tue Feb 25 16:22:45 2025 -0700

    typescript and linting passes
---
 superset-frontend/src/__mocks__/antd-v5.tsx             |  2 +-
 .../src/features/cssTemplates/CssTemplateModal.test.tsx |  6 +-----
 .../src/pages/DatasetList/DatasetList.test.tsx          | 17 +++++++++--------
 .../pages/QueryHistoryList/QueryHistoryList.test.tsx    |  7 ++++---
 4 files changed, 15 insertions(+), 17 deletions(-)

diff --git a/superset-frontend/src/__mocks__/antd-v5.tsx b/superset-frontend/src/__mocks__/antd-v5.tsx
index 93d4f68ada..666327b142 100644
--- a/superset-frontend/src/__mocks__/antd-v5.tsx
+++ b/superset-frontend/src/__mocks__/antd-v5.tsx
@@ -1,4 +1,4 @@
-import { theme } from '@superset-ui/core';
+import { supersetTheme as theme } from '@superset-ui/core';
 
 // Mock Menu component
 const Menu = ({ children, ...props }: any) => (
diff --git a/superset-frontend/src/features/cssTemplates/CssTemplateModal.test.tsx b/superset-frontend/src/features/cssTemplates/CssTemplateModal.test.tsx
index 19af64cc59..f2268f4b7c 100644
--- a/superset-frontend/src/features/cssTemplates/CssTemplateModal.test.tsx
+++ b/superset-frontend/src/features/cssTemplates/CssTemplateModal.test.tsx
@@ -17,11 +17,7 @@
  * under the License.
  */
 import fetchMock from 'fetch-mock';
-import {
-  render,
-  screen,
-  within,
-} from 'spec/helpers/testing-library';
+import { render, screen, within } from 'spec/helpers/testing-library';
 import CssTemplateModal from './CssTemplateModal';
 import { TemplateObject } from './types';
 
diff --git a/superset-frontend/src/pages/DatasetList/DatasetList.test.tsx b/superset-frontend/src/pages/DatasetList/DatasetList.test.tsx
index c292526f27..4a0e8d36ab 100644
--- a/superset-frontend/src/pages/DatasetList/DatasetList.test.tsx
+++ b/superset-frontend/src/pages/DatasetList/DatasetList.test.tsx
@@ -17,6 +17,7 @@
  * under the License.
  */
 
+import { ReactNode, createElement } from 'react';
 import thunk from 'redux-thunk';
 import configureStore from 'redux-mock-store';
 import fetchMock from 'fetch-mock';
@@ -139,10 +140,10 @@ jest.mock('@superset-ui/core', () => {
 // Mock Form
 jest.mock('src/components/Form', () => ({
   __esModule: true,
-  FormItem: ({ children }: { children: React.ReactNode }) => (
+  FormItem: ({ children }: { children: ReactNode }) => (
     <div data-test="form-item">{children}</div>
   ),
-  Form: ({ children }: { children: React.ReactNode }) => (
+  Form: ({ children }: { children: ReactNode }) => (
     <form data-test="form">{children}</form>
   ),
 }));
@@ -151,7 +152,7 @@ jest.mock('src/components/Form', () => ({
 jest.mock('antd', () => ({
   ...jest.requireActual('antd'),
   Form: {
-    Item: ({ children }: { children: React.ReactNode }) => (
+    Item: ({ children }: { children: ReactNode }) => (
       <div data-test="antd-form-item">{children}</div>
     ),
   },
@@ -244,15 +245,15 @@ const ListView = ({
   data,
   columns,
 }: ListViewProps) =>
-  React.createElement(
+  createElement(
     'div',
     { 'data-test': 'list-view', role: 'table' },
     [
       bulkActions.length > 0 &&
-        React.createElement(
+        createElement(
           'div',
           { key: 'bulk-select', 'data-test': 'bulk-select' },
-          React.createElement(
+          createElement(
             'button',
             {
               type: 'button',
@@ -262,11 +263,11 @@ const ListView = ({
           ),
         ),
       ...(data?.map((row, i) =>
-        React.createElement(
+        createElement(
           'div',
           { key: i, role: 'row' },
           columns?.map((col, j) =>
-            React.createElement(
+            createElement(
               'div',
               { key: j, role: 'cell' },
               col.Cell
diff --git a/superset-frontend/src/pages/QueryHistoryList/QueryHistoryList.test.tsx b/superset-frontend/src/pages/QueryHistoryList/QueryHistoryList.test.tsx
index bd3769db1d..ac0bf0ea64 100644
--- a/superset-frontend/src/pages/QueryHistoryList/QueryHistoryList.test.tsx
+++ b/superset-frontend/src/pages/QueryHistoryList/QueryHistoryList.test.tsx
@@ -17,6 +17,7 @@
  * under the License.
  */
 
+import { createElement } from 'react';
 import thunk from 'redux-thunk';
 import configureStore from 'redux-mock-store';
 import fetchMock from 'fetch-mock';
@@ -227,15 +228,15 @@ interface ListViewProps {
 }
 
 const ListView = ({ children, data, columns }: ListViewProps) =>
-  React.createElement(
+  createElement(
     'div',
     { 'data-test': 'list-view', role: 'table' },
     data?.map((row, i) =>
-      React.createElement(
+      createElement(
         'div',
         { key: i, role: 'row' },
         columns?.map((col, j) =>
-          React.createElement(
+          createElement(
             'div',
             { key: j, role: 'cell' },
             col.Cell