diff --git a/docs/src/components/SectionHeader.tsx b/docs/src/components/SectionHeader.tsx index 158517d88d0f3..041d7f948a7d6 100644 --- a/docs/src/components/SectionHeader.tsx +++ b/docs/src/components/SectionHeader.tsx @@ -16,6 +16,7 @@ * specific language governing permissions and limitations * under the License. */ +import { ReactNode } from 'react'; import styled from '@emotion/styled'; import { mq } from '../utils'; @@ -95,7 +96,7 @@ const StyledSectionHeaderH2 = styled(StyledSectionHeader)` interface SectionHeaderProps { level: any; title: string; - subtitle?: string | React.ReactNode; + subtitle?: string | ReactNode; dark?: boolean; } diff --git a/superset-frontend/.eslintrc.js b/superset-frontend/.eslintrc.js index 6ff6bc8a7350f..700652a0171d3 100644 --- a/superset-frontend/.eslintrc.js +++ b/superset-frontend/.eslintrc.js @@ -184,6 +184,16 @@ module.exports = { 'react/no-unused-class-component-methods': 0, 'import/no-relative-packages': 0, 'prefer-exponentiation-operator': 0, + 'react/react-in-jsx-scope': 0, + 'no-restricted-syntax': [ + 'error', + { + selector: + "ImportDeclaration[source.value='react'] :matches(ImportDefaultSpecifier, ImportNamespaceSpecifier)", + message: + 'Default React import is not required due to automatic JSX runtime in React 16.4', + }, + ], }, settings: { 'import/resolver': { @@ -242,6 +252,15 @@ module.exports = { 'testing-library/no-container': 0, 'testing-library/prefer-find-by': 0, 'testing-library/no-manual-cleanup': 0, + 'no-restricted-syntax': [ + 'error', + { + selector: + "ImportDeclaration[source.value='react'] :matches(ImportDefaultSpecifier, ImportNamespaceSpecifier)", + message: + 'Default React import is not required due to automatic JSX runtime in React 16.4', + }, + ], }, }, { @@ -369,6 +388,7 @@ module.exports = { 'default-case-last': 0, 'no-promise-executor-return': 0, 'react/no-unused-class-component-methods': 0, + 'react/react-in-jsx-scope': 0, }, ignorePatterns, }; diff --git a/superset-frontend/.storybook/preview.jsx b/superset-frontend/.storybook/preview.jsx index ba1a2d3265ca5..721fccc34d06f 100644 --- a/superset-frontend/.storybook/preview.jsx +++ b/superset-frontend/.storybook/preview.jsx @@ -16,7 +16,6 @@ * specific language governing permissions and limitations * under the License. */ -import React from 'react'; import { jsxDecorator } from 'storybook-addon-jsx'; import { supersetTheme, ThemeProvider } from '@superset-ui/core'; import { combineReducers, createStore, applyMiddleware, compose } from 'redux'; diff --git a/superset-frontend/babel.config.js b/superset-frontend/babel.config.js index 095c5836cf00f..af8ffc72704a8 100644 --- a/superset-frontend/babel.config.js +++ b/superset-frontend/babel.config.js @@ -36,16 +36,13 @@ module.exports = { ], [ '@babel/preset-react', - { development: process.env.BABEL_ENV === 'development' }, - ], - '@babel/preset-typescript', - [ - '@emotion/babel-preset-css-prop', { - autoLabel: 'dev-only', - labelFormat: '[local]', + development: process.env.BABEL_ENV === 'development', + runtime: 'automatic', + importSource: '@emotion/react', }, ], + '@babel/preset-typescript', ], plugins: [ 'lodash', @@ -58,6 +55,13 @@ module.exports = { // only used in packages/superset-ui-core/src/chart/components/reactify.tsx ['babel-plugin-typescript-to-proptypes', { loose: true }], 'react-hot-loader/babel', + [ + '@emotion/babel-plugin', + { + autoLabel: 'dev-only', + labelFormat: '[local]', + }, + ], ], env: { // Setup a different config for tests as they run in node instead of a browser @@ -74,7 +78,6 @@ module.exports = { targets: { node: 'current' }, }, ], - ['@emotion/babel-preset-css-prop'], ], plugins: ['babel-plugin-dynamic-import-node'], }, diff --git a/superset-frontend/package-lock.json b/superset-frontend/package-lock.json index b5cfb07c20b4b..2c2726bbf326a 100644 --- a/superset-frontend/package-lock.json +++ b/superset-frontend/package-lock.json @@ -15,7 +15,6 @@ ], "dependencies": { "@ant-design/icons": "^5.2.6", - "@emotion/babel-preset-css-prop": "^11.11.0", "@emotion/cache": "^11.4.0", "@emotion/react": "^11.4.1", "@emotion/styled": "^11.3.0", @@ -157,6 +156,7 @@ "@babel/preset-react": "^7.22.5", "@babel/register": "^7.23.7", "@cypress/react": "^5.10.0", + "@emotion/babel-plugin": "^11.11.0", "@emotion/jest": "^11.3.0", "@hot-loader/react-dom": "^16.13.0", "@istanbuljs/nyc-config-typescript": "^1.0.1", @@ -1640,6 +1640,7 @@ "version": "7.22.5", "resolved": "https://registry.npmjs.org/@babel/helper-annotate-as-pure/-/helper-annotate-as-pure-7.22.5.tgz", "integrity": "sha512-LvBTxu8bQSQkcyKOU+a1btnNFQ1dMAd0R6PyW3arXes06F6QLWLIrd681bxRPIXlrMGR3XYnW9JyML7dP3qgxg==", + "dev": true, "dependencies": { "@babel/types": "^7.22.5" }, @@ -2342,6 +2343,7 @@ "version": "7.23.3", "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-jsx/-/plugin-syntax-jsx-7.23.3.tgz", "integrity": "sha512-EB2MELswq55OHUoRZLGg/zC7QWUKfNLpE57m/S2yr1uEneIgsTgrSzXP3NXEsMkVn76OlaVVnzN+ugObuYGwhg==", + "dev": true, "dependencies": { "@babel/helper-plugin-utils": "^7.22.5" }, @@ -3136,6 +3138,8 @@ "version": "7.23.4", "resolved": "https://registry.npmjs.org/@babel/plugin-transform-react-jsx/-/plugin-transform-react-jsx-7.23.4.tgz", "integrity": "sha512-5xOpoPguCZCRbo/JeHlloSkTA8Bld1J/E1/kLfD1nsuiW1m8tduTA1ERCgIZokDflX/IBzKcqR3l7VlRgiIfHA==", + "dev": true, + "license": "MIT", "dependencies": { "@babel/helper-annotate-as-pure": "^7.22.5", "@babel/helper-module-imports": "^7.22.15", @@ -4972,6 +4976,7 @@ "version": "11.11.0", "resolved": "https://registry.npmjs.org/@emotion/babel-plugin/-/babel-plugin-11.11.0.tgz", "integrity": "sha512-m4HEDZleaaCH+XgDDsPF15Ht6wTLsgDTeR3WYj9Q/k76JtWhrJjcP4+/XlG8LGT/Rol9qUfOIztXeA84ATpqPQ==", + "license": "MIT", "dependencies": { "@babel/helper-module-imports": "^7.16.7", "@babel/runtime": "^7.18.3", @@ -4986,17 +4991,6 @@ "stylis": "4.2.0" } }, - "node_modules/@emotion/babel-plugin-jsx-pragmatic": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/@emotion/babel-plugin-jsx-pragmatic/-/babel-plugin-jsx-pragmatic-0.2.1.tgz", - "integrity": "sha512-xy1SlgEJygAAIvIuC2idkGKJYa6v5iwoyILkvNKgk347bV+IImXrUat5Z86EmLGyWhEoTplVT9EHqTnHZG4HFw==", - "dependencies": { - "@babel/plugin-syntax-jsx": "^7.17.12" - }, - "peerDependencies": { - "@babel/core": "^7.0.0" - } - }, "node_modules/@emotion/babel-plugin/node_modules/@emotion/hash": { "version": "0.9.1", "resolved": "https://registry.npmjs.org/@emotion/hash/-/hash-0.9.1.tgz", @@ -5062,20 +5056,6 @@ "node": ">=0.10.0" } }, - "node_modules/@emotion/babel-preset-css-prop": { - "version": "11.11.0", - "resolved": "https://registry.npmjs.org/@emotion/babel-preset-css-prop/-/babel-preset-css-prop-11.11.0.tgz", - "integrity": "sha512-+1Cba68IyBeltWzvbBSXcBWqP2eKQuQcSUpIu3ma4pOUeRol4EvwWrYS2Rv51aIVqg066fLB+Z9O/8NKR7uUlQ==", - "dependencies": { - "@babel/plugin-transform-react-jsx": "^7.17.12", - "@babel/runtime": "^7.18.3", - "@emotion/babel-plugin": "^11.11.0", - "@emotion/babel-plugin-jsx-pragmatic": "^0.2.1" - }, - "peerDependencies": { - "@babel/core": "^7.0.0" - } - }, "node_modules/@emotion/cache": { "version": "11.4.0", "resolved": "https://registry.npmjs.org/@emotion/cache/-/cache-11.4.0.tgz", @@ -72183,6 +72163,7 @@ "version": "7.22.5", "resolved": "https://registry.npmjs.org/@babel/helper-annotate-as-pure/-/helper-annotate-as-pure-7.22.5.tgz", "integrity": "sha512-LvBTxu8bQSQkcyKOU+a1btnNFQ1dMAd0R6PyW3arXes06F6QLWLIrd681bxRPIXlrMGR3XYnW9JyML7dP3qgxg==", + "dev": true, "requires": { "@babel/types": "^7.22.5" } @@ -72676,6 +72657,7 @@ "version": "7.23.3", "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-jsx/-/plugin-syntax-jsx-7.23.3.tgz", "integrity": "sha512-EB2MELswq55OHUoRZLGg/zC7QWUKfNLpE57m/S2yr1uEneIgsTgrSzXP3NXEsMkVn76OlaVVnzN+ugObuYGwhg==", + "dev": true, "requires": { "@babel/helper-plugin-utils": "^7.22.5" } @@ -73182,6 +73164,7 @@ "version": "7.23.4", "resolved": "https://registry.npmjs.org/@babel/plugin-transform-react-jsx/-/plugin-transform-react-jsx-7.23.4.tgz", "integrity": "sha512-5xOpoPguCZCRbo/JeHlloSkTA8Bld1J/E1/kLfD1nsuiW1m8tduTA1ERCgIZokDflX/IBzKcqR3l7VlRgiIfHA==", + "dev": true, "requires": { "@babel/helper-annotate-as-pure": "^7.22.5", "@babel/helper-module-imports": "^7.22.15", @@ -74711,25 +74694,6 @@ } } }, - "@emotion/babel-plugin-jsx-pragmatic": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/@emotion/babel-plugin-jsx-pragmatic/-/babel-plugin-jsx-pragmatic-0.2.1.tgz", - "integrity": "sha512-xy1SlgEJygAAIvIuC2idkGKJYa6v5iwoyILkvNKgk347bV+IImXrUat5Z86EmLGyWhEoTplVT9EHqTnHZG4HFw==", - "requires": { - "@babel/plugin-syntax-jsx": "^7.17.12" - } - }, - "@emotion/babel-preset-css-prop": { - "version": "11.11.0", - "resolved": "https://registry.npmjs.org/@emotion/babel-preset-css-prop/-/babel-preset-css-prop-11.11.0.tgz", - "integrity": "sha512-+1Cba68IyBeltWzvbBSXcBWqP2eKQuQcSUpIu3ma4pOUeRol4EvwWrYS2Rv51aIVqg066fLB+Z9O/8NKR7uUlQ==", - "requires": { - "@babel/plugin-transform-react-jsx": "^7.17.12", - "@babel/runtime": "^7.18.3", - "@emotion/babel-plugin": "^11.11.0", - "@emotion/babel-plugin-jsx-pragmatic": "^0.2.1" - } - }, "@emotion/cache": { "version": "11.4.0", "resolved": "https://registry.npmjs.org/@emotion/cache/-/cache-11.4.0.tgz", diff --git a/superset-frontend/package.json b/superset-frontend/package.json index ef03f41f0017b..c5bc110a06c53 100644 --- a/superset-frontend/package.json +++ b/superset-frontend/package.json @@ -80,7 +80,6 @@ ], "dependencies": { "@ant-design/icons": "^5.2.6", - "@emotion/babel-preset-css-prop": "^11.11.0", "@emotion/cache": "^11.4.0", "@emotion/react": "^11.4.1", "@emotion/styled": "^11.3.0", @@ -222,6 +221,7 @@ "@babel/preset-react": "^7.22.5", "@babel/register": "^7.23.7", "@cypress/react": "^5.10.0", + "@emotion/babel-plugin": "^11.11.0", "@emotion/jest": "^11.3.0", "@hot-loader/react-dom": "^16.13.0", "@istanbuljs/nyc-config-typescript": "^1.0.1", diff --git a/superset-frontend/packages/superset-ui-chart-controls/src/components/CertifiedIconWithTooltip.tsx b/superset-frontend/packages/superset-ui-chart-controls/src/components/CertifiedIconWithTooltip.tsx index 07492a181841c..5468d66139c23 100644 --- a/superset-frontend/packages/superset-ui-chart-controls/src/components/CertifiedIconWithTooltip.tsx +++ b/superset-frontend/packages/superset-ui-chart-controls/src/components/CertifiedIconWithTooltip.tsx @@ -16,7 +16,6 @@ * specific language governing permissions and limitations * under the License. */ -import React from 'react'; import { kebabCase } from 'lodash'; import { t, useTheme, styled } from '@superset-ui/core'; import Tooltip from './Tooltip'; diff --git a/superset-frontend/packages/superset-ui-chart-controls/src/components/ColumnOption.tsx b/superset-frontend/packages/superset-ui-chart-controls/src/components/ColumnOption.tsx index ca2a73247b60c..96cb6ab13d106 100644 --- a/superset-frontend/packages/superset-ui-chart-controls/src/components/ColumnOption.tsx +++ b/superset-frontend/packages/superset-ui-chart-controls/src/components/ColumnOption.tsx @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import React, { useState, ReactNode, useLayoutEffect } from 'react'; +import { useState, ReactNode, useLayoutEffect, RefObject } from 'react'; import { css, styled, SupersetTheme } from '@superset-ui/core'; import { Tooltip } from './Tooltip'; import { ColumnTypeLabel } from './ColumnTypeLabel/ColumnTypeLabel'; @@ -32,7 +32,7 @@ import { SQLPopover } from './SQLPopover'; export type ColumnOptionProps = { column: ColumnMeta; showType?: boolean; - labelRef?: React.RefObject; + labelRef?: RefObject; }; const StyleOverrides = styled.span` diff --git a/superset-frontend/packages/superset-ui-chart-controls/src/components/ColumnTypeLabel/ColumnTypeLabel.tsx b/superset-frontend/packages/superset-ui-chart-controls/src/components/ColumnTypeLabel/ColumnTypeLabel.tsx index 5962e942705df..6c655d330a84d 100644 --- a/superset-frontend/packages/superset-ui-chart-controls/src/components/ColumnTypeLabel/ColumnTypeLabel.tsx +++ b/superset-frontend/packages/superset-ui-chart-controls/src/components/ColumnTypeLabel/ColumnTypeLabel.tsx @@ -17,7 +17,7 @@ * specific language governing permissions and limitations * under the License. */ -import React, { ReactNode } from 'react'; +import { ReactNode } from 'react'; import { css, GenericDataType, styled, t } from '@superset-ui/core'; import { ClockCircleOutlined, QuestionOutlined } from '@ant-design/icons'; // TODO: move all icons to superset-ui/core diff --git a/superset-frontend/packages/superset-ui-chart-controls/src/components/ControlHeader.tsx b/superset-frontend/packages/superset-ui-chart-controls/src/components/ControlHeader.tsx index c1b22494ef38e..523125456c641 100644 --- a/superset-frontend/packages/superset-ui-chart-controls/src/components/ControlHeader.tsx +++ b/superset-frontend/packages/superset-ui-chart-controls/src/components/ControlHeader.tsx @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import React, { ReactNode } from 'react'; +import { ReactNode } from 'react'; import { t } from '@superset-ui/core'; import { InfoTooltipWithTrigger } from './InfoTooltipWithTrigger'; import { Tooltip } from './Tooltip'; diff --git a/superset-frontend/packages/superset-ui-chart-controls/src/components/InfoTooltipWithTrigger.tsx b/superset-frontend/packages/superset-ui-chart-controls/src/components/InfoTooltipWithTrigger.tsx index 86a4a3d1d1d28..2f9e127619e58 100644 --- a/superset-frontend/packages/superset-ui-chart-controls/src/components/InfoTooltipWithTrigger.tsx +++ b/superset-frontend/packages/superset-ui-chart-controls/src/components/InfoTooltipWithTrigger.tsx @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import React, { CSSProperties } from 'react'; +import { CSSProperties } from 'react'; import { kebabCase } from 'lodash'; import { TooltipPlacement } from 'antd/lib/tooltip'; import { t } from '@superset-ui/core'; diff --git a/superset-frontend/packages/superset-ui-chart-controls/src/components/MetricOption.tsx b/superset-frontend/packages/superset-ui-chart-controls/src/components/MetricOption.tsx index fe2ac9750aa0a..b558a0987ab0c 100644 --- a/superset-frontend/packages/superset-ui-chart-controls/src/components/MetricOption.tsx +++ b/superset-frontend/packages/superset-ui-chart-controls/src/components/MetricOption.tsx @@ -16,7 +16,8 @@ * specific language governing permissions and limitations * under the License. */ -import React, { useState, ReactNode, useLayoutEffect } from 'react'; +import { useState, ReactNode, useLayoutEffect, RefObject } from 'react'; + import { css, styled, @@ -46,7 +47,7 @@ export interface MetricOptionProps { showFormula?: boolean; showType?: boolean; url?: string; - labelRef?: React.RefObject; + labelRef?: RefObject; shouldShowTooltip?: boolean; } diff --git a/superset-frontend/packages/superset-ui-chart-controls/src/components/SQLPopover.tsx b/superset-frontend/packages/superset-ui-chart-controls/src/components/SQLPopover.tsx index 43d03a936cdb9..86f4684a9466b 100644 --- a/superset-frontend/packages/superset-ui-chart-controls/src/components/SQLPopover.tsx +++ b/superset-frontend/packages/superset-ui-chart-controls/src/components/SQLPopover.tsx @@ -16,7 +16,6 @@ * specific language governing permissions and limitations * under the License. */ -import React from 'react'; import { Popover } from 'antd'; import type { PopoverProps } from 'antd/lib/popover'; import AceEditor from 'react-ace'; diff --git a/superset-frontend/packages/superset-ui-chart-controls/src/components/Select.tsx b/superset-frontend/packages/superset-ui-chart-controls/src/components/Select.tsx index 16038a9804af6..01fb74d2e8e9d 100644 --- a/superset-frontend/packages/superset-ui-chart-controls/src/components/Select.tsx +++ b/superset-frontend/packages/superset-ui-chart-controls/src/components/Select.tsx @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import React, { useState, ReactNode } from 'react'; +import { useState, ReactNode } from 'react'; import AntdSelect, { SelectProps as AntdSelectProps } from 'antd/lib/select'; export const { Option }: any = AntdSelect; diff --git a/superset-frontend/packages/superset-ui-chart-controls/src/components/Tooltip.tsx b/superset-frontend/packages/superset-ui-chart-controls/src/components/Tooltip.tsx index 098fb169b6148..042434d1691e9 100644 --- a/superset-frontend/packages/superset-ui-chart-controls/src/components/Tooltip.tsx +++ b/superset-frontend/packages/superset-ui-chart-controls/src/components/Tooltip.tsx @@ -17,7 +17,6 @@ * under the License. */ -import React from 'react'; import { useTheme, css } from '@superset-ui/core'; import { Tooltip as BaseTooltip } from 'antd'; import type { TooltipProps } from 'antd/lib/tooltip'; diff --git a/superset-frontend/packages/superset-ui-chart-controls/src/components/labelUtils.tsx b/superset-frontend/packages/superset-ui-chart-controls/src/components/labelUtils.tsx index 1bd49c40e0d5d..66b25416f8b52 100644 --- a/superset-frontend/packages/superset-ui-chart-controls/src/components/labelUtils.tsx +++ b/superset-frontend/packages/superset-ui-chart-controls/src/components/labelUtils.tsx @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import React, { ReactNode } from 'react'; +import { ReactNode, RefObject } from 'react'; import { css, styled, t } from '@superset-ui/core'; import { ColumnMeta, Metric } from '@superset-ui/chart-controls'; @@ -60,7 +60,7 @@ const TooltipSection = ({ ); -export const isLabelTruncated = (labelRef?: React.RefObject): boolean => +export const isLabelTruncated = (labelRef?: RefObject): boolean => !!(labelRef?.current?.scrollWidth > labelRef?.current?.clientWidth); export const getColumnLabelText = (column: ColumnMeta): string => @@ -81,7 +81,7 @@ export const getColumnTypeTooltipNode = (column: ColumnMeta): ReactNode => { export const getColumnTooltipNode = ( column: ColumnMeta, - labelRef?: React.RefObject, + labelRef?: RefObject, ): ReactNode => { if ( (!column.column_name || !column.verbose_name) && @@ -110,7 +110,7 @@ type MetricType = Omit & { label?: string }; export const getMetricTooltipNode = ( metric: MetricType, - labelRef?: React.RefObject, + labelRef?: RefObject, ): ReactNode => { if ( !metric.verbose_name && diff --git a/superset-frontend/packages/superset-ui-chart-controls/src/sections/advancedAnalytics.tsx b/superset-frontend/packages/superset-ui-chart-controls/src/sections/advancedAnalytics.tsx index 926488f51e09c..606abbb759aa1 100644 --- a/superset-frontend/packages/superset-ui-chart-controls/src/sections/advancedAnalytics.tsx +++ b/superset-frontend/packages/superset-ui-chart-controls/src/sections/advancedAnalytics.tsx @@ -16,7 +16,6 @@ * specific language governing permissions and limitations * under the License. */ -import React from 'react'; import { t, RollingType, ComparisonType } from '@superset-ui/core'; import { ControlSubSectionHeader } from '../components/ControlSubSectionHeader'; diff --git a/superset-frontend/packages/superset-ui-chart-controls/src/sections/chartTitle.tsx b/superset-frontend/packages/superset-ui-chart-controls/src/sections/chartTitle.tsx index 0b824a327139a..e8cda4991fd17 100644 --- a/superset-frontend/packages/superset-ui-chart-controls/src/sections/chartTitle.tsx +++ b/superset-frontend/packages/superset-ui-chart-controls/src/sections/chartTitle.tsx @@ -16,7 +16,6 @@ * specific language governing permissions and limitations * under the License. */ -import React from 'react'; import { t } from '@superset-ui/core'; import { ControlSubSectionHeader } from '../components/ControlSubSectionHeader'; diff --git a/superset-frontend/packages/superset-ui-chart-controls/src/shared-controls/components/RadioButtonControl.tsx b/superset-frontend/packages/superset-ui-chart-controls/src/shared-controls/components/RadioButtonControl.tsx index 285b92e66e166..cd2a4352d1744 100644 --- a/superset-frontend/packages/superset-ui-chart-controls/src/shared-controls/components/RadioButtonControl.tsx +++ b/superset-frontend/packages/superset-ui-chart-controls/src/shared-controls/components/RadioButtonControl.tsx @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import React, { ReactNode } from 'react'; +import { ReactNode } from 'react'; import { JsonValue, useTheme } from '@superset-ui/core'; import ControlHeader from '../../components/ControlHeader'; diff --git a/superset-frontend/packages/superset-ui-chart-controls/src/shared-controls/dndControls.tsx b/superset-frontend/packages/superset-ui-chart-controls/src/shared-controls/dndControls.tsx index 4fd069873cb04..96124d6c67680 100644 --- a/superset-frontend/packages/superset-ui-chart-controls/src/shared-controls/dndControls.tsx +++ b/superset-frontend/packages/superset-ui-chart-controls/src/shared-controls/dndControls.tsx @@ -17,7 +17,6 @@ * specific language governing permissions and limitations * under the License. */ -import React from 'react'; import { QueryColumn, t, validateNonEmpty } from '@superset-ui/core'; import { ExtraControlProps, diff --git a/superset-frontend/packages/superset-ui-chart-controls/src/types.ts b/superset-frontend/packages/superset-ui-chart-controls/src/types.ts index fa8154677db93..900c9d544292a 100644 --- a/superset-frontend/packages/superset-ui-chart-controls/src/types.ts +++ b/superset-frontend/packages/superset-ui-chart-controls/src/types.ts @@ -17,7 +17,8 @@ * specific language governing permissions and limitations * under the License. */ -import React, { ReactElement, ReactNode, ReactText } from 'react'; +import { ReactElement, ReactNode, ReactText, ComponentType } from 'react'; + import type { AdhocColumn, Column, @@ -175,7 +176,7 @@ export type InternalControlType = | keyof SharedControlComponents; // expanded in `expandControlConfig` // eslint-disable-next-line @typescript-eslint/no-explicit-any -export type ControlType = InternalControlType | React.ComponentType; +export type ControlType = InternalControlType | ComponentType; export type TabOverride = 'data' | 'customize' | boolean; @@ -314,9 +315,7 @@ export type SharedControlConfig< /** -------------------------------------------- * Custom controls * --------------------------------------------- */ -export type CustomControlConfig

= BaseControlConfig< - React.ComponentType

-> & +export type CustomControlConfig

= BaseControlConfig> & // two run-time properties from superset-frontend/src/explore/components/Control.jsx Omit; diff --git a/superset-frontend/packages/superset-ui-chart-controls/src/utils/expandControlConfig.tsx b/superset-frontend/packages/superset-ui-chart-controls/src/utils/expandControlConfig.tsx index 3ff734984145d..57874ca568436 100644 --- a/superset-frontend/packages/superset-ui-chart-controls/src/utils/expandControlConfig.tsx +++ b/superset-frontend/packages/superset-ui-chart-controls/src/utils/expandControlConfig.tsx @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import React, { ReactElement } from 'react'; +import { isValidElement, ReactElement } from 'react'; import { sharedControls, sharedControlComponents } from '../shared-controls'; import { ControlType, @@ -63,11 +63,7 @@ export function expandControlConfig( }; } // JSX/React element or NULL - if ( - !control || - typeof control === 'string' || - React.isValidElement(control) - ) { + if (!control || typeof control === 'string' || isValidElement(control)) { return control as ReactElement; } // already fully expanded control config, e.g. diff --git a/superset-frontend/packages/superset-ui-chart-controls/test/components/ColumnOption.test.tsx b/superset-frontend/packages/superset-ui-chart-controls/test/components/ColumnOption.test.tsx index ff146862b8aff..2f3f8f7069f17 100644 --- a/superset-frontend/packages/superset-ui-chart-controls/test/components/ColumnOption.test.tsx +++ b/superset-frontend/packages/superset-ui-chart-controls/test/components/ColumnOption.test.tsx @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import React from 'react'; +import { isValidElement } from 'react'; import { shallow, ShallowWrapper } from 'enzyme'; import { GenericDataType } from '@superset-ui/core'; @@ -42,7 +42,7 @@ describe('ColumnOption', () => { props = { ...defaultProps }; }); it('is a valid element', () => { - expect(React.isValidElement()).toBe(true); + expect(isValidElement()).toBe(true); }); it('shows a label with verbose_name', () => { const lbl = wrapper.find('.option-label'); diff --git a/superset-frontend/packages/superset-ui-chart-controls/test/components/ColumnTypeLabel.test.tsx b/superset-frontend/packages/superset-ui-chart-controls/test/components/ColumnTypeLabel.test.tsx index 07cbfa7a23fb8..603ac9172ebe1 100644 --- a/superset-frontend/packages/superset-ui-chart-controls/test/components/ColumnTypeLabel.test.tsx +++ b/superset-frontend/packages/superset-ui-chart-controls/test/components/ColumnTypeLabel.test.tsx @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import React from 'react'; +import { isValidElement } from 'react'; import { render, screen } from '@testing-library/react'; import '@testing-library/jest-dom'; import { GenericDataType } from '@superset-ui/core'; @@ -35,9 +35,7 @@ describe('ColumnOption', () => { } it('is a valid element', () => { - expect(React.isValidElement()).toBe( - true, - ); + expect(isValidElement()).toBe(true); }); it('string type shows ABC icon', () => { renderColumnTypeLabel({ type: GenericDataType.String }); diff --git a/superset-frontend/packages/superset-ui-chart-controls/test/components/InfoTooltipWithTrigger.test.tsx b/superset-frontend/packages/superset-ui-chart-controls/test/components/InfoTooltipWithTrigger.test.tsx index 06bee2af52753..33e2d8c7f2562 100644 --- a/superset-frontend/packages/superset-ui-chart-controls/test/components/InfoTooltipWithTrigger.test.tsx +++ b/superset-frontend/packages/superset-ui-chart-controls/test/components/InfoTooltipWithTrigger.test.tsx @@ -16,7 +16,6 @@ * specific language governing permissions and limitations * under the License. */ -import React from 'react'; import { shallow } from 'enzyme'; import { Tooltip } from '../../src/components/Tooltip'; import { InfoTooltipWithTrigger } from '../../src'; diff --git a/superset-frontend/packages/superset-ui-chart-controls/test/components/MetricOption.test.tsx b/superset-frontend/packages/superset-ui-chart-controls/test/components/MetricOption.test.tsx index 59ba64c7bfe6f..929d6db8aca20 100644 --- a/superset-frontend/packages/superset-ui-chart-controls/test/components/MetricOption.test.tsx +++ b/superset-frontend/packages/superset-ui-chart-controls/test/components/MetricOption.test.tsx @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import React from 'react'; +import { isValidElement } from 'react'; import { shallow, ShallowWrapper } from 'enzyme'; import { MetricOption, MetricOptionProps } from '../../src'; @@ -44,7 +44,7 @@ describe('MetricOption', () => { props = { ...defaultProps }; }); it('is a valid element', () => { - expect(React.isValidElement()).toBe(true); + expect(isValidElement()).toBe(true); }); it('shows a label with verbose_name', () => { const lbl = wrapper.find('.option-label'); diff --git a/superset-frontend/packages/superset-ui-chart-controls/test/components/labelUtils.test.tsx b/superset-frontend/packages/superset-ui-chart-controls/test/components/labelUtils.test.tsx index 8fd0bf267da23..d32081b8988b8 100644 --- a/superset-frontend/packages/superset-ui-chart-controls/test/components/labelUtils.test.tsx +++ b/superset-frontend/packages/superset-ui-chart-controls/test/components/labelUtils.test.tsx @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import React, { ReactElement } from 'react'; +import { ReactElement } from 'react'; import { render, screen } from '@testing-library/react'; import '@testing-library/jest-dom'; import { ThemeProvider, supersetTheme } from '@superset-ui/core'; diff --git a/superset-frontend/packages/superset-ui-chart-controls/test/utils/expandControlConfig.test.tsx b/superset-frontend/packages/superset-ui-chart-controls/test/utils/expandControlConfig.test.tsx index d2dae0595f710..db9b01a6ddef9 100644 --- a/superset-frontend/packages/superset-ui-chart-controls/test/utils/expandControlConfig.test.tsx +++ b/superset-frontend/packages/superset-ui-chart-controls/test/utils/expandControlConfig.test.tsx @@ -16,7 +16,6 @@ * specific language governing permissions and limitations * under the License. */ -import React from 'react'; import { expandControlConfig, sharedControls, diff --git a/superset-frontend/packages/superset-ui-core/src/chart-composition/ChartFrame.tsx b/superset-frontend/packages/superset-ui-core/src/chart-composition/ChartFrame.tsx index 784097b4b6b96..88cf52ec72fde 100644 --- a/superset-frontend/packages/superset-ui-core/src/chart-composition/ChartFrame.tsx +++ b/superset-frontend/packages/superset-ui-core/src/chart-composition/ChartFrame.tsx @@ -17,7 +17,8 @@ * under the License. */ -import React, { PureComponent } from 'react'; +import { PureComponent, ReactNode } from 'react'; + import { isDefined } from '../utils'; function checkNumber(input: unknown): input is number { @@ -34,7 +35,7 @@ type Props = { }: { height: number; width: number; - }) => React.ReactNode; + }) => ReactNode; width: number; }; diff --git a/superset-frontend/packages/superset-ui-core/src/chart-composition/legend/WithLegend.tsx b/superset-frontend/packages/superset-ui-core/src/chart-composition/legend/WithLegend.tsx index 4e2ae2a79603e..cb5dba1c2b361 100644 --- a/superset-frontend/packages/superset-ui-core/src/chart-composition/legend/WithLegend.tsx +++ b/superset-frontend/packages/superset-ui-core/src/chart-composition/legend/WithLegend.tsx @@ -17,7 +17,7 @@ * under the License. */ -import React, { CSSProperties, ReactNode, PureComponent } from 'react'; +import { CSSProperties, ReactNode, PureComponent } from 'react'; import { ParentSize } from '@vx/responsive'; const defaultProps = { diff --git a/superset-frontend/packages/superset-ui-core/src/chart-composition/tooltip/TooltipFrame.tsx b/superset-frontend/packages/superset-ui-core/src/chart-composition/tooltip/TooltipFrame.tsx index 239308708de1d..d470a229403fd 100644 --- a/superset-frontend/packages/superset-ui-core/src/chart-composition/tooltip/TooltipFrame.tsx +++ b/superset-frontend/packages/superset-ui-core/src/chart-composition/tooltip/TooltipFrame.tsx @@ -17,7 +17,7 @@ * under the License. */ -import React, { PureComponent } from 'react'; +import { PureComponent, ReactNode } from 'react'; const defaultProps = { className: '', @@ -25,7 +25,7 @@ const defaultProps = { type Props = { className?: string; - children: React.ReactNode; + children: ReactNode; } & Readonly; const CONTAINER_STYLE = { padding: 8 }; diff --git a/superset-frontend/packages/superset-ui-core/src/chart-composition/tooltip/TooltipTable.tsx b/superset-frontend/packages/superset-ui-core/src/chart-composition/tooltip/TooltipTable.tsx index ecb2074999411..4952d821f1aa0 100644 --- a/superset-frontend/packages/superset-ui-core/src/chart-composition/tooltip/TooltipTable.tsx +++ b/superset-frontend/packages/superset-ui-core/src/chart-composition/tooltip/TooltipTable.tsx @@ -17,7 +17,7 @@ * under the License. */ -import React, { CSSProperties, PureComponent, ReactNode } from 'react'; +import { CSSProperties, PureComponent, ReactNode } from 'react'; interface TooltipRowData { key: string | number; diff --git a/superset-frontend/packages/superset-ui-core/src/chart/components/ChartDataProvider.tsx b/superset-frontend/packages/superset-ui-core/src/chart/components/ChartDataProvider.tsx index b77a13744b554..457bdd9fefb65 100644 --- a/superset-frontend/packages/superset-ui-core/src/chart/components/ChartDataProvider.tsx +++ b/superset-frontend/packages/superset-ui-core/src/chart/components/ChartDataProvider.tsx @@ -18,7 +18,7 @@ */ /* eslint react/sort-comp: 'off' */ -import React, { ReactNode } from 'react'; +import { PureComponent, ReactNode } from 'react'; import { SupersetClientInterface, RequestConfig, @@ -67,7 +67,7 @@ export type ChartDataProviderState = { error?: ProvidedProps['error']; }; -class ChartDataProvider extends React.PureComponent< +class ChartDataProvider extends PureComponent< ChartDataProviderProps, ChartDataProviderState > { diff --git a/superset-frontend/packages/superset-ui-core/src/chart/components/FallbackComponent.tsx b/superset-frontend/packages/superset-ui-core/src/chart/components/FallbackComponent.tsx index f7dcd8306e649..60f6848f882f2 100644 --- a/superset-frontend/packages/superset-ui-core/src/chart/components/FallbackComponent.tsx +++ b/superset-frontend/packages/superset-ui-core/src/chart/components/FallbackComponent.tsx @@ -17,7 +17,6 @@ * under the License. */ -import React from 'react'; import { t } from '@superset-ui/core'; import { SupersetTheme } from '../../style'; import { FallbackPropsWithDimension } from './SuperChart'; diff --git a/superset-frontend/packages/superset-ui-core/src/chart/components/NoResultsComponent.tsx b/superset-frontend/packages/superset-ui-core/src/chart/components/NoResultsComponent.tsx index a5fc5d962d8f3..73e8df625843e 100644 --- a/superset-frontend/packages/superset-ui-core/src/chart/components/NoResultsComponent.tsx +++ b/superset-frontend/packages/superset-ui-core/src/chart/components/NoResultsComponent.tsx @@ -17,7 +17,7 @@ * under the License. */ -import React, { CSSProperties } from 'react'; +import { CSSProperties } from 'react'; import { css, styled } from '../../style'; import { t } from '../../translation'; diff --git a/superset-frontend/packages/superset-ui-core/src/chart/components/SuperChart.tsx b/superset-frontend/packages/superset-ui-core/src/chart/components/SuperChart.tsx index 7b5d159a82aaa..473a3506a411e 100644 --- a/superset-frontend/packages/superset-ui-core/src/chart/components/SuperChart.tsx +++ b/superset-frontend/packages/superset-ui-core/src/chart/components/SuperChart.tsx @@ -17,7 +17,14 @@ * under the License. */ -import React, { ReactNode, RefObject } from 'react'; +import { + ReactNode, + RefObject, + ComponentType, + PureComponent, + Fragment, +} from 'react'; + import ErrorBoundary, { ErrorBoundaryProps, FallbackProps, @@ -58,7 +65,7 @@ export type Props = Omit & /** enable "No Results" message if empty result set */ enableNoResults?: boolean; /** Component to render when there are unexpected errors */ - FallbackComponent?: React.ComponentType; + FallbackComponent?: ComponentType; /** Event listener for unexpected errors from chart */ onErrorBoundary?: ErrorBoundaryProps['onError']; /** Prop for form plugins using superchart */ @@ -80,7 +87,7 @@ export type Props = Omit & * when using dynamic width or height * because it will clash with auto-sizing. */ - Wrapper?: React.ComponentType; + Wrapper?: ComponentType; /** * Component to display when query returns no results. * If not defined, NoResultsComponent is used @@ -94,7 +101,7 @@ export type Props = Omit & type PropsWithDefault = Props & Readonly; -class SuperChart extends React.PureComponent { +class SuperChart extends PureComponent { /** * SuperChart's core */ @@ -131,7 +138,7 @@ class SuperChart extends React.PureComponent { heightInfo.isDynamic && widthInfo.multiplier === 1 && heightInfo.multiplier === 1 - ? React.Fragment + ? Fragment : ({ children }: { children: ReactNode }) => (

{children}
); diff --git a/superset-frontend/packages/superset-ui-core/src/chart/components/SuperChartCore.tsx b/superset-frontend/packages/superset-ui-core/src/chart/components/SuperChartCore.tsx index 1cec9d68f4f2e..f980ed13cf05f 100644 --- a/superset-frontend/packages/superset-ui-core/src/chart/components/SuperChartCore.tsx +++ b/superset-frontend/packages/superset-ui-core/src/chart/components/SuperChartCore.tsx @@ -18,7 +18,7 @@ */ /* eslint-disable react/jsx-sort-default-props */ -import * as React from 'react'; +import { PureComponent } from 'react'; import { t } from '@superset-ui/core'; import { createSelector } from 'reselect'; import getChartComponentRegistry from '../registries/ChartComponentRegistrySingleton'; @@ -78,7 +78,7 @@ export type Props = { onRenderFailure?: HandlerFunction; }; -export default class SuperChartCore extends React.PureComponent { +export default class SuperChartCore extends PureComponent { /** * The HTML element that wraps all chart content */ diff --git a/superset-frontend/packages/superset-ui-core/src/chart/components/createLoadableRenderer.ts b/superset-frontend/packages/superset-ui-core/src/chart/components/createLoadableRenderer.ts index da2e98d2437e1..637fefcac7547 100644 --- a/superset-frontend/packages/superset-ui-core/src/chart/components/createLoadableRenderer.ts +++ b/superset-frontend/packages/superset-ui-core/src/chart/components/createLoadableRenderer.ts @@ -18,6 +18,7 @@ */ import Loadable from 'react-loadable'; +import { ComponentClass } from 'react'; export type LoadableRendererProps = { onRenderFailure?: Function; @@ -30,7 +31,7 @@ const defaultProps = { }; export interface LoadableRenderer - extends React.ComponentClass, + extends ComponentClass, Loadable.LoadableComponent {} export default function createLoadableRenderer< diff --git a/superset-frontend/packages/superset-ui-core/src/chart/components/reactify.tsx b/superset-frontend/packages/superset-ui-core/src/chart/components/reactify.tsx index b3638fe8831e7..0a1bee16c5438 100644 --- a/superset-frontend/packages/superset-ui-core/src/chart/components/reactify.tsx +++ b/superset-frontend/packages/superset-ui-core/src/chart/components/reactify.tsx @@ -17,7 +17,8 @@ * under the License. */ -import React from 'react'; +// eslint-disable-next-line no-restricted-syntax -- whole React import is required for `reactify.test.tsx` Jest test passing. +import React, { Component, ComponentClass, WeakValidationMap } from 'react'; // TODO: Note that id and className can collide between Props and ReactifyProps // leading to (likely) unexpected behaviors. We should either require Props to not @@ -45,14 +46,14 @@ export interface RenderFuncType { (container: HTMLDivElement, props: Readonly): void; displayName?: string; defaultProps?: Partial; - propTypes?: React.WeakValidationMap; + propTypes?: WeakValidationMap; } export default function reactify( renderFn: RenderFuncType, callbacks?: LifeCycleCallbacks, -): React.ComponentClass { - class ReactifiedComponent extends React.Component { +): ComponentClass { + class ReactifiedComponent extends Component { container?: HTMLDivElement; constructor(props: Props & ReactifyProps) { @@ -92,7 +93,7 @@ export default function reactify( } } - const ReactifiedClass: React.ComponentClass = + const ReactifiedClass: ComponentClass = ReactifiedComponent; if (renderFn.displayName) { diff --git a/superset-frontend/packages/superset-ui-core/src/components/SafeMarkdown.tsx b/superset-frontend/packages/superset-ui-core/src/components/SafeMarkdown.tsx index e7fbe9ee5e11e..b5ed0d9941ffd 100644 --- a/superset-frontend/packages/superset-ui-core/src/components/SafeMarkdown.tsx +++ b/superset-frontend/packages/superset-ui-core/src/components/SafeMarkdown.tsx @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import React, { useMemo } from 'react'; +import { useMemo } from 'react'; import ReactMarkdown from 'react-markdown'; import rehypeSanitize, { defaultSchema } from 'rehype-sanitize'; import rehypeRaw from 'rehype-raw'; diff --git a/superset-frontend/packages/superset-ui-core/src/hooks/useElementOnScreen/useElementOnScreen.test.ts b/superset-frontend/packages/superset-ui-core/src/hooks/useElementOnScreen/useElementOnScreen.test.ts index ef105208e0c66..9a8321d4edb73 100644 --- a/superset-frontend/packages/superset-ui-core/src/hooks/useElementOnScreen/useElementOnScreen.test.ts +++ b/superset-frontend/packages/superset-ui-core/src/hooks/useElementOnScreen/useElementOnScreen.test.ts @@ -17,7 +17,6 @@ * under the License. */ import { renderHook } from '@testing-library/react-hooks'; -import React from 'react'; import { useElementOnScreen } from './useElementOnScreen'; const observeMock = jest.fn(); @@ -67,7 +66,7 @@ test('should return isSticky as false when intersectionRatio >= 1', async () => }); test('should observe and unobserve element with IntersectionObserver', async () => { - jest.spyOn(React, 'useRef').mockReturnValue({ current: 'test' }); + jest.spyOn(global.React, 'useRef').mockReturnValue({ current: 'test' }); const options = { threshold: 0.5 }; const { result, unmount } = renderHook(() => useElementOnScreen(options)); const [elementRef] = result.current; @@ -86,7 +85,7 @@ test('should observe and unobserve element with IntersectionObserver', async () }); test('should not observe an element if it is null', () => { - jest.spyOn(React, 'useRef').mockReturnValue({ current: null }); + jest.spyOn(global.React, 'useRef').mockReturnValue({ current: null }); const options = {}; const { result } = renderHook(() => useElementOnScreen(options)); const [ref, isSticky] = result.current; @@ -97,7 +96,7 @@ test('should not observe an element if it is null', () => { }); test('should not unobserve the element if it is null', () => { - jest.spyOn(React, 'useRef').mockReturnValue({ current: null }); + jest.spyOn(global.React, 'useRef').mockReturnValue({ current: null }); const options = {}; const { result, unmount } = renderHook(() => useElementOnScreen(options)); const [ref, isSticky] = result.current; diff --git a/superset-frontend/packages/superset-ui-core/src/hooks/useTruncation/useCSSTextTruncation.test.tsx b/superset-frontend/packages/superset-ui-core/src/hooks/useTruncation/useCSSTextTruncation.test.tsx index 96a46734d7b0a..02dff90621e6b 100644 --- a/superset-frontend/packages/superset-ui-core/src/hooks/useTruncation/useCSSTextTruncation.test.tsx +++ b/superset-frontend/packages/superset-ui-core/src/hooks/useTruncation/useCSSTextTruncation.test.tsx @@ -17,7 +17,6 @@ * under the License. */ import { renderHook } from '@testing-library/react-hooks'; -import React from 'react'; import useCSSTextTruncation from './useCSSTextTruncation'; afterEach(() => { @@ -37,7 +36,7 @@ test('should not truncate', () => { const ref = { current: document.createElement('p') }; Object.defineProperty(ref.current, 'offsetWidth', { get: () => 100 }); Object.defineProperty(ref.current, 'scrollWidth', { get: () => 50 }); - jest.spyOn(React, 'useRef').mockReturnValue({ current: ref.current }); + jest.spyOn(global.React, 'useRef').mockReturnValue({ current: ref.current }); const { result } = renderHook(() => useCSSTextTruncation(), @@ -51,7 +50,7 @@ test('should truncate', () => { const ref = { current: document.createElement('p') }; Object.defineProperty(ref.current, 'offsetWidth', { get: () => 50 }); Object.defineProperty(ref.current, 'scrollWidth', { get: () => 100 }); - jest.spyOn(React, 'useRef').mockReturnValue({ current: ref.current }); + jest.spyOn(global.React, 'useRef').mockReturnValue({ current: ref.current }); const { result } = renderHook(() => useCSSTextTruncation(), diff --git a/superset-frontend/packages/superset-ui-core/src/hooks/useTruncation/useCSSTextTruncation.ts b/superset-frontend/packages/superset-ui-core/src/hooks/useTruncation/useCSSTextTruncation.ts index a591766fbb2c7..335e26a2263fe 100644 --- a/superset-frontend/packages/superset-ui-core/src/hooks/useTruncation/useCSSTextTruncation.ts +++ b/superset-frontend/packages/superset-ui-core/src/hooks/useTruncation/useCSSTextTruncation.ts @@ -18,7 +18,7 @@ */ import { css } from '@emotion/react'; -import React, { useEffect, useRef, useState } from 'react'; +import { useEffect, useRef, useState, RefObject } from 'react'; /** * Importable CSS that enables text truncation on fixed-width block @@ -37,7 +37,7 @@ export const truncationCSS = css` * element and a boolean for whether that element is currently truncated. */ const useCSSTextTruncation = (): [ - React.RefObject, + RefObject, boolean, ] => { const [isTruncated, setIsTruncated] = useState(true); diff --git a/superset-frontend/packages/superset-ui-core/src/ui-overrides/types.ts b/superset-frontend/packages/superset-ui-core/src/ui-overrides/types.ts index 736a57da900a3..bd2fa9047c7be 100644 --- a/superset-frontend/packages/superset-ui-core/src/ui-overrides/types.ts +++ b/superset-frontend/packages/superset-ui-core/src/ui-overrides/types.ts @@ -16,14 +16,19 @@ * specific language governing permissions and limitations * under the License. */ -import React, { ReactNode, MouseEventHandler } from 'react'; +import { + ReactNode, + MouseEventHandler, + ReactElement, + ComponentType, +} from 'react'; import type { Editor } from 'brace'; /** * A function which returns text (or marked-up text) * If what you want is a react component, don't use this. Use React.ComponentType instead. */ -type ReturningDisplayable

= (props: P) => string | React.ReactElement; +type ReturningDisplayable

= (props: P) => string | ReactElement; /** * This type defines all available extensions of Superset's default UI. @@ -82,15 +87,15 @@ export interface DatabaseConnectionExtension { /** * url or dataURI (recommended) of a logo to use in place of a title. title is fallback display if no logo is provided */ - logo?: React.ComponentType; + logo?: ComponentType; /** * Descriptive text displayed under the logo or title to provide user with more context about the configuration section */ - description: React.ComponentType; + description: ComponentType; /** * React component to render for display in the database connection configuration */ - component: React.ComponentType; + component: ComponentType; /** * Is the database extension enabled? */ @@ -187,28 +192,28 @@ export interface CustomAutocomplete extends AutocompleteItem { } export type Extensions = Partial<{ - 'alertsreports.header.icon': React.ComponentType; - 'embedded.documentation.configuration_details': React.ComponentType; + 'alertsreports.header.icon': ComponentType; + 'embedded.documentation.configuration_details': ComponentType; 'embedded.documentation.description': ReturningDisplayable; 'embedded.documentation.url': string; - 'embedded.modal': React.ComponentType; - 'dashboard.nav.right': React.ComponentType; - 'home.submenu': React.ComponentType; - 'navbar.right-menu.item.icon': React.ComponentType; - 'navbar.right': React.ComponentType; - 'report-modal.dropdown.item.icon': React.ComponentType; - 'root.context.provider': React.ComponentType; - 'welcome.message': React.ComponentType; - 'welcome.banner': React.ComponentType; - 'welcome.main.replacement': React.ComponentType; - 'ssh_tunnel.form.switch': React.ComponentType; + 'embedded.modal': ComponentType; + 'dashboard.nav.right': ComponentType; + 'home.submenu': ComponentType; + 'navbar.right-menu.item.icon': ComponentType; + 'navbar.right': ComponentType; + 'report-modal.dropdown.item.icon': ComponentType; + 'root.context.provider': ComponentType; + 'welcome.message': ComponentType; + 'welcome.banner': ComponentType; + 'welcome.main.replacement': ComponentType; + 'ssh_tunnel.form.switch': ComponentType; 'databaseconnection.extraOption': DatabaseConnectionExtension; /* Custom components to show in the database and dataset delete modals */ - 'database.delete.related': React.ComponentType; - 'dataset.delete.related': React.ComponentType; - 'sqleditor.extension.form': React.ComponentType; - 'sqleditor.extension.resultTable': React.ComponentType; - 'dashboard.slice.header': React.ComponentType; + 'database.delete.related': ComponentType; + 'dataset.delete.related': ComponentType; + 'sqleditor.extension.form': ComponentType; + 'sqleditor.extension.resultTable': ComponentType; + 'dashboard.slice.header': ComponentType; 'sqleditor.extension.customAutocomplete': ( args: CustomAutoCompleteArgs, ) => CustomAutocomplete[] | undefined; diff --git a/superset-frontend/packages/superset-ui-core/src/utils/html.test.tsx b/superset-frontend/packages/superset-ui-core/src/utils/html.test.tsx index 9b950e4246e92..9cd716259f12c 100644 --- a/superset-frontend/packages/superset-ui-core/src/utils/html.test.tsx +++ b/superset-frontend/packages/superset-ui-core/src/utils/html.test.tsx @@ -16,7 +16,6 @@ * specific language governing permissions and limitations * under the License. */ -import React from 'react'; import { sanitizeHtml, isProbablyHTML, diff --git a/superset-frontend/packages/superset-ui-core/src/utils/html.tsx b/superset-frontend/packages/superset-ui-core/src/utils/html.tsx index 95695ed5877f5..66c6023a337fc 100644 --- a/superset-frontend/packages/superset-ui-core/src/utils/html.tsx +++ b/superset-frontend/packages/superset-ui-core/src/utils/html.tsx @@ -16,7 +16,6 @@ * specific language governing permissions and limitations * under the License. */ -import React from 'react'; import { FilterXSS, getDefaultWhiteList } from 'xss'; const xssFilter = new FilterXSS({ diff --git a/superset-frontend/packages/superset-ui-core/test/chart-composition/ChartFrame.test.tsx b/superset-frontend/packages/superset-ui-core/test/chart-composition/ChartFrame.test.tsx index a2573c4208b63..4125bc0161ea1 100644 --- a/superset-frontend/packages/superset-ui-core/test/chart-composition/ChartFrame.test.tsx +++ b/superset-frontend/packages/superset-ui-core/test/chart-composition/ChartFrame.test.tsx @@ -17,7 +17,6 @@ * under the License. */ -import React from 'react'; import { render } from '@testing-library/react'; import '@testing-library/jest-dom'; import { ChartFrame } from '@superset-ui/core'; diff --git a/superset-frontend/packages/superset-ui-core/test/chart-composition/legend/WithLegend.test.tsx b/superset-frontend/packages/superset-ui-core/test/chart-composition/legend/WithLegend.test.tsx index ebb53366987c9..4f6f909f9ce17 100644 --- a/superset-frontend/packages/superset-ui-core/test/chart-composition/legend/WithLegend.test.tsx +++ b/superset-frontend/packages/superset-ui-core/test/chart-composition/legend/WithLegend.test.tsx @@ -17,7 +17,6 @@ * under the License. */ -import React from 'react'; import { mount, shallow } from 'enzyme'; import { triggerResizeObserver } from 'resize-observer-polyfill'; import { promiseTimeout, WithLegend } from '@superset-ui/core'; diff --git a/superset-frontend/packages/superset-ui-core/test/chart-composition/tooltip/TooltipFrame.test.tsx b/superset-frontend/packages/superset-ui-core/test/chart-composition/tooltip/TooltipFrame.test.tsx index c2db1c36148db..f46d09d531b63 100644 --- a/superset-frontend/packages/superset-ui-core/test/chart-composition/tooltip/TooltipFrame.test.tsx +++ b/superset-frontend/packages/superset-ui-core/test/chart-composition/tooltip/TooltipFrame.test.tsx @@ -17,7 +17,6 @@ * under the License. */ -import React from 'react'; import { shallow } from 'enzyme'; import { TooltipFrame } from '@superset-ui/core'; diff --git a/superset-frontend/packages/superset-ui-core/test/chart-composition/tooltip/TooltipTable.test.tsx b/superset-frontend/packages/superset-ui-core/test/chart-composition/tooltip/TooltipTable.test.tsx index b339bab537208..ebd3f0d073de7 100644 --- a/superset-frontend/packages/superset-ui-core/test/chart-composition/tooltip/TooltipTable.test.tsx +++ b/superset-frontend/packages/superset-ui-core/test/chart-composition/tooltip/TooltipTable.test.tsx @@ -17,7 +17,6 @@ * under the License. */ -import React from 'react'; import { shallow } from 'enzyme'; import { TooltipTable } from '@superset-ui/core'; diff --git a/superset-frontend/packages/superset-ui-core/test/chart/components/ChartDataProvider.test.tsx b/superset-frontend/packages/superset-ui-core/test/chart/components/ChartDataProvider.test.tsx index 8423ee99ad406..390263fd11552 100644 --- a/superset-frontend/packages/superset-ui-core/test/chart/components/ChartDataProvider.test.tsx +++ b/superset-frontend/packages/superset-ui-core/test/chart/components/ChartDataProvider.test.tsx @@ -17,7 +17,7 @@ * under the License. */ -import React from 'react'; +import { ReactNode } from 'react'; import { shallow } from 'enzyme'; import ChartClient from '../../../src/chart/clients/ChartClient'; import ChartDataProvider, { @@ -210,7 +210,7 @@ describe('ChartDataProvider', () => { describe('children', () => { it('calls children({ loading: true }) when loading', () => { - const children = jest.fn(); + const children = jest.fn(); setup({ children }); // during the first tick (before more promises resolve) loading is true @@ -221,7 +221,7 @@ describe('ChartDataProvider', () => { it('calls children({ payload }) when loaded', () => new Promise(done => { expect.assertions(2); - const children = jest.fn(); + const children = jest.fn(); setup({ children, loadDatasource: true }); setTimeout(() => { @@ -240,7 +240,7 @@ describe('ChartDataProvider', () => { it('calls children({ error }) upon request error', () => new Promise(done => { expect.assertions(2); - const children = jest.fn(); + const children = jest.fn(); mockLoadFormData = jest.fn(() => Promise.reject(new Error('error'))); setup({ children }); @@ -257,7 +257,7 @@ describe('ChartDataProvider', () => { it('calls children({ error }) upon JS error', () => new Promise(done => { expect.assertions(2); - const children = jest.fn(); + const children = jest.fn(); mockLoadFormData = jest.fn(() => { throw new Error('non-async error'); diff --git a/superset-frontend/packages/superset-ui-core/test/chart/components/FallbackComponent.test.tsx b/superset-frontend/packages/superset-ui-core/test/chart/components/FallbackComponent.test.tsx index eadb552988ea9..2a52c62e5e8ec 100644 --- a/superset-frontend/packages/superset-ui-core/test/chart/components/FallbackComponent.test.tsx +++ b/superset-frontend/packages/superset-ui-core/test/chart/components/FallbackComponent.test.tsx @@ -17,7 +17,6 @@ * under the License. */ -import React from 'react'; import { render } from '@testing-library/react'; import '@testing-library/jest-dom'; import { FallbackProps } from 'react-error-boundary'; diff --git a/superset-frontend/packages/superset-ui-core/test/chart/components/MockChartPlugins.tsx b/superset-frontend/packages/superset-ui-core/test/chart/components/MockChartPlugins.tsx index d16557981e0ed..45e46289c056b 100644 --- a/superset-frontend/packages/superset-ui-core/test/chart/components/MockChartPlugins.tsx +++ b/superset-frontend/packages/superset-ui-core/test/chart/components/MockChartPlugins.tsx @@ -18,7 +18,6 @@ */ /* eslint-disable max-classes-per-file */ -import React from 'react'; import { QueryFormData, ChartMetadata, diff --git a/superset-frontend/packages/superset-ui-core/test/chart/components/NoResultsComponent.test.tsx b/superset-frontend/packages/superset-ui-core/test/chart/components/NoResultsComponent.test.tsx index fa4a3787f4e26..f736d44b99578 100644 --- a/superset-frontend/packages/superset-ui-core/test/chart/components/NoResultsComponent.test.tsx +++ b/superset-frontend/packages/superset-ui-core/test/chart/components/NoResultsComponent.test.tsx @@ -17,7 +17,6 @@ * under the License. */ -import React from 'react'; import { render, screen } from '@testing-library/react'; import '@testing-library/jest-dom'; import { ThemeProvider, supersetTheme } from '../../../src/style'; diff --git a/superset-frontend/packages/superset-ui-core/test/chart/components/SuperChart.test.tsx b/superset-frontend/packages/superset-ui-core/test/chart/components/SuperChart.test.tsx index 2233250f68ef4..a602279ba8761 100644 --- a/superset-frontend/packages/superset-ui-core/test/chart/components/SuperChart.test.tsx +++ b/superset-frontend/packages/superset-ui-core/test/chart/components/SuperChart.test.tsx @@ -17,7 +17,7 @@ * under the License. */ -import React, { ReactElement } from 'react'; +import { ReactElement } from 'react'; import mockConsole, { RestoreConsole } from 'jest-mock-console'; import { triggerResizeObserver } from 'resize-observer-polyfill'; import ErrorBoundary from 'react-error-boundary'; diff --git a/superset-frontend/packages/superset-ui-core/test/chart/components/SuperChartCore.test.tsx b/superset-frontend/packages/superset-ui-core/test/chart/components/SuperChartCore.test.tsx index d3b808c050796..956422f8f2c28 100644 --- a/superset-frontend/packages/superset-ui-core/test/chart/components/SuperChartCore.test.tsx +++ b/superset-frontend/packages/superset-ui-core/test/chart/components/SuperChartCore.test.tsx @@ -17,7 +17,7 @@ * under the License. */ -import React, { ReactElement, ReactNode } from 'react'; +import { ReactElement, ReactNode } from 'react'; import { mount } from 'enzyme'; import mockConsole, { RestoreConsole } from 'jest-mock-console'; import { diff --git a/superset-frontend/packages/superset-ui-core/test/chart/components/createLoadableRenderer.test.tsx b/superset-frontend/packages/superset-ui-core/test/chart/components/createLoadableRenderer.test.tsx index b1eecf5f87fa1..7057b74071297 100644 --- a/superset-frontend/packages/superset-ui-core/test/chart/components/createLoadableRenderer.test.tsx +++ b/superset-frontend/packages/superset-ui-core/test/chart/components/createLoadableRenderer.test.tsx @@ -17,7 +17,7 @@ * under the License. */ -import React from 'react'; +import { ComponentType } from 'react'; import { shallow } from 'enzyme'; import mockConsole, { RestoreConsole } from 'jest-mock-console'; import createLoadableRenderer, { @@ -29,7 +29,7 @@ describe('createLoadableRenderer', () => { return

test
; } let loadChartSuccess = jest.fn(() => Promise.resolve(TestComponent)); - let render: (loaded: { Chart: React.ComponentType }) => JSX.Element; + let render: (loaded: { Chart: ComponentType }) => JSX.Element; let loading: () => JSX.Element; let LoadableRenderer: LoadableRendererType<{}>; let restoreConsole: RestoreConsole; diff --git a/superset-frontend/packages/superset-ui-core/test/chart/components/reactify.test.tsx b/superset-frontend/packages/superset-ui-core/test/chart/components/reactify.test.tsx index 3277a6fece55e..db74801bac53a 100644 --- a/superset-frontend/packages/superset-ui-core/test/chart/components/reactify.test.tsx +++ b/superset-frontend/packages/superset-ui-core/test/chart/components/reactify.test.tsx @@ -18,7 +18,7 @@ */ import PropTypes from 'prop-types'; -import React from 'react'; +import { PureComponent } from 'react'; import { mount } from 'enzyme'; import { reactify } from '@superset-ui/core'; import { RenderFuncType } from '../../../src/chart/components/reactify'; @@ -51,7 +51,7 @@ describe('reactify(renderFn)', () => { componentWillUnmount: willUnmountCb, }); - class TestComponent extends React.PureComponent<{}, { content: string }> { + class TestComponent extends PureComponent<{}, { content: string }> { constructor(props = {}) { super(props); this.state = { content: 'abc' }; @@ -70,7 +70,7 @@ describe('reactify(renderFn)', () => { } } - class AnotherTestComponent extends React.PureComponent<{}, {}> { + class AnotherTestComponent extends PureComponent<{}, {}> { render() { return ; } diff --git a/superset-frontend/packages/superset-ui-core/test/chart/models/ChartPlugin.test.tsx b/superset-frontend/packages/superset-ui-core/test/chart/models/ChartPlugin.test.tsx index 6a8f5f518f47d..9a38b0f24acdf 100644 --- a/superset-frontend/packages/superset-ui-core/test/chart/models/ChartPlugin.test.tsx +++ b/superset-frontend/packages/superset-ui-core/test/chart/models/ChartPlugin.test.tsx @@ -17,7 +17,6 @@ * under the License. */ -import React from 'react'; import { ChartPlugin, ChartMetadata, diff --git a/superset-frontend/packages/superset-ui-core/test/style/index.test.tsx b/superset-frontend/packages/superset-ui-core/test/style/index.test.tsx index 2c30eb8b79907..6d747f7d8b94d 100644 --- a/superset-frontend/packages/superset-ui-core/test/style/index.test.tsx +++ b/superset-frontend/packages/superset-ui-core/test/style/index.test.tsx @@ -17,7 +17,6 @@ * under the License. */ -import React from 'react'; import { mount } from 'enzyme'; import { styled, diff --git a/superset-frontend/packages/superset-ui-core/test/utils/logging.test.ts b/superset-frontend/packages/superset-ui-core/test/utils/logging.test.ts index cdf4df89cf377..1bd356f1a0ce5 100644 --- a/superset-frontend/packages/superset-ui-core/test/utils/logging.test.ts +++ b/superset-frontend/packages/superset-ui-core/test/utils/logging.test.ts @@ -57,10 +57,6 @@ describe('logging', () => { Object.assign(window, { console: undefined }); const { logging } = require('@superset-ui/core'); - afterAll(() => { - Object.assign(window, { console }); - }); - expect(() => { logging.debug(); logging.log(); @@ -73,5 +69,6 @@ describe('logging', () => { [3, 4], ]); }).not.toThrow(); + Object.assign(window, { console }); }); }); diff --git a/superset-frontend/packages/superset-ui-demo/.storybook/themeDecorator.js b/superset-frontend/packages/superset-ui-demo/.storybook/themeDecorator.js index 7f9936788523a..5363c9c327534 100644 --- a/superset-frontend/packages/superset-ui-demo/.storybook/themeDecorator.js +++ b/superset-frontend/packages/superset-ui-demo/.storybook/themeDecorator.js @@ -1,5 +1,4 @@ // themeDecorator.js -import React from 'react'; import { supersetTheme, ThemeProvider } from '@superset-ui/core'; const ThemeDecorator = Story => ( diff --git a/superset-frontend/packages/superset-ui-demo/storybook/shared/components/ErrorMessage.tsx b/superset-frontend/packages/superset-ui-demo/storybook/shared/components/ErrorMessage.tsx index 771347ebc4946..ad5090d8315f3 100644 --- a/superset-frontend/packages/superset-ui-demo/storybook/shared/components/ErrorMessage.tsx +++ b/superset-frontend/packages/superset-ui-demo/storybook/shared/components/ErrorMessage.tsx @@ -17,8 +17,6 @@ * under the License. */ -import React from 'react'; - export type Props = { error: Error; }; diff --git a/superset-frontend/packages/superset-ui-demo/storybook/shared/components/Expandable.tsx b/superset-frontend/packages/superset-ui-demo/storybook/shared/components/Expandable.tsx index 148d8bdabf890..37b177f325bdd 100644 --- a/superset-frontend/packages/superset-ui-demo/storybook/shared/components/Expandable.tsx +++ b/superset-frontend/packages/superset-ui-demo/storybook/shared/components/Expandable.tsx @@ -17,7 +17,7 @@ * under the License. */ -import React, { ReactNode } from 'react'; +import { Component, ReactNode } from 'react'; export type Props = { children: ReactNode; @@ -28,7 +28,7 @@ type State = { open: boolean; }; -export default class Expandable extends React.Component { +export default class Expandable extends Component { constructor(props: Props) { super(props); this.state = { open: false }; diff --git a/superset-frontend/packages/superset-ui-demo/storybook/shared/components/ResizableChartDemo.tsx b/superset-frontend/packages/superset-ui-demo/storybook/shared/components/ResizableChartDemo.tsx index ada953c192eca..992142cfdb1d7 100644 --- a/superset-frontend/packages/superset-ui-demo/storybook/shared/components/ResizableChartDemo.tsx +++ b/superset-frontend/packages/superset-ui-demo/storybook/shared/components/ResizableChartDemo.tsx @@ -17,7 +17,7 @@ * under the License. */ -import React, { useState, ReactNode } from 'react'; +import { useState, ReactNode } from 'react'; import { styled } from '@superset-ui/core'; import type { DecoratorFunction } from '@storybook/types'; import ResizablePanel, { Size } from './ResizablePanel'; diff --git a/superset-frontend/packages/superset-ui-demo/storybook/shared/components/ResizablePanel.tsx b/superset-frontend/packages/superset-ui-demo/storybook/shared/components/ResizablePanel.tsx index f482d6291857a..a6348271183ce 100644 --- a/superset-frontend/packages/superset-ui-demo/storybook/shared/components/ResizablePanel.tsx +++ b/superset-frontend/packages/superset-ui-demo/storybook/shared/components/ResizablePanel.tsx @@ -17,7 +17,7 @@ * under the License. */ -import React, { PropsWithChildren, ReactNode } from 'react'; +import { PropsWithChildren, ReactNode } from 'react'; import { ResizableBox, ResizableBoxProps, diff --git a/superset-frontend/packages/superset-ui-demo/storybook/shared/components/VerifyCORS.tsx b/superset-frontend/packages/superset-ui-demo/storybook/shared/components/VerifyCORS.tsx index 3aa082186981d..82d3c536d4397 100644 --- a/superset-frontend/packages/superset-ui-demo/storybook/shared/components/VerifyCORS.tsx +++ b/superset-frontend/packages/superset-ui-demo/storybook/shared/components/VerifyCORS.tsx @@ -17,7 +17,7 @@ * under the License. */ -import React, { ReactNode } from 'react'; +import { Component, ReactNode } from 'react'; import { SupersetClient, Method, @@ -53,7 +53,7 @@ export const renderError = (error: Error) => ( ); -export default class VerifyCORS extends React.Component { +export default class VerifyCORS extends Component { constructor(props: Props) { super(props); this.state = { didVerify: false }; diff --git a/superset-frontend/packages/superset-ui-demo/storybook/shared/components/createQuery.story.tsx b/superset-frontend/packages/superset-ui-demo/storybook/shared/components/createQuery.story.tsx index dfb0dea1f335d..85db50e6d7ad0 100644 --- a/superset-frontend/packages/superset-ui-demo/storybook/shared/components/createQuery.story.tsx +++ b/superset-frontend/packages/superset-ui-demo/storybook/shared/components/createQuery.story.tsx @@ -17,7 +17,6 @@ * under the License. */ -import React from 'react'; import { SuperChart, ChartDataProvider, diff --git a/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/legacy-plugin-chart-calendar/LegacyPluginChartCalendar.stories.tsx b/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/legacy-plugin-chart-calendar/LegacyPluginChartCalendar.stories.tsx index eb87657193b9b..444738373357d 100644 --- a/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/legacy-plugin-chart-calendar/LegacyPluginChartCalendar.stories.tsx +++ b/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/legacy-plugin-chart-calendar/LegacyPluginChartCalendar.stories.tsx @@ -17,7 +17,6 @@ * under the License. */ -import React from 'react'; import { SuperChart } from '@superset-ui/core'; import CalendarChartPlugin from '@superset-ui/legacy-plugin-chart-calendar'; import data from './data'; diff --git a/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/legacy-plugin-chart-chord/LegacyPluginChartChord.stories.tsx b/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/legacy-plugin-chart-chord/LegacyPluginChartChord.stories.tsx index 505d87ed43615..d1acdedd672f7 100644 --- a/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/legacy-plugin-chart-chord/LegacyPluginChartChord.stories.tsx +++ b/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/legacy-plugin-chart-chord/LegacyPluginChartChord.stories.tsx @@ -17,7 +17,6 @@ * under the License. */ -import React from 'react'; import { SuperChart } from '@superset-ui/core'; import ChordChartPlugin from '@superset-ui/legacy-plugin-chart-chord'; import data from './data'; diff --git a/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/legacy-plugin-chart-country-map/CountryMap.stories.tsx b/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/legacy-plugin-chart-country-map/CountryMap.stories.tsx index 54b0869eb31bd..383511237ce80 100644 --- a/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/legacy-plugin-chart-country-map/CountryMap.stories.tsx +++ b/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/legacy-plugin-chart-country-map/CountryMap.stories.tsx @@ -17,7 +17,7 @@ * under the License. */ -import React, { useEffect, useState } from 'react'; +import { useEffect, useState } from 'react'; import { JsonObject, seed, diff --git a/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/legacy-plugin-chart-event-flow/EventFlow.stories.jsx b/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/legacy-plugin-chart-event-flow/EventFlow.stories.jsx index a28df94a9de96..daac4ce8e43c1 100644 --- a/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/legacy-plugin-chart-event-flow/EventFlow.stories.jsx +++ b/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/legacy-plugin-chart-event-flow/EventFlow.stories.jsx @@ -17,7 +17,6 @@ * under the License. */ -import React from 'react'; import { SuperChart } from '@superset-ui/core'; import sampleEvents from '@data-ui/event-flow/build/sampleEvents'; import EventFlowChartPlugin from '@superset-ui/legacy-plugin-chart-event-flow'; diff --git a/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/legacy-plugin-chart-heatmap/Heatmap.stories.tsx b/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/legacy-plugin-chart-heatmap/Heatmap.stories.tsx index 54ea527b0abf1..ad47acc04ce6d 100644 --- a/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/legacy-plugin-chart-heatmap/Heatmap.stories.tsx +++ b/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/legacy-plugin-chart-heatmap/Heatmap.stories.tsx @@ -17,7 +17,6 @@ * under the License. */ -import React from 'react'; import { SuperChart } from '@superset-ui/core'; import HeatmapChartPlugin from '@superset-ui/legacy-plugin-chart-heatmap'; import ResizableChartDemo from '../../../shared/components/ResizableChartDemo'; diff --git a/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/legacy-plugin-chart-histogram/Histogram.stories.tsx b/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/legacy-plugin-chart-histogram/Histogram.stories.tsx index d6e7be70a8256..8e57adc7b0787 100644 --- a/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/legacy-plugin-chart-histogram/Histogram.stories.tsx +++ b/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/legacy-plugin-chart-histogram/Histogram.stories.tsx @@ -18,7 +18,6 @@ */ /* eslint-disable no-magic-numbers */ -import React from 'react'; import { SuperChart } from '@superset-ui/core'; import HistogramChartPlugin from '@superset-ui/legacy-plugin-chart-histogram'; import data from './data'; diff --git a/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/legacy-plugin-chart-horizon/Horizon.stories.tsx b/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/legacy-plugin-chart-horizon/Horizon.stories.tsx index 72856f99a4fea..d4a6736db13bb 100644 --- a/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/legacy-plugin-chart-horizon/Horizon.stories.tsx +++ b/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/legacy-plugin-chart-horizon/Horizon.stories.tsx @@ -17,7 +17,6 @@ * under the License. */ -import React from 'react'; import { SuperChart } from '@superset-ui/core'; import HorizonChartPlugin from '@superset-ui/legacy-plugin-chart-horizon'; import data from './data'; diff --git a/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/legacy-plugin-chart-map-box/MapBox.stories.tsx b/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/legacy-plugin-chart-map-box/MapBox.stories.tsx index dd95ffada5b04..7a1fb7a19a3eb 100644 --- a/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/legacy-plugin-chart-map-box/MapBox.stories.tsx +++ b/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/legacy-plugin-chart-map-box/MapBox.stories.tsx @@ -18,7 +18,6 @@ */ /* eslint-disable no-magic-numbers */ -import React from 'react'; import { SuperChart, useTheme } from '@superset-ui/core'; import MapBoxChartPlugin from '@superset-ui/legacy-plugin-chart-map-box'; import { generateData } from './data'; diff --git a/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/legacy-plugin-chart-paired-t-test/TTest.stories.tsx b/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/legacy-plugin-chart-paired-t-test/TTest.stories.tsx index 577c00ac564cf..e26884f81adab 100644 --- a/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/legacy-plugin-chart-paired-t-test/TTest.stories.tsx +++ b/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/legacy-plugin-chart-paired-t-test/TTest.stories.tsx @@ -18,7 +18,6 @@ */ /* eslint-disable no-magic-numbers */ -import React from 'react'; import { SuperChart } from '@superset-ui/core'; import PairedTTestChartPlugin from '@superset-ui/legacy-plugin-chart-paired-t-test'; import data from './data'; diff --git a/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/legacy-plugin-chart-parallel-coordinates/ParallelCoordinates.stories.tsx b/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/legacy-plugin-chart-parallel-coordinates/ParallelCoordinates.stories.tsx index df907b8a614aa..17bc4a2a23e69 100644 --- a/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/legacy-plugin-chart-parallel-coordinates/ParallelCoordinates.stories.tsx +++ b/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/legacy-plugin-chart-parallel-coordinates/ParallelCoordinates.stories.tsx @@ -17,7 +17,6 @@ * under the License. */ -import React from 'react'; import { SuperChart } from '@superset-ui/core'; import ParallelCoordinatesChartPlugin from '@superset-ui/legacy-plugin-chart-parallel-coordinates'; import data from './data'; diff --git a/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/legacy-plugin-chart-partition/Partition.stories.tsx b/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/legacy-plugin-chart-partition/Partition.stories.tsx index 7f016ec3609c7..3963d0b95fc27 100644 --- a/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/legacy-plugin-chart-partition/Partition.stories.tsx +++ b/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/legacy-plugin-chart-partition/Partition.stories.tsx @@ -17,7 +17,6 @@ * under the License. */ -import React from 'react'; import { SuperChart } from '@superset-ui/core'; import PartitionChartPlugin from '@superset-ui/legacy-plugin-chart-partition'; import data from './data'; diff --git a/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/legacy-plugin-chart-rose/Rose.stories.tsx b/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/legacy-plugin-chart-rose/Rose.stories.tsx index 2e103735a7eae..c683d433b40b6 100644 --- a/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/legacy-plugin-chart-rose/Rose.stories.tsx +++ b/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/legacy-plugin-chart-rose/Rose.stories.tsx @@ -18,7 +18,6 @@ */ /* eslint-disable no-magic-numbers, sort-keys */ -import React from 'react'; import { SuperChart } from '@superset-ui/core'; import RoseChartPlugin from '@superset-ui/legacy-plugin-chart-rose'; import data from './data'; diff --git a/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/legacy-plugin-chart-sankey-loop/SankeyLoop.stories.tsx b/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/legacy-plugin-chart-sankey-loop/SankeyLoop.stories.tsx index c66a8661ac214..97ec3f05e31b2 100644 --- a/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/legacy-plugin-chart-sankey-loop/SankeyLoop.stories.tsx +++ b/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/legacy-plugin-chart-sankey-loop/SankeyLoop.stories.tsx @@ -18,7 +18,6 @@ */ /* eslint-disable no-magic-numbers */ -import React from 'react'; import { SuperChart } from '@superset-ui/core'; import SankeyLoopChartPlugin from '@superset-ui/legacy-plugin-chart-sankey-loop'; import data from './data'; diff --git a/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/legacy-plugin-chart-sankey/Sankey.stories.tsx b/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/legacy-plugin-chart-sankey/Sankey.stories.tsx index 274285baf03a3..0b1881c4cf01a 100644 --- a/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/legacy-plugin-chart-sankey/Sankey.stories.tsx +++ b/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/legacy-plugin-chart-sankey/Sankey.stories.tsx @@ -18,7 +18,6 @@ */ /* eslint-disable no-magic-numbers */ -import React from 'react'; import { SuperChart } from '@superset-ui/core'; import SankeyChartPlugin from '@superset-ui/legacy-plugin-chart-sankey'; import ResizableChartDemo from '../../../shared/components/ResizableChartDemo'; diff --git a/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/legacy-plugin-chart-world-map/WorldMap.stories.tsx b/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/legacy-plugin-chart-world-map/WorldMap.stories.tsx index c6bef9a7f13d2..52b1a98cece6b 100644 --- a/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/legacy-plugin-chart-world-map/WorldMap.stories.tsx +++ b/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/legacy-plugin-chart-world-map/WorldMap.stories.tsx @@ -18,7 +18,6 @@ */ /* eslint-disable no-magic-numbers, sort-keys */ -import React from 'react'; import { SuperChart } from '@superset-ui/core'; import WorldMapChartPlugin from '@superset-ui/legacy-plugin-chart-world-map'; import data from './data'; diff --git a/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/legacy-preset-chart-big-number/BigNumber/BigNumber.stories.tsx b/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/legacy-preset-chart-big-number/BigNumber/BigNumber.stories.tsx index 18fe9acddb2ea..1bf730f3168f0 100644 --- a/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/legacy-preset-chart-big-number/BigNumber/BigNumber.stories.tsx +++ b/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/legacy-preset-chart-big-number/BigNumber/BigNumber.stories.tsx @@ -16,7 +16,6 @@ * specific language governing permissions and limitations * under the License. */ -import React from 'react'; import { SuperChart } from '@superset-ui/core'; import { BigNumberChartPlugin } from '@superset-ui/plugin-chart-echarts'; import testData from './data'; diff --git a/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/legacy-preset-chart-big-number/BigNumberTotal/BigNumberTotal.stories.tsx b/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/legacy-preset-chart-big-number/BigNumberTotal/BigNumberTotal.stories.tsx index 2d1e105f3d7a8..448c2cab33634 100644 --- a/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/legacy-preset-chart-big-number/BigNumberTotal/BigNumberTotal.stories.tsx +++ b/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/legacy-preset-chart-big-number/BigNumberTotal/BigNumberTotal.stories.tsx @@ -16,7 +16,6 @@ * specific language governing permissions and limitations * under the License. */ -import React from 'react'; import { SuperChart } from '@superset-ui/core'; import { BigNumberTotalChartPlugin } from '@superset-ui/plugin-chart-echarts'; import data from './data'; diff --git a/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/legacy-preset-chart-deckgl/Arc/Arc.stories.tsx b/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/legacy-preset-chart-deckgl/Arc/Arc.stories.tsx index aa97dc600b4df..d41b8b05d4b5d 100644 --- a/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/legacy-preset-chart-deckgl/Arc/Arc.stories.tsx +++ b/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/legacy-preset-chart-deckgl/Arc/Arc.stories.tsx @@ -19,7 +19,6 @@ /* eslint-disable sort-keys */ /* eslint-disable no-magic-numbers */ -import React from 'react'; import { SuperChart } from '@superset-ui/core'; import { ArcChartPlugin } from '@superset-ui/legacy-preset-chart-deckgl'; import payload from './payload'; diff --git a/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/legacy-preset-chart-deckgl/Grid/Grid.stories.tsx b/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/legacy-preset-chart-deckgl/Grid/Grid.stories.tsx index d0f0d2b26056e..ed00920c0a5e8 100644 --- a/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/legacy-preset-chart-deckgl/Grid/Grid.stories.tsx +++ b/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/legacy-preset-chart-deckgl/Grid/Grid.stories.tsx @@ -19,7 +19,6 @@ /* eslint-disable sort-keys */ /* eslint-disable no-magic-numbers */ -import React from 'react'; import { SuperChart } from '@superset-ui/core'; import { GridChartPlugin } from '@superset-ui/legacy-preset-chart-deckgl'; import payload from './payload'; diff --git a/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/legacy-preset-chart-deckgl/Hex/Hex.stories.tsx b/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/legacy-preset-chart-deckgl/Hex/Hex.stories.tsx index 8bc1219977f8b..951912e421850 100644 --- a/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/legacy-preset-chart-deckgl/Hex/Hex.stories.tsx +++ b/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/legacy-preset-chart-deckgl/Hex/Hex.stories.tsx @@ -19,7 +19,6 @@ /* eslint-disable sort-keys */ /* eslint-disable no-magic-numbers */ -import React from 'react'; import { SuperChart } from '@superset-ui/core'; import { HexChartPlugin } from '@superset-ui/legacy-preset-chart-deckgl'; import payload from './payload'; diff --git a/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/legacy-preset-chart-deckgl/Path/Path.stories.tsx b/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/legacy-preset-chart-deckgl/Path/Path.stories.tsx index 486d6cca41e62..79a089c94bc36 100644 --- a/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/legacy-preset-chart-deckgl/Path/Path.stories.tsx +++ b/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/legacy-preset-chart-deckgl/Path/Path.stories.tsx @@ -19,7 +19,6 @@ /* eslint-disable sort-keys */ /* eslint-disable no-magic-numbers */ -import React from 'react'; import { SuperChart, useTheme } from '@superset-ui/core'; import { PathChartPlugin } from '@superset-ui/legacy-preset-chart-deckgl'; import { payload } from './payload'; diff --git a/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/legacy-preset-chart-deckgl/Polygon/Polygon.stories.tsx b/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/legacy-preset-chart-deckgl/Polygon/Polygon.stories.tsx index c2dd9a7cadc88..4ecbb92af2976 100644 --- a/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/legacy-preset-chart-deckgl/Polygon/Polygon.stories.tsx +++ b/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/legacy-preset-chart-deckgl/Polygon/Polygon.stories.tsx @@ -19,7 +19,6 @@ /* eslint-disable sort-keys */ /* eslint-disable no-magic-numbers */ -import React from 'react'; import { SuperChart } from '@superset-ui/core'; import { PolygonChartPlugin } from '@superset-ui/legacy-preset-chart-deckgl'; import payload from './payload'; diff --git a/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/legacy-preset-chart-deckgl/Scatter/Scatter.stories.tsx b/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/legacy-preset-chart-deckgl/Scatter/Scatter.stories.tsx index a655a6bda2f9b..6c66f622806b1 100644 --- a/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/legacy-preset-chart-deckgl/Scatter/Scatter.stories.tsx +++ b/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/legacy-preset-chart-deckgl/Scatter/Scatter.stories.tsx @@ -19,7 +19,6 @@ /* eslint-disable sort-keys */ /* eslint-disable no-magic-numbers */ -import React from 'react'; import { SuperChart } from '@superset-ui/core'; import { ScatterChartPlugin } from '@superset-ui/legacy-preset-chart-deckgl'; import payload from './payload'; diff --git a/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/legacy-preset-chart-deckgl/Screengrid/Stories.tsx b/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/legacy-preset-chart-deckgl/Screengrid/Stories.tsx index 9ba915817ad60..a66058e8cba6a 100644 --- a/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/legacy-preset-chart-deckgl/Screengrid/Stories.tsx +++ b/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/legacy-preset-chart-deckgl/Screengrid/Stories.tsx @@ -19,7 +19,6 @@ /* eslint-disable sort-keys */ /* eslint-disable no-magic-numbers */ -import React from 'react'; import { SuperChart } from '@superset-ui/core'; import { ScreengridChartPlugin } from '@superset-ui/legacy-preset-chart-deckgl'; import payload from './payload'; diff --git a/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/legacy-preset-chart-nvd3/Area/stories/controlsShown.tsx b/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/legacy-preset-chart-nvd3/Area/stories/controlsShown.tsx index 603ef83b0f5b5..ccbb68a0280a0 100644 --- a/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/legacy-preset-chart-nvd3/Area/stories/controlsShown.tsx +++ b/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/legacy-preset-chart-nvd3/Area/stories/controlsShown.tsx @@ -17,7 +17,6 @@ * under the License. */ -import React from 'react'; import { SuperChart } from '@superset-ui/core'; import dummyDatasource from '../../../../../shared/dummyDatasource'; import data from '../data'; diff --git a/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/legacy-preset-chart-nvd3/Area/stories/expanded.tsx b/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/legacy-preset-chart-nvd3/Area/stories/expanded.tsx index b26e7dfa6dba5..af6994216c995 100644 --- a/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/legacy-preset-chart-nvd3/Area/stories/expanded.tsx +++ b/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/legacy-preset-chart-nvd3/Area/stories/expanded.tsx @@ -17,7 +17,6 @@ * under the License. */ -import React from 'react'; import { SuperChart } from '@superset-ui/core'; import dummyDatasource from '../../../../../shared/dummyDatasource'; import data from '../data'; diff --git a/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/legacy-preset-chart-nvd3/Area/stories/stacked.tsx b/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/legacy-preset-chart-nvd3/Area/stories/stacked.tsx index 4c2fe6686c546..c10e83e90f962 100644 --- a/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/legacy-preset-chart-nvd3/Area/stories/stacked.tsx +++ b/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/legacy-preset-chart-nvd3/Area/stories/stacked.tsx @@ -17,7 +17,6 @@ * under the License. */ -import React from 'react'; import { SuperChart } from '@superset-ui/core'; import dummyDatasource from '../../../../../shared/dummyDatasource'; import data from '../data'; diff --git a/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/legacy-preset-chart-nvd3/Area/stories/stackedWithBounds.tsx b/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/legacy-preset-chart-nvd3/Area/stories/stackedWithBounds.tsx index 5f07ebedc5fa1..ca3f896dbd7aa 100644 --- a/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/legacy-preset-chart-nvd3/Area/stories/stackedWithBounds.tsx +++ b/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/legacy-preset-chart-nvd3/Area/stories/stackedWithBounds.tsx @@ -17,7 +17,6 @@ * under the License. */ -import React from 'react'; import { SuperChart } from '@superset-ui/core'; import dummyDatasource from '../../../../../shared/dummyDatasource'; import data from '../data'; diff --git a/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/legacy-preset-chart-nvd3/Bar/stories/barWithPositiveAndNegativeValues.tsx b/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/legacy-preset-chart-nvd3/Bar/stories/barWithPositiveAndNegativeValues.tsx index 513278ab77db9..01ed7f20c64fa 100644 --- a/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/legacy-preset-chart-nvd3/Bar/stories/barWithPositiveAndNegativeValues.tsx +++ b/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/legacy-preset-chart-nvd3/Bar/stories/barWithPositiveAndNegativeValues.tsx @@ -17,7 +17,6 @@ * under the License. */ -import React from 'react'; import { SuperChart } from '@superset-ui/core'; import dummyDatasource from '../../../../../shared/dummyDatasource'; import data from '../data'; diff --git a/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/legacy-preset-chart-nvd3/Bar/stories/barWithValues.tsx b/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/legacy-preset-chart-nvd3/Bar/stories/barWithValues.tsx index 4808a2cb63942..2cc95b04e01da 100644 --- a/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/legacy-preset-chart-nvd3/Bar/stories/barWithValues.tsx +++ b/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/legacy-preset-chart-nvd3/Bar/stories/barWithValues.tsx @@ -17,7 +17,6 @@ * under the License. */ -import React from 'react'; import { SuperChart } from '@superset-ui/core'; import dummyDatasource from '../../../../../shared/dummyDatasource'; import data from '../data'; diff --git a/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/legacy-preset-chart-nvd3/Bar/stories/basic.tsx b/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/legacy-preset-chart-nvd3/Bar/stories/basic.tsx index f52b3f4d8834b..46b2e00ca1663 100644 --- a/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/legacy-preset-chart-nvd3/Bar/stories/basic.tsx +++ b/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/legacy-preset-chart-nvd3/Bar/stories/basic.tsx @@ -17,7 +17,6 @@ * under the License. */ -import React from 'react'; import { SuperChart } from '@superset-ui/core'; import dummyDatasource from '../../../../../shared/dummyDatasource'; import data from '../data'; diff --git a/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/legacy-preset-chart-nvd3/Bar/stories/stackedBarWithValues.tsx b/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/legacy-preset-chart-nvd3/Bar/stories/stackedBarWithValues.tsx index 3a52dc6a1d1dc..6dbb104dec467 100644 --- a/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/legacy-preset-chart-nvd3/Bar/stories/stackedBarWithValues.tsx +++ b/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/legacy-preset-chart-nvd3/Bar/stories/stackedBarWithValues.tsx @@ -17,7 +17,6 @@ * under the License. */ -import React from 'react'; import { SuperChart } from '@superset-ui/core'; import dummyDatasource from '../../../../../shared/dummyDatasource'; import data from '../data'; diff --git a/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/legacy-preset-chart-nvd3/BoxPlot/stories/basic.tsx b/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/legacy-preset-chart-nvd3/BoxPlot/stories/basic.tsx index 40130a4a2aae1..19c01ed17b3d4 100644 --- a/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/legacy-preset-chart-nvd3/BoxPlot/stories/basic.tsx +++ b/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/legacy-preset-chart-nvd3/BoxPlot/stories/basic.tsx @@ -17,7 +17,6 @@ * under the License. */ -import React from 'react'; import { SuperChart } from '@superset-ui/core'; import dummyDatasource from '../../../../../shared/dummyDatasource'; import data from '../data'; diff --git a/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/legacy-preset-chart-nvd3/Bubble/stories/basic.tsx b/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/legacy-preset-chart-nvd3/Bubble/stories/basic.tsx index 4e05a62673ebd..3549b524f80ee 100644 --- a/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/legacy-preset-chart-nvd3/Bubble/stories/basic.tsx +++ b/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/legacy-preset-chart-nvd3/Bubble/stories/basic.tsx @@ -17,7 +17,6 @@ * under the License. */ -import React from 'react'; import { SuperChart } from '@superset-ui/core'; import dummyDatasource from '../../../../../shared/dummyDatasource'; import data from '../data'; diff --git a/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/legacy-preset-chart-nvd3/Bullet/stories/basic.tsx b/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/legacy-preset-chart-nvd3/Bullet/stories/basic.tsx index f3ced0b4f0fb2..7be4070549c62 100644 --- a/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/legacy-preset-chart-nvd3/Bullet/stories/basic.tsx +++ b/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/legacy-preset-chart-nvd3/Bullet/stories/basic.tsx @@ -17,7 +17,6 @@ * under the License. */ -import React from 'react'; import { SuperChart } from '@superset-ui/core'; import dummyDatasource from '../../../../../shared/dummyDatasource'; import data from '../data'; diff --git a/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/legacy-preset-chart-nvd3/Compare/stories/basic.tsx b/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/legacy-preset-chart-nvd3/Compare/stories/basic.tsx index 3524cb64385c6..9dbc789df0349 100644 --- a/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/legacy-preset-chart-nvd3/Compare/stories/basic.tsx +++ b/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/legacy-preset-chart-nvd3/Compare/stories/basic.tsx @@ -17,7 +17,6 @@ * under the License. */ -import React from 'react'; import { SuperChart } from '@superset-ui/core'; import dummyDatasource from '../../../../../shared/dummyDatasource'; import data from '../data'; diff --git a/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/legacy-preset-chart-nvd3/Compare/stories/timeFormat.tsx b/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/legacy-preset-chart-nvd3/Compare/stories/timeFormat.tsx index 4a90448e141ea..026b9707f8fec 100644 --- a/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/legacy-preset-chart-nvd3/Compare/stories/timeFormat.tsx +++ b/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/legacy-preset-chart-nvd3/Compare/stories/timeFormat.tsx @@ -17,7 +17,6 @@ * under the License. */ -import React from 'react'; import { SuperChart } from '@superset-ui/core'; import dummyDatasource from '../../../../../shared/dummyDatasource'; diff --git a/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/legacy-preset-chart-nvd3/DistBar/stories/basic.tsx b/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/legacy-preset-chart-nvd3/DistBar/stories/basic.tsx index b77817d3d5512..3db0f2ade403b 100644 --- a/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/legacy-preset-chart-nvd3/DistBar/stories/basic.tsx +++ b/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/legacy-preset-chart-nvd3/DistBar/stories/basic.tsx @@ -17,7 +17,6 @@ * under the License. */ -import React from 'react'; import { SuperChart } from '@superset-ui/core'; import dummyDatasource from '../../../../../shared/dummyDatasource'; import data from '../data'; diff --git a/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/legacy-preset-chart-nvd3/DistBar/stories/manyBars.tsx b/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/legacy-preset-chart-nvd3/DistBar/stories/manyBars.tsx index a609b7c6905a2..0ed157ab00eb2 100644 --- a/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/legacy-preset-chart-nvd3/DistBar/stories/manyBars.tsx +++ b/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/legacy-preset-chart-nvd3/DistBar/stories/manyBars.tsx @@ -17,7 +17,6 @@ * under the License. */ -import React from 'react'; import { SuperChart, seedRandom } from '@superset-ui/core'; import dummyDatasource from '../../../../../shared/dummyDatasource'; diff --git a/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/legacy-preset-chart-nvd3/Line/stories/basic.tsx b/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/legacy-preset-chart-nvd3/Line/stories/basic.tsx index e9fe1010505a7..fb032bdca6fc3 100644 --- a/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/legacy-preset-chart-nvd3/Line/stories/basic.tsx +++ b/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/legacy-preset-chart-nvd3/Line/stories/basic.tsx @@ -17,7 +17,6 @@ * under the License. */ -import React from 'react'; import { SuperChart } from '@superset-ui/core'; import dummyDatasource from '../../../../../shared/dummyDatasource'; import data from '../data'; diff --git a/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/legacy-preset-chart-nvd3/Line/stories/logScale.tsx b/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/legacy-preset-chart-nvd3/Line/stories/logScale.tsx index 4b9f110b1d3cd..b94fa9e179e20 100644 --- a/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/legacy-preset-chart-nvd3/Line/stories/logScale.tsx +++ b/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/legacy-preset-chart-nvd3/Line/stories/logScale.tsx @@ -17,7 +17,6 @@ * under the License. */ -import React from 'react'; import { SuperChart } from '@superset-ui/core'; import dummyDatasource from '../../../../../shared/dummyDatasource'; import data from '../data'; diff --git a/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/legacy-preset-chart-nvd3/Line/stories/markers.tsx b/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/legacy-preset-chart-nvd3/Line/stories/markers.tsx index fca8c2bef3959..19ecf7be53c03 100644 --- a/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/legacy-preset-chart-nvd3/Line/stories/markers.tsx +++ b/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/legacy-preset-chart-nvd3/Line/stories/markers.tsx @@ -17,7 +17,6 @@ * under the License. */ -import React from 'react'; import { SuperChart } from '@superset-ui/core'; import dummyDatasource from '../../../../../shared/dummyDatasource'; import data from '../data'; diff --git a/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/legacy-preset-chart-nvd3/Line/stories/yAxisBounds.tsx b/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/legacy-preset-chart-nvd3/Line/stories/yAxisBounds.tsx index 93c6f09c96330..aaab26e0c9b01 100644 --- a/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/legacy-preset-chart-nvd3/Line/stories/yAxisBounds.tsx +++ b/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/legacy-preset-chart-nvd3/Line/stories/yAxisBounds.tsx @@ -17,7 +17,6 @@ * under the License. */ -import React from 'react'; import { SuperChart } from '@superset-ui/core'; import dummyDatasource from '../../../../../shared/dummyDatasource'; import data from '../data'; diff --git a/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/legacy-preset-chart-nvd3/Pie/stories/basic.tsx b/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/legacy-preset-chart-nvd3/Pie/stories/basic.tsx index 6aae12ad909ee..7d5e55bb536f9 100644 --- a/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/legacy-preset-chart-nvd3/Pie/stories/basic.tsx +++ b/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/legacy-preset-chart-nvd3/Pie/stories/basic.tsx @@ -17,7 +17,6 @@ * under the License. */ -import React from 'react'; import { SuperChart } from '@superset-ui/core'; import dummyDatasource from '../../../../../shared/dummyDatasource'; import data from '../data'; diff --git a/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/legacy-preset-chart-nvd3/Pie/stories/noData.tsx b/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/legacy-preset-chart-nvd3/Pie/stories/noData.tsx index 60527ad977d3e..98b63b0a85064 100644 --- a/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/legacy-preset-chart-nvd3/Pie/stories/noData.tsx +++ b/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/legacy-preset-chart-nvd3/Pie/stories/noData.tsx @@ -17,7 +17,6 @@ * under the License. */ -import React from 'react'; import { SuperChart } from '@superset-ui/core'; import dummyDatasource from '../../../../../shared/dummyDatasource'; diff --git a/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/plugin-chart-echarts/AreaSeries/AreaSeries.stories.tsx b/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/plugin-chart-echarts/AreaSeries/AreaSeries.stories.tsx index b34dd0c5a8c5f..d6cf90952ef18 100644 --- a/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/plugin-chart-echarts/AreaSeries/AreaSeries.stories.tsx +++ b/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/plugin-chart-echarts/AreaSeries/AreaSeries.stories.tsx @@ -17,7 +17,6 @@ * under the License. */ -import React from 'react'; import { SuperChart, getChartTransformPropsRegistry } from '@superset-ui/core'; import { EchartsAreaChartPlugin, diff --git a/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/plugin-chart-echarts/BoxPlot/BoxPolot.stories.tsx b/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/plugin-chart-echarts/BoxPlot/BoxPolot.stories.tsx index deef46ec1eea8..212e7bbe6baef 100644 --- a/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/plugin-chart-echarts/BoxPlot/BoxPolot.stories.tsx +++ b/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/plugin-chart-echarts/BoxPlot/BoxPolot.stories.tsx @@ -17,7 +17,6 @@ * under the License. */ -import React from 'react'; import { SuperChart, getChartTransformPropsRegistry } from '@superset-ui/core'; import { EchartsBoxPlotChartPlugin, diff --git a/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/plugin-chart-echarts/Bubble/BubbleChart.stories.tsx b/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/plugin-chart-echarts/Bubble/BubbleChart.stories.tsx index 46f5477e956cf..2b9f8cc3a1461 100644 --- a/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/plugin-chart-echarts/Bubble/BubbleChart.stories.tsx +++ b/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/plugin-chart-echarts/Bubble/BubbleChart.stories.tsx @@ -16,7 +16,6 @@ * specific language governing permissions and limitations * under the License. */ -import React from 'react'; import { EchartsBubbleChartPlugin, BubbleTransformProps, diff --git a/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/plugin-chart-echarts/Funnel/Funnel.stories.tsx b/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/plugin-chart-echarts/Funnel/Funnel.stories.tsx index 7b24e2a4900c5..84065a5a01beb 100644 --- a/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/plugin-chart-echarts/Funnel/Funnel.stories.tsx +++ b/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/plugin-chart-echarts/Funnel/Funnel.stories.tsx @@ -17,7 +17,6 @@ * under the License. */ -import React from 'react'; import { SuperChart, getChartTransformPropsRegistry } from '@superset-ui/core'; import { EchartsFunnelChartPlugin, diff --git a/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/plugin-chart-echarts/Gauge/Gauge.stories.tsx b/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/plugin-chart-echarts/Gauge/Gauge.stories.tsx index 91beeb1b0a9a9..e6489e0d52631 100644 --- a/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/plugin-chart-echarts/Gauge/Gauge.stories.tsx +++ b/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/plugin-chart-echarts/Gauge/Gauge.stories.tsx @@ -17,7 +17,6 @@ * under the License. */ -import React from 'react'; import { SuperChart, getChartTransformPropsRegistry } from '@superset-ui/core'; import { EchartsGaugeChartPlugin, diff --git a/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/plugin-chart-echarts/Graph/Graph.stories.tsx b/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/plugin-chart-echarts/Graph/Graph.stories.tsx index 4010b2832594d..03bd6832947fc 100644 --- a/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/plugin-chart-echarts/Graph/Graph.stories.tsx +++ b/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/plugin-chart-echarts/Graph/Graph.stories.tsx @@ -17,7 +17,6 @@ * under the License. */ -import React from 'react'; import { SuperChart, getChartTransformPropsRegistry } from '@superset-ui/core'; import { EchartsGraphChartPlugin, diff --git a/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/plugin-chart-echarts/MixedSeries/MixedSeries.stories.tsx b/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/plugin-chart-echarts/MixedSeries/MixedSeries.stories.tsx index 304bcf60293a0..2dd5ff3a4badf 100644 --- a/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/plugin-chart-echarts/MixedSeries/MixedSeries.stories.tsx +++ b/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/plugin-chart-echarts/MixedSeries/MixedSeries.stories.tsx @@ -17,7 +17,6 @@ * under the License. */ -import React from 'react'; import { SuperChart, getChartTransformPropsRegistry } from '@superset-ui/core'; import { EchartsTimeseriesChartPlugin, diff --git a/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/plugin-chart-echarts/Pie/Pie.stories.tsx b/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/plugin-chart-echarts/Pie/Pie.stories.tsx index 228d5792175aa..6a752ac94003c 100644 --- a/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/plugin-chart-echarts/Pie/Pie.stories.tsx +++ b/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/plugin-chart-echarts/Pie/Pie.stories.tsx @@ -17,7 +17,6 @@ * under the License. */ -import React from 'react'; import { SuperChart, getChartTransformPropsRegistry } from '@superset-ui/core'; import { EchartsPieChartPlugin, diff --git a/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/plugin-chart-echarts/Radar/Radar.stories.tsx b/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/plugin-chart-echarts/Radar/Radar.stories.tsx index a96476bb33a8a..637193a80224b 100644 --- a/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/plugin-chart-echarts/Radar/Radar.stories.tsx +++ b/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/plugin-chart-echarts/Radar/Radar.stories.tsx @@ -17,7 +17,6 @@ * under the License. */ -import React from 'react'; import { SuperChart, getChartTransformPropsRegistry } from '@superset-ui/core'; import { EchartsRadarChartPlugin, diff --git a/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/plugin-chart-echarts/Sunburst/Sunburst.stories.tsx b/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/plugin-chart-echarts/Sunburst/Sunburst.stories.tsx index fb1613e6205ca..35a9dfc43e6f9 100644 --- a/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/plugin-chart-echarts/Sunburst/Sunburst.stories.tsx +++ b/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/plugin-chart-echarts/Sunburst/Sunburst.stories.tsx @@ -17,7 +17,6 @@ * under the License. */ -import React from 'react'; import { SuperChart, getChartTransformPropsRegistry } from '@superset-ui/core'; import { EchartsSunburstChartPlugin, diff --git a/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/plugin-chart-echarts/Timeseries/Timeseries.stories.tsx b/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/plugin-chart-echarts/Timeseries/Timeseries.stories.tsx index 6765d0c37547d..452240dd742a2 100644 --- a/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/plugin-chart-echarts/Timeseries/Timeseries.stories.tsx +++ b/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/plugin-chart-echarts/Timeseries/Timeseries.stories.tsx @@ -17,7 +17,6 @@ * under the License. */ -import React from 'react'; import { SuperChart, getChartTransformPropsRegistry } from '@superset-ui/core'; import { EchartsTimeseriesChartPlugin, diff --git a/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/plugin-chart-echarts/Tree/Tree.stories.tsx b/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/plugin-chart-echarts/Tree/Tree.stories.tsx index bfa290a452af5..5c6b85ffd7a48 100644 --- a/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/plugin-chart-echarts/Tree/Tree.stories.tsx +++ b/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/plugin-chart-echarts/Tree/Tree.stories.tsx @@ -17,7 +17,6 @@ * under the License. */ -import React from 'react'; import { SuperChart, getChartTransformPropsRegistry } from '@superset-ui/core'; import { EchartsTreeChartPlugin, diff --git a/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/plugin-chart-echarts/Treemap/Treemap.stories.tsx b/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/plugin-chart-echarts/Treemap/Treemap.stories.tsx index 181f5a5e003e6..1a65b1f3aa8e4 100644 --- a/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/plugin-chart-echarts/Treemap/Treemap.stories.tsx +++ b/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/plugin-chart-echarts/Treemap/Treemap.stories.tsx @@ -17,7 +17,6 @@ * under the License. */ -import React from 'react'; import { SuperChart, getChartTransformPropsRegistry } from '@superset-ui/core'; import { EchartsTreemapChartPlugin, diff --git a/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/plugin-chart-echarts/Waterfall/Waterfall.stories.tsx b/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/plugin-chart-echarts/Waterfall/Waterfall.stories.tsx index 9720763b0597c..f2f732a2908d2 100644 --- a/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/plugin-chart-echarts/Waterfall/Waterfall.stories.tsx +++ b/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/plugin-chart-echarts/Waterfall/Waterfall.stories.tsx @@ -16,7 +16,6 @@ * specific language governing permissions and limitations * under the License. */ -import React from 'react'; import { SuperChart, getChartTransformPropsRegistry } from '@superset-ui/core'; import { EchartsWaterfallChartPlugin, diff --git a/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/plugin-chart-pivot-table/PivotTable.stories.tsx b/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/plugin-chart-pivot-table/PivotTable.stories.tsx index 8bf7c24517c9b..ba12b4054e169 100644 --- a/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/plugin-chart-pivot-table/PivotTable.stories.tsx +++ b/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/plugin-chart-pivot-table/PivotTable.stories.tsx @@ -17,7 +17,6 @@ * under the License. */ -import React from 'react'; import { SuperChart } from '@superset-ui/core'; import { PivotTableChartPlugin } from '@superset-ui/plugin-chart-pivot-table'; import { basicFormData, basicData } from './testData'; diff --git a/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/plugin-chart-table/Table.stories.tsx b/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/plugin-chart-table/Table.stories.tsx index d898fd49d5a0f..1ec9a5baeeba6 100644 --- a/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/plugin-chart-table/Table.stories.tsx +++ b/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/plugin-chart-table/Table.stories.tsx @@ -17,7 +17,6 @@ * under the License. */ -import React from 'react'; import memoizeOne from 'memoize-one'; import { SuperChart } from '@superset-ui/core'; import TableChartPlugin, { diff --git a/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/plugin-chart-word-cloud/WordCloud.stories.tsx b/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/plugin-chart-word-cloud/WordCloud.stories.tsx index d2f8aac6576cc..82f6ffedda4e7 100644 --- a/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/plugin-chart-word-cloud/WordCloud.stories.tsx +++ b/superset-frontend/packages/superset-ui-demo/storybook/stories/plugins/plugin-chart-word-cloud/WordCloud.stories.tsx @@ -17,7 +17,6 @@ * under the License. */ -import React from 'react'; import { SuperChart, getChartTransformPropsRegistry } from '@superset-ui/core'; import { WordCloudChartPlugin, diff --git a/superset-frontend/packages/superset-ui-demo/storybook/stories/superset-ui-chart/ChartDataProvider.stories.tsx b/superset-frontend/packages/superset-ui-demo/storybook/stories/superset-ui-chart/ChartDataProvider.stories.tsx index bc6d392d10527..f0538196366a8 100644 --- a/superset-frontend/packages/superset-ui-demo/storybook/stories/superset-ui-chart/ChartDataProvider.stories.tsx +++ b/superset-frontend/packages/superset-ui-demo/storybook/stories/superset-ui-chart/ChartDataProvider.stories.tsx @@ -17,8 +17,6 @@ * under the License. */ -import React from 'react'; - import { SuperChart, ChartDataProvider, diff --git a/superset-frontend/packages/superset-ui-demo/storybook/stories/superset-ui-chart/SuperChart.stories.tsx b/superset-frontend/packages/superset-ui-demo/storybook/stories/superset-ui-chart/SuperChart.stories.tsx index 4e192beb86062..94271a68cec0a 100644 --- a/superset-frontend/packages/superset-ui-demo/storybook/stories/superset-ui-chart/SuperChart.stories.tsx +++ b/superset-frontend/packages/superset-ui-demo/storybook/stories/superset-ui-chart/SuperChart.stories.tsx @@ -17,7 +17,6 @@ * under the License. */ -import React from 'react'; import { SuperChart } from '@superset-ui/core'; import { DiligentChartPlugin, diff --git a/superset-frontend/packages/superset-ui-demo/storybook/stories/superset-ui-color/ColorPalettes.stories.tsx b/superset-frontend/packages/superset-ui-demo/storybook/stories/superset-ui-color/ColorPalettes.stories.tsx index ae32badbc26b8..912faab229b14 100644 --- a/superset-frontend/packages/superset-ui-demo/storybook/stories/superset-ui-color/ColorPalettes.stories.tsx +++ b/superset-frontend/packages/superset-ui-demo/storybook/stories/superset-ui-color/ColorPalettes.stories.tsx @@ -17,7 +17,6 @@ * under the License. */ -import React from 'react'; import { CategoricalAirbnb, CategoricalD3, diff --git a/superset-frontend/packages/superset-ui-demo/storybook/stories/superset-ui-color/RenderPalettes.tsx b/superset-frontend/packages/superset-ui-demo/storybook/stories/superset-ui-color/RenderPalettes.tsx index a0e819c3725a2..28feb64bab091 100644 --- a/superset-frontend/packages/superset-ui-demo/storybook/stories/superset-ui-color/RenderPalettes.tsx +++ b/superset-frontend/packages/superset-ui-demo/storybook/stories/superset-ui-color/RenderPalettes.tsx @@ -18,7 +18,6 @@ */ /* eslint react/prop-types: 'off' */ -import React from 'react'; import './color-styles.css'; export default function RenderPalettes({ title, palettes }) { diff --git a/superset-frontend/packages/superset-ui-demo/storybook/stories/superset-ui-connection/Connection.stories.tsx b/superset-frontend/packages/superset-ui-demo/storybook/stories/superset-ui-connection/Connection.stories.tsx index 863afe52265b8..a091b20c81afb 100644 --- a/superset-frontend/packages/superset-ui-demo/storybook/stories/superset-ui-connection/Connection.stories.tsx +++ b/superset-frontend/packages/superset-ui-demo/storybook/stories/superset-ui-connection/Connection.stories.tsx @@ -17,7 +17,6 @@ * under the License. */ -import React from 'react'; import { bigNumberFormData } from '../../../../superset-ui-core/test/chart/fixtures/formData'; import VerifyCORS, { diff --git a/superset-frontend/packages/superset-ui-demo/storybook/stories/superset-ui-number-format/NumberFormat.stories.tsx b/superset-frontend/packages/superset-ui-demo/storybook/stories/superset-ui-number-format/NumberFormat.stories.tsx index df57c4ad99142..d84fc6efcdd2d 100644 --- a/superset-frontend/packages/superset-ui-demo/storybook/stories/superset-ui-number-format/NumberFormat.stories.tsx +++ b/superset-frontend/packages/superset-ui-demo/storybook/stories/superset-ui-number-format/NumberFormat.stories.tsx @@ -17,10 +17,10 @@ * under the License. */ -import React from 'react'; +import { PureComponent } from 'react'; import { formatNumber } from '@superset-ui/core'; -class NumberFormatValidator extends React.PureComponent { +class NumberFormatValidator extends PureComponent { state: { formatString: string; testValues: (number | null | undefined)[] } = { formatString: '.3~s', testValues: [ diff --git a/superset-frontend/packages/superset-ui-demo/storybook/stories/superset-ui-style/Theme.stories.tsx b/superset-frontend/packages/superset-ui-demo/storybook/stories/superset-ui-style/Theme.stories.tsx index 8d0d51ebd672a..63ede4a8a7c36 100644 --- a/superset-frontend/packages/superset-ui-demo/storybook/stories/superset-ui-style/Theme.stories.tsx +++ b/superset-frontend/packages/superset-ui-demo/storybook/stories/superset-ui-style/Theme.stories.tsx @@ -17,8 +17,6 @@ * under the License. */ -import React from 'react'; - import { supersetTheme } from '@superset-ui/core'; export default { diff --git a/superset-frontend/packages/superset-ui-demo/storybook/stories/superset-ui-time-format/TimeFormat.stories.tsx b/superset-frontend/packages/superset-ui-demo/storybook/stories/superset-ui-time-format/TimeFormat.stories.tsx index d35fdacc1036d..fa3f771d2c4b1 100644 --- a/superset-frontend/packages/superset-ui-demo/storybook/stories/superset-ui-time-format/TimeFormat.stories.tsx +++ b/superset-frontend/packages/superset-ui-demo/storybook/stories/superset-ui-time-format/TimeFormat.stories.tsx @@ -17,10 +17,10 @@ * under the License. */ -import React from 'react'; +import { PureComponent } from 'react'; import { formatTime } from '@superset-ui/core'; -class TimeFormatValidator extends React.PureComponent { +class TimeFormatValidator extends PureComponent { state: { formatString: string; testValues: (Date | number | null | undefined)[]; diff --git a/superset-frontend/plugins/legacy-plugin-chart-calendar/src/ReactCalendar.jsx b/superset-frontend/plugins/legacy-plugin-chart-calendar/src/ReactCalendar.jsx index 8908fc5242032..f3fcc807d8a04 100644 --- a/superset-frontend/plugins/legacy-plugin-chart-calendar/src/ReactCalendar.jsx +++ b/superset-frontend/plugins/legacy-plugin-chart-calendar/src/ReactCalendar.jsx @@ -16,7 +16,6 @@ * specific language governing permissions and limitations * under the License. */ -import React from 'react'; import PropTypes from 'prop-types'; import { reactify, styled, css, useTheme } from '@superset-ui/core'; import { Global } from '@emotion/react'; diff --git a/superset-frontend/plugins/legacy-plugin-chart-chord/src/ReactChord.jsx b/superset-frontend/plugins/legacy-plugin-chart-chord/src/ReactChord.jsx index 64c749d61ca3d..7de87414cc2df 100644 --- a/superset-frontend/plugins/legacy-plugin-chart-chord/src/ReactChord.jsx +++ b/superset-frontend/plugins/legacy-plugin-chart-chord/src/ReactChord.jsx @@ -16,7 +16,6 @@ * specific language governing permissions and limitations * under the License. */ -import React from 'react'; import { reactify, styled } from '@superset-ui/core'; import PropTypes from 'prop-types'; import Component from './Chord'; diff --git a/superset-frontend/plugins/legacy-plugin-chart-country-map/src/ReactCountryMap.jsx b/superset-frontend/plugins/legacy-plugin-chart-country-map/src/ReactCountryMap.jsx index f6e532aa46daa..ea6a936b5aad9 100644 --- a/superset-frontend/plugins/legacy-plugin-chart-country-map/src/ReactCountryMap.jsx +++ b/superset-frontend/plugins/legacy-plugin-chart-country-map/src/ReactCountryMap.jsx @@ -16,7 +16,6 @@ * specific language governing permissions and limitations * under the License. */ -import React from 'react'; import { reactify, styled } from '@superset-ui/core'; import Component from './CountryMap'; diff --git a/superset-frontend/plugins/legacy-plugin-chart-event-flow/src/EventFlow.tsx b/superset-frontend/plugins/legacy-plugin-chart-event-flow/src/EventFlow.tsx index c663e0a91870c..7b3cdd6a8bfab 100644 --- a/superset-frontend/plugins/legacy-plugin-chart-event-flow/src/EventFlow.tsx +++ b/superset-frontend/plugins/legacy-plugin-chart-event-flow/src/EventFlow.tsx @@ -16,7 +16,6 @@ * specific language governing permissions and limitations * under the License. */ -import React from 'react'; import { App as EventFlowApp } from '@data-ui/event-flow'; import { t, TimeseriesDataRecord } from '@superset-ui/core'; diff --git a/superset-frontend/plugins/legacy-plugin-chart-event-flow/src/controlPanel.tsx b/superset-frontend/plugins/legacy-plugin-chart-event-flow/src/controlPanel.tsx index adf58a7888d2a..32ed9969b3665 100644 --- a/superset-frontend/plugins/legacy-plugin-chart-event-flow/src/controlPanel.tsx +++ b/superset-frontend/plugins/legacy-plugin-chart-event-flow/src/controlPanel.tsx @@ -16,7 +16,6 @@ * specific language governing permissions and limitations * under the License. */ -import React from 'react'; import { t, validateNonEmpty } from '@superset-ui/core'; import { columnChoices, diff --git a/superset-frontend/plugins/legacy-plugin-chart-heatmap/src/ReactHeatmap.jsx b/superset-frontend/plugins/legacy-plugin-chart-heatmap/src/ReactHeatmap.jsx index 6e016b4774d04..9dad51e5242a1 100644 --- a/superset-frontend/plugins/legacy-plugin-chart-heatmap/src/ReactHeatmap.jsx +++ b/superset-frontend/plugins/legacy-plugin-chart-heatmap/src/ReactHeatmap.jsx @@ -16,7 +16,6 @@ * specific language governing permissions and limitations * under the License. */ -import React from 'react'; import { reactify, css, styled } from '@superset-ui/core'; import { Global } from '@emotion/react'; import Component from './Heatmap'; diff --git a/superset-frontend/plugins/legacy-plugin-chart-heatmap/src/controlPanel.tsx b/superset-frontend/plugins/legacy-plugin-chart-heatmap/src/controlPanel.tsx index 500ab0ecffd57..53394c99ebac9 100644 --- a/superset-frontend/plugins/legacy-plugin-chart-heatmap/src/controlPanel.tsx +++ b/superset-frontend/plugins/legacy-plugin-chart-heatmap/src/controlPanel.tsx @@ -16,7 +16,6 @@ * specific language governing permissions and limitations * under the License. */ -import React from 'react'; import { t } from '@superset-ui/core'; import { ControlPanelConfig, diff --git a/superset-frontend/plugins/legacy-plugin-chart-histogram/src/Histogram.jsx b/superset-frontend/plugins/legacy-plugin-chart-histogram/src/Histogram.jsx index 67d5f30f9022d..535f3c3b63d22 100644 --- a/superset-frontend/plugins/legacy-plugin-chart-histogram/src/Histogram.jsx +++ b/superset-frontend/plugins/legacy-plugin-chart-histogram/src/Histogram.jsx @@ -18,7 +18,7 @@ */ /* eslint-disable react/sort-prop-types */ import PropTypes from 'prop-types'; -import React from 'react'; +import { PureComponent } from 'react'; import { Histogram, BarSeries, XAxis, YAxis } from '@data-ui/histogram'; import { chartTheme } from '@data-ui/theme'; import { LegendOrdinal } from '@vx/legend'; @@ -56,7 +56,7 @@ const defaultProps = { yAxisLabel: '', }; -class CustomHistogram extends React.PureComponent { +class CustomHistogram extends PureComponent { render() { const { className, diff --git a/superset-frontend/plugins/legacy-plugin-chart-histogram/src/WithLegend.jsx b/superset-frontend/plugins/legacy-plugin-chart-histogram/src/WithLegend.jsx index d70c20b124481..f127a0ec7d3fb 100644 --- a/superset-frontend/plugins/legacy-plugin-chart-histogram/src/WithLegend.jsx +++ b/superset-frontend/plugins/legacy-plugin-chart-histogram/src/WithLegend.jsx @@ -17,7 +17,7 @@ * under the License. */ /* eslint-disable react/sort-prop-types, react/jsx-sort-default-props */ -import React from 'react'; +import { Component } from 'react'; import PropTypes from 'prop-types'; import { ParentSize } from '@vx/responsive'; @@ -54,7 +54,7 @@ const CHART_STYLE_BASE = { position: 'relative', }; -class WithLegend extends React.Component { +class WithLegend extends Component { getContainerDirection() { const { position } = this.props; switch (position) { diff --git a/superset-frontend/plugins/legacy-plugin-chart-horizon/src/HorizonChart.jsx b/superset-frontend/plugins/legacy-plugin-chart-horizon/src/HorizonChart.jsx index e4a32c8de3569..dc72cb664add9 100644 --- a/superset-frontend/plugins/legacy-plugin-chart-horizon/src/HorizonChart.jsx +++ b/superset-frontend/plugins/legacy-plugin-chart-horizon/src/HorizonChart.jsx @@ -17,7 +17,7 @@ * under the License. */ /* eslint-disable react/jsx-sort-default-props, react/sort-prop-types */ -import React from 'react'; +import { PureComponent } from 'react'; import PropTypes from 'prop-types'; import { extent as d3Extent } from 'd3-array'; import { ensureIsArray, styled } from '@superset-ui/core'; @@ -80,7 +80,7 @@ const StyledDiv = styled.div` `} `; -class HorizonChart extends React.PureComponent { +class HorizonChart extends PureComponent { render() { const { className, diff --git a/superset-frontend/plugins/legacy-plugin-chart-horizon/src/HorizonRow.jsx b/superset-frontend/plugins/legacy-plugin-chart-horizon/src/HorizonRow.jsx index de65703585127..b043abd435178 100644 --- a/superset-frontend/plugins/legacy-plugin-chart-horizon/src/HorizonRow.jsx +++ b/superset-frontend/plugins/legacy-plugin-chart-horizon/src/HorizonRow.jsx @@ -19,7 +19,7 @@ /* eslint-disable no-continue, no-bitwise */ /* eslint-disable react/jsx-sort-default-props */ /* eslint-disable react/sort-prop-types */ -import React from 'react'; +import { PureComponent } from 'react'; import PropTypes from 'prop-types'; import { extent as d3Extent } from 'd3-array'; import { scaleLinear } from 'd3-scale'; @@ -66,7 +66,7 @@ const defaultProps = { yDomain: undefined, }; -class HorizonRow extends React.PureComponent { +class HorizonRow extends PureComponent { componentDidMount() { this.drawChart(); } diff --git a/superset-frontend/plugins/legacy-plugin-chart-map-box/src/MapBox.jsx b/superset-frontend/plugins/legacy-plugin-chart-map-box/src/MapBox.jsx index 6fe4a24eab671..5c3e0e8472a27 100644 --- a/superset-frontend/plugins/legacy-plugin-chart-map-box/src/MapBox.jsx +++ b/superset-frontend/plugins/legacy-plugin-chart-map-box/src/MapBox.jsx @@ -18,7 +18,7 @@ */ /* eslint-disable react/jsx-sort-default-props, react/sort-prop-types */ /* eslint-disable react/forbid-prop-types, react/require-default-props */ -import React from 'react'; +import { Component } from 'react'; import PropTypes from 'prop-types'; import MapGL from 'react-map-gl'; import ViewportMercator from 'viewport-mercator-project'; @@ -55,7 +55,7 @@ const defaultProps = { pointRadiusUnit: 'Pixels', }; -class MapBox extends React.Component { +class MapBox extends Component { constructor(props) { super(props); diff --git a/superset-frontend/plugins/legacy-plugin-chart-map-box/src/ScatterPlotGlowOverlay.jsx b/superset-frontend/plugins/legacy-plugin-chart-map-box/src/ScatterPlotGlowOverlay.jsx index cfbd880f05d0e..011c91ed9cd17 100644 --- a/superset-frontend/plugins/legacy-plugin-chart-map-box/src/ScatterPlotGlowOverlay.jsx +++ b/superset-frontend/plugins/legacy-plugin-chart-map-box/src/ScatterPlotGlowOverlay.jsx @@ -18,7 +18,7 @@ */ /* eslint-disable react/require-default-props */ import PropTypes from 'prop-types'; -import React from 'react'; +import { PureComponent } from 'react'; import { CanvasOverlay } from 'react-map-gl'; import { kmToPixels, MILES_PER_KM } from './utils/geo'; import roundDecimal from './utils/roundDecimal'; @@ -73,7 +73,7 @@ const computeClusterLabel = (properties, aggregation) => { return count; }; -class ScatterPlotGlowOverlay extends React.PureComponent { +class ScatterPlotGlowOverlay extends PureComponent { constructor(props) { super(props); this.redraw = this.redraw.bind(this); diff --git a/superset-frontend/plugins/legacy-plugin-chart-paired-t-test/src/PairedTTest.jsx b/superset-frontend/plugins/legacy-plugin-chart-paired-t-test/src/PairedTTest.jsx index 670d97e7c8421..27b2f7239ea61 100644 --- a/superset-frontend/plugins/legacy-plugin-chart-paired-t-test/src/PairedTTest.jsx +++ b/superset-frontend/plugins/legacy-plugin-chart-paired-t-test/src/PairedTTest.jsx @@ -18,7 +18,7 @@ */ /* eslint-disable react/no-array-index-key */ import PropTypes from 'prop-types'; -import React from 'react'; +import { PureComponent } from 'react'; import { styled } from '@superset-ui/core'; import TTestTable, { dataPropType } from './TTestTable'; @@ -115,7 +115,7 @@ const StyledDiv = styled.div` `} `; -class PairedTTest extends React.PureComponent { +class PairedTTest extends PureComponent { render() { const { className, metrics, groups, data, alpha, pValPrec, liftValPrec } = this.props; diff --git a/superset-frontend/plugins/legacy-plugin-chart-paired-t-test/src/TTestTable.jsx b/superset-frontend/plugins/legacy-plugin-chart-paired-t-test/src/TTestTable.jsx index e897e892ffcea..9bbaccc432e48 100644 --- a/superset-frontend/plugins/legacy-plugin-chart-paired-t-test/src/TTestTable.jsx +++ b/superset-frontend/plugins/legacy-plugin-chart-paired-t-test/src/TTestTable.jsx @@ -18,7 +18,7 @@ */ /* eslint-disable react/no-array-index-key, react/jsx-no-bind */ import dist from 'distributions'; -import React from 'react'; +import { Component } from 'react'; import { Table, Tr, Td, Thead, Th } from 'reactable'; import PropTypes from 'prop-types'; @@ -49,7 +49,7 @@ const defaultProps = { pValPrec: 6, }; -class TTestTable extends React.Component { +class TTestTable extends Component { constructor(props) { super(props); this.state = { diff --git a/superset-frontend/plugins/legacy-plugin-chart-parallel-coordinates/src/ReactParallelCoordinates.jsx b/superset-frontend/plugins/legacy-plugin-chart-parallel-coordinates/src/ReactParallelCoordinates.jsx index 7f30716057604..e9e03af1d3b7e 100644 --- a/superset-frontend/plugins/legacy-plugin-chart-parallel-coordinates/src/ReactParallelCoordinates.jsx +++ b/superset-frontend/plugins/legacy-plugin-chart-parallel-coordinates/src/ReactParallelCoordinates.jsx @@ -16,7 +16,6 @@ * specific language governing permissions and limitations * under the License. */ -import React from 'react'; import { styled, reactify, addAlpha } from '@superset-ui/core'; import PropTypes from 'prop-types'; import Component from './ParallelCoordinates'; diff --git a/superset-frontend/plugins/legacy-plugin-chart-partition/src/OptionDescription.tsx b/superset-frontend/plugins/legacy-plugin-chart-partition/src/OptionDescription.tsx index e77132379518a..7a45cbea5ecc0 100644 --- a/superset-frontend/plugins/legacy-plugin-chart-partition/src/OptionDescription.tsx +++ b/superset-frontend/plugins/legacy-plugin-chart-partition/src/OptionDescription.tsx @@ -17,7 +17,6 @@ * under the License. */ -import React from 'react'; import PropTypes from 'prop-types'; import { diff --git a/superset-frontend/plugins/legacy-plugin-chart-partition/src/ReactPartition.jsx b/superset-frontend/plugins/legacy-plugin-chart-partition/src/ReactPartition.jsx index d73476ac58f9f..bfb1340fd70a1 100644 --- a/superset-frontend/plugins/legacy-plugin-chart-partition/src/ReactPartition.jsx +++ b/superset-frontend/plugins/legacy-plugin-chart-partition/src/ReactPartition.jsx @@ -16,7 +16,6 @@ * specific language governing permissions and limitations * under the License. */ -import React from 'react'; import { reactify, styled } from '@superset-ui/core'; import Component from './Partition'; diff --git a/superset-frontend/plugins/legacy-plugin-chart-partition/src/controlPanel.tsx b/superset-frontend/plugins/legacy-plugin-chart-partition/src/controlPanel.tsx index f7dfcc0c01eea..29f85126fe710 100644 --- a/superset-frontend/plugins/legacy-plugin-chart-partition/src/controlPanel.tsx +++ b/superset-frontend/plugins/legacy-plugin-chart-partition/src/controlPanel.tsx @@ -16,7 +16,6 @@ * specific language governing permissions and limitations * under the License. */ -import React from 'react'; import { t, validateNonEmpty } from '@superset-ui/core'; import { ColumnMeta, diff --git a/superset-frontend/plugins/legacy-plugin-chart-partition/test/OptionDescription.test.jsx b/superset-frontend/plugins/legacy-plugin-chart-partition/test/OptionDescription.test.jsx index 47f23ad7529b1..248d43e998dd5 100644 --- a/superset-frontend/plugins/legacy-plugin-chart-partition/test/OptionDescription.test.jsx +++ b/superset-frontend/plugins/legacy-plugin-chart-partition/test/OptionDescription.test.jsx @@ -16,7 +16,6 @@ * specific language governing permissions and limitations * under the License. */ -import React from 'react'; import { shallow } from 'enzyme'; import { InfoTooltipWithTrigger } from '@superset-ui/chart-controls'; diff --git a/superset-frontend/plugins/legacy-plugin-chart-rose/src/ReactRose.jsx b/superset-frontend/plugins/legacy-plugin-chart-rose/src/ReactRose.jsx index 33d9cd4f9c8fd..efd9b59aef6ab 100644 --- a/superset-frontend/plugins/legacy-plugin-chart-rose/src/ReactRose.jsx +++ b/superset-frontend/plugins/legacy-plugin-chart-rose/src/ReactRose.jsx @@ -16,7 +16,6 @@ * specific language governing permissions and limitations * under the License. */ -import React from 'react'; import { reactify, styled, css } from '@superset-ui/core'; import { Global } from '@emotion/react'; import Component from './Rose'; diff --git a/superset-frontend/plugins/legacy-plugin-chart-rose/src/controlPanel.tsx b/superset-frontend/plugins/legacy-plugin-chart-rose/src/controlPanel.tsx index 71d6d8bba16be..9807929f99211 100644 --- a/superset-frontend/plugins/legacy-plugin-chart-rose/src/controlPanel.tsx +++ b/superset-frontend/plugins/legacy-plugin-chart-rose/src/controlPanel.tsx @@ -16,7 +16,6 @@ * specific language governing permissions and limitations * under the License. */ -import React from 'react'; import { t } from '@superset-ui/core'; import { ControlPanelConfig, diff --git a/superset-frontend/plugins/legacy-plugin-chart-sankey-loop/src/ReactSankeyLoop.jsx b/superset-frontend/plugins/legacy-plugin-chart-sankey-loop/src/ReactSankeyLoop.jsx index 4f72433ac9eaa..5f1e551b0337a 100644 --- a/superset-frontend/plugins/legacy-plugin-chart-sankey-loop/src/ReactSankeyLoop.jsx +++ b/superset-frontend/plugins/legacy-plugin-chart-sankey-loop/src/ReactSankeyLoop.jsx @@ -16,7 +16,6 @@ * specific language governing permissions and limitations * under the License. */ -import React from 'react'; import { reactify, styled } from '@superset-ui/core'; import Component from './SankeyLoop'; diff --git a/superset-frontend/plugins/legacy-plugin-chart-sankey/src/ReactSankey.jsx b/superset-frontend/plugins/legacy-plugin-chart-sankey/src/ReactSankey.jsx index fe5c5bdea662d..48efa7b896c10 100644 --- a/superset-frontend/plugins/legacy-plugin-chart-sankey/src/ReactSankey.jsx +++ b/superset-frontend/plugins/legacy-plugin-chart-sankey/src/ReactSankey.jsx @@ -16,7 +16,6 @@ * specific language governing permissions and limitations * under the License. */ -import React from 'react'; import { reactify, styled } from '@superset-ui/core'; import PropTypes from 'prop-types'; import SanKey from './Sankey'; diff --git a/superset-frontend/plugins/legacy-plugin-chart-world-map/src/ReactWorldMap.jsx b/superset-frontend/plugins/legacy-plugin-chart-world-map/src/ReactWorldMap.jsx index 91efe6b0cbcaa..15d2edf011650 100644 --- a/superset-frontend/plugins/legacy-plugin-chart-world-map/src/ReactWorldMap.jsx +++ b/superset-frontend/plugins/legacy-plugin-chart-world-map/src/ReactWorldMap.jsx @@ -16,7 +16,6 @@ * specific language governing permissions and limitations * under the License. */ -import React from 'react'; import PropTypes from 'prop-types'; import { styled, reactify, useTheme } from '@superset-ui/core'; import WorldMap from './WorldMap'; diff --git a/superset-frontend/plugins/legacy-preset-chart-deckgl/src/CategoricalDeckGLContainer.tsx b/superset-frontend/plugins/legacy-preset-chart-deckgl/src/CategoricalDeckGLContainer.tsx index fb150445f4e93..2b81b8a8d2c0a 100644 --- a/superset-frontend/plugins/legacy-preset-chart-deckgl/src/CategoricalDeckGLContainer.tsx +++ b/superset-frontend/plugins/legacy-preset-chart-deckgl/src/CategoricalDeckGLContainer.tsx @@ -24,7 +24,7 @@ */ /* eslint no-underscore-dangle: ["error", { "allow": ["", "__timestamp"] }] */ -import React, { memo, useCallback, useEffect, useRef, useState } from 'react'; +import { memo, useCallback, useEffect, useRef, useState } from 'react'; import { CategoricalColorNamespace, Datasource, diff --git a/superset-frontend/plugins/legacy-preset-chart-deckgl/src/DeckGLContainer.tsx b/superset-frontend/plugins/legacy-preset-chart-deckgl/src/DeckGLContainer.tsx index 7b8f61e18b581..f82f6b9ed9ce9 100644 --- a/superset-frontend/plugins/legacy-preset-chart-deckgl/src/DeckGLContainer.tsx +++ b/superset-frontend/plugins/legacy-preset-chart-deckgl/src/DeckGLContainer.tsx @@ -20,7 +20,7 @@ * specific language governing permissions and limitations * under the License. */ -import React, { +import { forwardRef, memo, ReactNode, diff --git a/superset-frontend/plugins/legacy-preset-chart-deckgl/src/Multi/Multi.tsx b/superset-frontend/plugins/legacy-preset-chart-deckgl/src/Multi/Multi.tsx index 540b094219cf4..bbf775aab2f9d 100644 --- a/superset-frontend/plugins/legacy-preset-chart-deckgl/src/Multi/Multi.tsx +++ b/superset-frontend/plugins/legacy-preset-chart-deckgl/src/Multi/Multi.tsx @@ -19,7 +19,7 @@ * specific language governing permissions and limitations * under the License. */ -import React, { memo, useCallback, useEffect, useRef, useState } from 'react'; +import { memo, useCallback, useEffect, useRef, useState } from 'react'; import { isEqual } from 'lodash'; import { Datasource, diff --git a/superset-frontend/plugins/legacy-preset-chart-deckgl/src/TooltipRow.tsx b/superset-frontend/plugins/legacy-preset-chart-deckgl/src/TooltipRow.tsx index 3e69258556ce1..dab9f1d6de052 100644 --- a/superset-frontend/plugins/legacy-preset-chart-deckgl/src/TooltipRow.tsx +++ b/superset-frontend/plugins/legacy-preset-chart-deckgl/src/TooltipRow.tsx @@ -16,8 +16,6 @@ * specific language governing permissions and limitations * under the License. */ -import React from 'react'; - type TooltipRowProps = { label: string; value: string; diff --git a/superset-frontend/plugins/legacy-preset-chart-deckgl/src/components/Legend.tsx b/superset-frontend/plugins/legacy-preset-chart-deckgl/src/components/Legend.tsx index f1f78485278d2..2b0a9b40da50b 100644 --- a/superset-frontend/plugins/legacy-preset-chart-deckgl/src/components/Legend.tsx +++ b/superset-frontend/plugins/legacy-preset-chart-deckgl/src/components/Legend.tsx @@ -19,7 +19,7 @@ * specific language governing permissions and limitations * under the License. */ -import React, { memo } from 'react'; +import { memo } from 'react'; import { formatNumber, styled } from '@superset-ui/core'; const StyledLegend = styled.div` diff --git a/superset-frontend/plugins/legacy-preset-chart-deckgl/src/components/Tooltip.tsx b/superset-frontend/plugins/legacy-preset-chart-deckgl/src/components/Tooltip.tsx index 564e18a8a3a21..0e9801c52f354 100644 --- a/superset-frontend/plugins/legacy-preset-chart-deckgl/src/components/Tooltip.tsx +++ b/superset-frontend/plugins/legacy-preset-chart-deckgl/src/components/Tooltip.tsx @@ -18,7 +18,7 @@ */ import { styled, safeHtmlSpan } from '@superset-ui/core'; -import React, { ReactNode } from 'react'; +import { ReactNode } from 'react'; export type TooltipProps = { tooltip: diff --git a/superset-frontend/plugins/legacy-preset-chart-deckgl/src/factory.tsx b/superset-frontend/plugins/legacy-preset-chart-deckgl/src/factory.tsx index fb1255a2fdc32..de8925e1dabfa 100644 --- a/superset-frontend/plugins/legacy-preset-chart-deckgl/src/factory.tsx +++ b/superset-frontend/plugins/legacy-preset-chart-deckgl/src/factory.tsx @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import React, { memo, useCallback, useEffect, useRef, useState } from 'react'; +import { memo, useCallback, useEffect, useRef, useState } from 'react'; import { isEqual } from 'lodash'; import { Layer } from 'deck.gl/typed'; import { diff --git a/superset-frontend/plugins/legacy-preset-chart-deckgl/src/layers/Arc/Arc.tsx b/superset-frontend/plugins/legacy-preset-chart-deckgl/src/layers/Arc/Arc.tsx index 7ad1870170410..87c820b34a40e 100644 --- a/superset-frontend/plugins/legacy-preset-chart-deckgl/src/layers/Arc/Arc.tsx +++ b/superset-frontend/plugins/legacy-preset-chart-deckgl/src/layers/Arc/Arc.tsx @@ -17,7 +17,6 @@ * under the License. */ import { ArcLayer } from 'deck.gl/typed'; -import React from 'react'; import { HandlerFunction, JsonObject, diff --git a/superset-frontend/plugins/legacy-preset-chart-deckgl/src/layers/Contour/Contour.tsx b/superset-frontend/plugins/legacy-preset-chart-deckgl/src/layers/Contour/Contour.tsx index 2c46bd6fc257f..2682b2b4d216b 100644 --- a/superset-frontend/plugins/legacy-preset-chart-deckgl/src/layers/Contour/Contour.tsx +++ b/superset-frontend/plugins/legacy-preset-chart-deckgl/src/layers/Contour/Contour.tsx @@ -17,7 +17,6 @@ * under the License. */ import { ContourLayer } from 'deck.gl'; -import React from 'react'; import { t } from '@superset-ui/core'; import { commonLayerProps } from '../common'; import sandboxedEval from '../../utils/sandbox'; diff --git a/superset-frontend/plugins/legacy-preset-chart-deckgl/src/layers/Geojson/Geojson.tsx b/superset-frontend/plugins/legacy-preset-chart-deckgl/src/layers/Geojson/Geojson.tsx index a5dc2a14a0386..e37548fe5ad24 100644 --- a/superset-frontend/plugins/legacy-preset-chart-deckgl/src/layers/Geojson/Geojson.tsx +++ b/superset-frontend/plugins/legacy-preset-chart-deckgl/src/layers/Geojson/Geojson.tsx @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import React, { memo, useCallback, useMemo, useRef } from 'react'; +import { memo, useCallback, useMemo, useRef } from 'react'; import { GeoJsonLayer } from 'deck.gl/typed'; import geojsonExtent from '@mapbox/geojson-extent'; import { diff --git a/superset-frontend/plugins/legacy-preset-chart-deckgl/src/layers/Grid/Grid.tsx b/superset-frontend/plugins/legacy-preset-chart-deckgl/src/layers/Grid/Grid.tsx index 887971d556779..ee5ae6c85fe06 100644 --- a/superset-frontend/plugins/legacy-preset-chart-deckgl/src/layers/Grid/Grid.tsx +++ b/superset-frontend/plugins/legacy-preset-chart-deckgl/src/layers/Grid/Grid.tsx @@ -17,7 +17,6 @@ * under the License. */ import { Color, GridLayer } from 'deck.gl/typed'; -import React from 'react'; import { t, CategoricalColorNamespace, diff --git a/superset-frontend/plugins/legacy-preset-chart-deckgl/src/layers/Heatmap/Heatmap.tsx b/superset-frontend/plugins/legacy-preset-chart-deckgl/src/layers/Heatmap/Heatmap.tsx index 5a1453459d9b9..9c603b53515fe 100644 --- a/superset-frontend/plugins/legacy-preset-chart-deckgl/src/layers/Heatmap/Heatmap.tsx +++ b/superset-frontend/plugins/legacy-preset-chart-deckgl/src/layers/Heatmap/Heatmap.tsx @@ -17,7 +17,6 @@ * under the License. */ import { HeatmapLayer, Position, Color } from 'deck.gl/typed'; -import React from 'react'; import { t, getSequentialSchemeRegistry, JsonObject } from '@superset-ui/core'; import { commonLayerProps } from '../common'; import sandboxedEval from '../../utils/sandbox'; diff --git a/superset-frontend/plugins/legacy-preset-chart-deckgl/src/layers/Hex/Hex.tsx b/superset-frontend/plugins/legacy-preset-chart-deckgl/src/layers/Hex/Hex.tsx index 0b8d3fd4286a6..84100da7586d8 100644 --- a/superset-frontend/plugins/legacy-preset-chart-deckgl/src/layers/Hex/Hex.tsx +++ b/superset-frontend/plugins/legacy-preset-chart-deckgl/src/layers/Hex/Hex.tsx @@ -17,7 +17,6 @@ * under the License. */ import { HexagonLayer, Color } from 'deck.gl/typed'; -import React from 'react'; import { t, CategoricalColorNamespace, diff --git a/superset-frontend/plugins/legacy-preset-chart-deckgl/src/layers/Path/Path.tsx b/superset-frontend/plugins/legacy-preset-chart-deckgl/src/layers/Path/Path.tsx index f2f5c35e3d46d..9d7f7077a6ec7 100644 --- a/superset-frontend/plugins/legacy-preset-chart-deckgl/src/layers/Path/Path.tsx +++ b/superset-frontend/plugins/legacy-preset-chart-deckgl/src/layers/Path/Path.tsx @@ -17,7 +17,6 @@ * specific language governing permissions and limitations * under the License. */ -import React from 'react'; import { PathLayer } from 'deck.gl/typed'; import { JsonObject, QueryFormData } from '@superset-ui/core'; import { commonLayerProps } from '../common'; diff --git a/superset-frontend/plugins/legacy-preset-chart-deckgl/src/layers/Polygon/Polygon.tsx b/superset-frontend/plugins/legacy-preset-chart-deckgl/src/layers/Polygon/Polygon.tsx index 08f2e4514069a..db2495ca7242f 100644 --- a/superset-frontend/plugins/legacy-preset-chart-deckgl/src/layers/Polygon/Polygon.tsx +++ b/superset-frontend/plugins/legacy-preset-chart-deckgl/src/layers/Polygon/Polygon.tsx @@ -21,7 +21,7 @@ */ /* eslint no-underscore-dangle: ["error", { "allow": ["", "__timestamp"] }] */ -import React, { memo, useCallback, useEffect, useRef, useState } from 'react'; +import { memo, useCallback, useEffect, useRef, useState } from 'react'; import { HandlerFunction, JsonObject, diff --git a/superset-frontend/plugins/legacy-preset-chart-deckgl/src/layers/Scatter/Scatter.tsx b/superset-frontend/plugins/legacy-preset-chart-deckgl/src/layers/Scatter/Scatter.tsx index 3ce1dcf25ef3d..4340c7083cca8 100644 --- a/superset-frontend/plugins/legacy-preset-chart-deckgl/src/layers/Scatter/Scatter.tsx +++ b/superset-frontend/plugins/legacy-preset-chart-deckgl/src/layers/Scatter/Scatter.tsx @@ -17,7 +17,6 @@ * under the License. */ import { ScatterplotLayer } from 'deck.gl/typed'; -import React from 'react'; import { Datasource, getMetricLabel, diff --git a/superset-frontend/plugins/legacy-preset-chart-deckgl/src/layers/Screengrid/Screengrid.tsx b/superset-frontend/plugins/legacy-preset-chart-deckgl/src/layers/Screengrid/Screengrid.tsx index 9584c8f53eed6..d620a98e67abf 100644 --- a/superset-frontend/plugins/legacy-preset-chart-deckgl/src/layers/Screengrid/Screengrid.tsx +++ b/superset-frontend/plugins/legacy-preset-chart-deckgl/src/layers/Screengrid/Screengrid.tsx @@ -20,7 +20,7 @@ */ /* eslint no-underscore-dangle: ["error", { "allow": ["", "__timestamp"] }] */ -import React, { memo, useCallback, useEffect, useRef, useState } from 'react'; +import { memo, useCallback, useEffect, useRef, useState } from 'react'; import { ScreenGridLayer } from 'deck.gl/typed'; import { JsonObject, JsonValue, QueryFormData, t } from '@superset-ui/core'; import { noop } from 'lodash'; diff --git a/superset-frontend/plugins/legacy-preset-chart-deckgl/src/utilities/Shared_DeckGL.jsx b/superset-frontend/plugins/legacy-preset-chart-deckgl/src/utilities/Shared_DeckGL.jsx index 723407c5ad6c2..83491f86f75b9 100644 --- a/superset-frontend/plugins/legacy-preset-chart-deckgl/src/utilities/Shared_DeckGL.jsx +++ b/superset-frontend/plugins/legacy-preset-chart-deckgl/src/utilities/Shared_DeckGL.jsx @@ -19,7 +19,6 @@ // These are control configurations that are shared ONLY within the DeckGL viz plugin repo. -import React from 'react'; import { FeatureFlag, isFeatureEnabled, diff --git a/superset-frontend/plugins/legacy-preset-chart-nvd3/src/NVD3Controls.tsx b/superset-frontend/plugins/legacy-preset-chart-nvd3/src/NVD3Controls.tsx index 01b1bad46fa33..1c58721ffb821 100644 --- a/superset-frontend/plugins/legacy-preset-chart-nvd3/src/NVD3Controls.tsx +++ b/superset-frontend/plugins/legacy-preset-chart-nvd3/src/NVD3Controls.tsx @@ -18,7 +18,6 @@ */ /* eslint-disable react/jsx-key */ -import React from 'react'; import { t } from '@superset-ui/core'; import { ControlPanelSectionConfig, diff --git a/superset-frontend/plugins/legacy-preset-chart-nvd3/src/ReactNVD3.jsx b/superset-frontend/plugins/legacy-preset-chart-nvd3/src/ReactNVD3.jsx index f7f219a05d219..dfb2124ef035b 100644 --- a/superset-frontend/plugins/legacy-preset-chart-nvd3/src/ReactNVD3.jsx +++ b/superset-frontend/plugins/legacy-preset-chart-nvd3/src/ReactNVD3.jsx @@ -16,7 +16,6 @@ * specific language governing permissions and limitations * under the License. */ -import React from 'react'; import { reactify, styled } from '@superset-ui/core'; import PropTypes from 'prop-types'; import Component from './NVD3Vis'; diff --git a/superset-frontend/plugins/plugin-chart-echarts/src/BigNumber/BigNumberPeriodOverPeriod/PopKPI.tsx b/superset-frontend/plugins/plugin-chart-echarts/src/BigNumber/BigNumberPeriodOverPeriod/PopKPI.tsx index 5292432fd21f9..04997ad6976cb 100644 --- a/superset-frontend/plugins/plugin-chart-echarts/src/BigNumber/BigNumberPeriodOverPeriod/PopKPI.tsx +++ b/superset-frontend/plugins/plugin-chart-echarts/src/BigNumber/BigNumberPeriodOverPeriod/PopKPI.tsx @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import React, { useEffect, useMemo, useState } from 'react'; +import { useEffect, useMemo, useState } from 'react'; import { css, ensureIsArray, diff --git a/superset-frontend/plugins/plugin-chart-echarts/src/BigNumber/BigNumberViz.tsx b/superset-frontend/plugins/plugin-chart-echarts/src/BigNumber/BigNumberViz.tsx index 8a95a81d5f06b..c596e94aefca2 100644 --- a/superset-frontend/plugins/plugin-chart-echarts/src/BigNumber/BigNumberViz.tsx +++ b/superset-frontend/plugins/plugin-chart-echarts/src/BigNumber/BigNumberViz.tsx @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import React, { MouseEvent } from 'react'; +import { PureComponent, MouseEvent } from 'react'; import { t, getNumberFormatter, @@ -41,7 +41,7 @@ const PROPORTION = { TRENDLINE: 0.3, }; -class BigNumberVis extends React.PureComponent { +class BigNumberVis extends PureComponent { static defaultProps = { className: '', headerFormatter: defaultNumberFormatter, diff --git a/superset-frontend/plugins/plugin-chart-echarts/src/BigNumber/BigNumberWithTrendline/controlPanel.tsx b/superset-frontend/plugins/plugin-chart-echarts/src/BigNumber/BigNumberWithTrendline/controlPanel.tsx index 3e02ccce8ce88..86f8216d26697 100644 --- a/superset-frontend/plugins/plugin-chart-echarts/src/BigNumber/BigNumberWithTrendline/controlPanel.tsx +++ b/superset-frontend/plugins/plugin-chart-echarts/src/BigNumber/BigNumberWithTrendline/controlPanel.tsx @@ -25,7 +25,6 @@ import { getStandardizedControls, temporalColumnMixin, } from '@superset-ui/chart-controls'; -import React from 'react'; import { headerFontSize, subheaderFontSize } from '../sharedControls'; const config: ControlPanelConfig = { diff --git a/superset-frontend/plugins/plugin-chart-echarts/src/BoxPlot/EchartsBoxPlot.tsx b/superset-frontend/plugins/plugin-chart-echarts/src/BoxPlot/EchartsBoxPlot.tsx index e66035a3c7989..d293361f1daad 100644 --- a/superset-frontend/plugins/plugin-chart-echarts/src/BoxPlot/EchartsBoxPlot.tsx +++ b/superset-frontend/plugins/plugin-chart-echarts/src/BoxPlot/EchartsBoxPlot.tsx @@ -16,7 +16,6 @@ * specific language governing permissions and limitations * under the License. */ -import React from 'react'; import Echart from '../components/Echart'; import { allEventHandlers } from '../utils/eventHandlers'; import { BoxPlotChartTransformedProps } from './types'; diff --git a/superset-frontend/plugins/plugin-chart-echarts/src/Bubble/EchartsBubble.tsx b/superset-frontend/plugins/plugin-chart-echarts/src/Bubble/EchartsBubble.tsx index 1d64b25161fd5..4aab4a2d240fd 100644 --- a/superset-frontend/plugins/plugin-chart-echarts/src/Bubble/EchartsBubble.tsx +++ b/superset-frontend/plugins/plugin-chart-echarts/src/Bubble/EchartsBubble.tsx @@ -16,7 +16,6 @@ * specific language governing permissions and limitations * under the License. */ -import React from 'react'; import { BubbleChartTransformedProps } from './types'; import Echart from '../components/Echart'; diff --git a/superset-frontend/plugins/plugin-chart-echarts/src/Funnel/EchartsFunnel.tsx b/superset-frontend/plugins/plugin-chart-echarts/src/Funnel/EchartsFunnel.tsx index b20fc858fa2ca..4ae0ab49209e4 100644 --- a/superset-frontend/plugins/plugin-chart-echarts/src/Funnel/EchartsFunnel.tsx +++ b/superset-frontend/plugins/plugin-chart-echarts/src/Funnel/EchartsFunnel.tsx @@ -16,7 +16,6 @@ * specific language governing permissions and limitations * under the License. */ -import React from 'react'; import { FunnelChartTransformedProps } from './types'; import Echart from '../components/Echart'; import { allEventHandlers } from '../utils/eventHandlers'; diff --git a/superset-frontend/plugins/plugin-chart-echarts/src/Funnel/controlPanel.tsx b/superset-frontend/plugins/plugin-chart-echarts/src/Funnel/controlPanel.tsx index 9cad10bf1e2bc..a8e4f01644d47 100644 --- a/superset-frontend/plugins/plugin-chart-echarts/src/Funnel/controlPanel.tsx +++ b/superset-frontend/plugins/plugin-chart-echarts/src/Funnel/controlPanel.tsx @@ -16,7 +16,6 @@ * specific language governing permissions and limitations * under the License. */ -import React from 'react'; import { t } from '@superset-ui/core'; import { ControlPanelConfig, diff --git a/superset-frontend/plugins/plugin-chart-echarts/src/Gauge/EchartsGauge.tsx b/superset-frontend/plugins/plugin-chart-echarts/src/Gauge/EchartsGauge.tsx index f8536ba88f1ff..14ec2ebb7c899 100644 --- a/superset-frontend/plugins/plugin-chart-echarts/src/Gauge/EchartsGauge.tsx +++ b/superset-frontend/plugins/plugin-chart-echarts/src/Gauge/EchartsGauge.tsx @@ -16,7 +16,6 @@ * specific language governing permissions and limitations * under the License. */ -import React from 'react'; import { GaugeChartTransformedProps } from './types'; import Echart from '../components/Echart'; import { allEventHandlers } from '../utils/eventHandlers'; diff --git a/superset-frontend/plugins/plugin-chart-echarts/src/Gauge/controlPanel.tsx b/superset-frontend/plugins/plugin-chart-echarts/src/Gauge/controlPanel.tsx index 1a0c079e6c587..8727a23c72e49 100644 --- a/superset-frontend/plugins/plugin-chart-echarts/src/Gauge/controlPanel.tsx +++ b/superset-frontend/plugins/plugin-chart-echarts/src/Gauge/controlPanel.tsx @@ -16,7 +16,6 @@ * specific language governing permissions and limitations * under the License. */ -import React from 'react'; import { t } from '@superset-ui/core'; import { sharedControls, diff --git a/superset-frontend/plugins/plugin-chart-echarts/src/Graph/EchartsGraph.tsx b/superset-frontend/plugins/plugin-chart-echarts/src/Graph/EchartsGraph.tsx index 308d28f719137..830af8f9e8087 100644 --- a/superset-frontend/plugins/plugin-chart-echarts/src/Graph/EchartsGraph.tsx +++ b/superset-frontend/plugins/plugin-chart-echarts/src/Graph/EchartsGraph.tsx @@ -16,7 +16,6 @@ * specific language governing permissions and limitations * under the License. */ -import React from 'react'; import { getColumnLabel, getNumberFormatter, diff --git a/superset-frontend/plugins/plugin-chart-echarts/src/Graph/controlPanel.tsx b/superset-frontend/plugins/plugin-chart-echarts/src/Graph/controlPanel.tsx index b594eb5a96e2b..6407084029ebc 100644 --- a/superset-frontend/plugins/plugin-chart-echarts/src/Graph/controlPanel.tsx +++ b/superset-frontend/plugins/plugin-chart-echarts/src/Graph/controlPanel.tsx @@ -16,7 +16,6 @@ * specific language governing permissions and limitations * under the License. */ -import React from 'react'; import { t } from '@superset-ui/core'; import { ControlPanelConfig, diff --git a/superset-frontend/plugins/plugin-chart-echarts/src/Heatmap/Heatmap.tsx b/superset-frontend/plugins/plugin-chart-echarts/src/Heatmap/Heatmap.tsx index 555b9a63a3ef5..96bd0ed413984 100644 --- a/superset-frontend/plugins/plugin-chart-echarts/src/Heatmap/Heatmap.tsx +++ b/superset-frontend/plugins/plugin-chart-echarts/src/Heatmap/Heatmap.tsx @@ -16,7 +16,6 @@ * specific language governing permissions and limitations * under the License. */ -import React from 'react'; import { HeatmapTransformedProps } from './types'; import Echart from '../components/Echart'; diff --git a/superset-frontend/plugins/plugin-chart-echarts/src/Heatmap/controlPanel.tsx b/superset-frontend/plugins/plugin-chart-echarts/src/Heatmap/controlPanel.tsx index 28356e644104f..16b825e8463bc 100644 --- a/superset-frontend/plugins/plugin-chart-echarts/src/Heatmap/controlPanel.tsx +++ b/superset-frontend/plugins/plugin-chart-echarts/src/Heatmap/controlPanel.tsx @@ -16,7 +16,6 @@ * specific language governing permissions and limitations * under the License. */ -import React from 'react'; import { t, validateNonEmpty } from '@superset-ui/core'; import { ControlPanelConfig, diff --git a/superset-frontend/plugins/plugin-chart-echarts/src/MixedTimeseries/EchartsMixedTimeseries.tsx b/superset-frontend/plugins/plugin-chart-echarts/src/MixedTimeseries/EchartsMixedTimeseries.tsx index 0d04de15ba4b0..a0b0d93ffba60 100644 --- a/superset-frontend/plugins/plugin-chart-echarts/src/MixedTimeseries/EchartsMixedTimeseries.tsx +++ b/superset-frontend/plugins/plugin-chart-echarts/src/MixedTimeseries/EchartsMixedTimeseries.tsx @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import React, { useCallback } from 'react'; +import { useCallback } from 'react'; import { AxisType, BinaryQueryObjectFilterClause, diff --git a/superset-frontend/plugins/plugin-chart-echarts/src/MixedTimeseries/controlPanel.tsx b/superset-frontend/plugins/plugin-chart-echarts/src/MixedTimeseries/controlPanel.tsx index 5b24c9ab584a1..201244f689412 100644 --- a/superset-frontend/plugins/plugin-chart-echarts/src/MixedTimeseries/controlPanel.tsx +++ b/superset-frontend/plugins/plugin-chart-echarts/src/MixedTimeseries/controlPanel.tsx @@ -16,7 +16,6 @@ * specific language governing permissions and limitations * under the License. */ -import React from 'react'; import { ensureIsArray, t } from '@superset-ui/core'; import { cloneDeep } from 'lodash'; import { diff --git a/superset-frontend/plugins/plugin-chart-echarts/src/Pie/EchartsPie.tsx b/superset-frontend/plugins/plugin-chart-echarts/src/Pie/EchartsPie.tsx index 3cd697248c6e1..fb82cd53bcd7d 100644 --- a/superset-frontend/plugins/plugin-chart-echarts/src/Pie/EchartsPie.tsx +++ b/superset-frontend/plugins/plugin-chart-echarts/src/Pie/EchartsPie.tsx @@ -16,7 +16,6 @@ * specific language governing permissions and limitations * under the License. */ -import React from 'react'; import { PieChartTransformedProps } from './types'; import Echart from '../components/Echart'; import { allEventHandlers } from '../utils/eventHandlers'; diff --git a/superset-frontend/plugins/plugin-chart-echarts/src/Pie/controlPanel.tsx b/superset-frontend/plugins/plugin-chart-echarts/src/Pie/controlPanel.tsx index b197c9743bfe8..b4ae075b0c878 100644 --- a/superset-frontend/plugins/plugin-chart-echarts/src/Pie/controlPanel.tsx +++ b/superset-frontend/plugins/plugin-chart-echarts/src/Pie/controlPanel.tsx @@ -16,7 +16,6 @@ * specific language governing permissions and limitations * under the License. */ -import React from 'react'; import { ensureIsInt, t, validateNonEmpty } from '@superset-ui/core'; import { ControlPanelConfig, diff --git a/superset-frontend/plugins/plugin-chart-echarts/src/Radar/EchartsRadar.tsx b/superset-frontend/plugins/plugin-chart-echarts/src/Radar/EchartsRadar.tsx index 5ec4eaf8cbd0f..b8937bd42d172 100644 --- a/superset-frontend/plugins/plugin-chart-echarts/src/Radar/EchartsRadar.tsx +++ b/superset-frontend/plugins/plugin-chart-echarts/src/Radar/EchartsRadar.tsx @@ -16,7 +16,6 @@ * specific language governing permissions and limitations * under the License. */ -import React from 'react'; import { RadarChartTransformedProps } from './types'; import Echart from '../components/Echart'; import { allEventHandlers } from '../utils/eventHandlers'; diff --git a/superset-frontend/plugins/plugin-chart-echarts/src/Radar/controlPanel.tsx b/superset-frontend/plugins/plugin-chart-echarts/src/Radar/controlPanel.tsx index 628939743694c..267e89cff9aed 100644 --- a/superset-frontend/plugins/plugin-chart-echarts/src/Radar/controlPanel.tsx +++ b/superset-frontend/plugins/plugin-chart-echarts/src/Radar/controlPanel.tsx @@ -16,7 +16,6 @@ * specific language governing permissions and limitations * under the License. */ -import React from 'react'; import { ChartDataResponseResult, GenericDataType, diff --git a/superset-frontend/plugins/plugin-chart-echarts/src/Sunburst/EchartsSunburst.tsx b/superset-frontend/plugins/plugin-chart-echarts/src/Sunburst/EchartsSunburst.tsx index 29677d25640f2..5d74c50c4bbf8 100644 --- a/superset-frontend/plugins/plugin-chart-echarts/src/Sunburst/EchartsSunburst.tsx +++ b/superset-frontend/plugins/plugin-chart-echarts/src/Sunburst/EchartsSunburst.tsx @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import React, { useCallback } from 'react'; +import { useCallback } from 'react'; import { BinaryQueryObjectFilterClause, getColumnLabel, diff --git a/superset-frontend/plugins/plugin-chart-echarts/src/Sunburst/controlPanel.tsx b/superset-frontend/plugins/plugin-chart-echarts/src/Sunburst/controlPanel.tsx index 3d4506f3181e1..532b19b410a26 100644 --- a/superset-frontend/plugins/plugin-chart-echarts/src/Sunburst/controlPanel.tsx +++ b/superset-frontend/plugins/plugin-chart-echarts/src/Sunburst/controlPanel.tsx @@ -16,7 +16,6 @@ * specific language governing permissions and limitations * under the License. */ -import React from 'react'; import { t } from '@superset-ui/core'; import { ControlPanelConfig, diff --git a/superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/Area/controlPanel.tsx b/superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/Area/controlPanel.tsx index 79cd92a504a2c..ae9dc0afaac39 100644 --- a/superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/Area/controlPanel.tsx +++ b/superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/Area/controlPanel.tsx @@ -16,7 +16,6 @@ * specific language governing permissions and limitations * under the License. */ -import React from 'react'; import { t } from '@superset-ui/core'; import { ControlPanelConfig, diff --git a/superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/EchartsTimeseries.tsx b/superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/EchartsTimeseries.tsx index 14ec5ac32d8aa..e9cc9f687b75f 100644 --- a/superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/EchartsTimeseries.tsx +++ b/superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/EchartsTimeseries.tsx @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import React, { useCallback, useEffect, useRef, useState } from 'react'; +import { useCallback, useEffect, useRef, useState } from 'react'; import { DTTM_ALIAS, BinaryQueryObjectFilterClause, diff --git a/superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/Regular/Bar/controlPanel.tsx b/superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/Regular/Bar/controlPanel.tsx index ba2f873a17227..7482c7a16b01d 100644 --- a/superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/Regular/Bar/controlPanel.tsx +++ b/superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/Regular/Bar/controlPanel.tsx @@ -16,7 +16,6 @@ * specific language governing permissions and limitations * under the License. */ -import React from 'react'; import { t } from '@superset-ui/core'; import { ControlPanelConfig, diff --git a/superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/Regular/Line/controlPanel.tsx b/superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/Regular/Line/controlPanel.tsx index f6f3fb8e8e4f0..ca5d3377c4f8d 100644 --- a/superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/Regular/Line/controlPanel.tsx +++ b/superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/Regular/Line/controlPanel.tsx @@ -16,7 +16,6 @@ * specific language governing permissions and limitations * under the License. */ -import React from 'react'; import { t } from '@superset-ui/core'; import { ControlPanelConfig, diff --git a/superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/Regular/Scatter/controlPanel.tsx b/superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/Regular/Scatter/controlPanel.tsx index 66550b418d1ea..8ca10e02fdb06 100644 --- a/superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/Regular/Scatter/controlPanel.tsx +++ b/superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/Regular/Scatter/controlPanel.tsx @@ -16,7 +16,6 @@ * specific language governing permissions and limitations * under the License. */ -import React from 'react'; import { t } from '@superset-ui/core'; import { ControlPanelConfig, diff --git a/superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/Regular/SmoothLine/controlPanel.tsx b/superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/Regular/SmoothLine/controlPanel.tsx index 6472eeea12c8d..45681d7be7fb6 100644 --- a/superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/Regular/SmoothLine/controlPanel.tsx +++ b/superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/Regular/SmoothLine/controlPanel.tsx @@ -16,7 +16,6 @@ * specific language governing permissions and limitations * under the License. */ -import React from 'react'; import { t } from '@superset-ui/core'; import { ControlPanelConfig, diff --git a/superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/Step/controlPanel.tsx b/superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/Step/controlPanel.tsx index 05870f6a62f5e..274f11d629337 100644 --- a/superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/Step/controlPanel.tsx +++ b/superset-frontend/plugins/plugin-chart-echarts/src/Timeseries/Step/controlPanel.tsx @@ -16,7 +16,6 @@ * specific language governing permissions and limitations * under the License. */ -import React from 'react'; import { t } from '@superset-ui/core'; import { ControlPanelConfig, diff --git a/superset-frontend/plugins/plugin-chart-echarts/src/Tree/EchartsTree.tsx b/superset-frontend/plugins/plugin-chart-echarts/src/Tree/EchartsTree.tsx index b1b3f8e896e04..8e561154c43e1 100644 --- a/superset-frontend/plugins/plugin-chart-echarts/src/Tree/EchartsTree.tsx +++ b/superset-frontend/plugins/plugin-chart-echarts/src/Tree/EchartsTree.tsx @@ -16,7 +16,6 @@ * specific language governing permissions and limitations * under the License. */ -import React from 'react'; import { EchartsProps } from '../types'; import Echart from '../components/Echart'; diff --git a/superset-frontend/plugins/plugin-chart-echarts/src/Tree/controlPanel.tsx b/superset-frontend/plugins/plugin-chart-echarts/src/Tree/controlPanel.tsx index e3c5ed5755ab1..34d65a27d315d 100644 --- a/superset-frontend/plugins/plugin-chart-echarts/src/Tree/controlPanel.tsx +++ b/superset-frontend/plugins/plugin-chart-echarts/src/Tree/controlPanel.tsx @@ -16,7 +16,6 @@ * specific language governing permissions and limitations * under the License. */ -import React from 'react'; import { t } from '@superset-ui/core'; import { ControlPanelConfig, diff --git a/superset-frontend/plugins/plugin-chart-echarts/src/Treemap/EchartsTreemap.tsx b/superset-frontend/plugins/plugin-chart-echarts/src/Treemap/EchartsTreemap.tsx index 00dcc11aacef0..343c8cf72cfe5 100644 --- a/superset-frontend/plugins/plugin-chart-echarts/src/Treemap/EchartsTreemap.tsx +++ b/superset-frontend/plugins/plugin-chart-echarts/src/Treemap/EchartsTreemap.tsx @@ -23,7 +23,7 @@ import { getColumnLabel, getNumberFormatter, } from '@superset-ui/core'; -import React, { useCallback } from 'react'; +import { useCallback } from 'react'; import Echart from '../components/Echart'; import { NULL_STRING } from '../constants'; import { EventHandlers } from '../types'; diff --git a/superset-frontend/plugins/plugin-chart-echarts/src/Treemap/controlPanel.tsx b/superset-frontend/plugins/plugin-chart-echarts/src/Treemap/controlPanel.tsx index 282cbe565bd13..2e09f25d1e95b 100644 --- a/superset-frontend/plugins/plugin-chart-echarts/src/Treemap/controlPanel.tsx +++ b/superset-frontend/plugins/plugin-chart-echarts/src/Treemap/controlPanel.tsx @@ -16,7 +16,6 @@ * specific language governing permissions and limitations * under the License. */ -import React from 'react'; import { t } from '@superset-ui/core'; import { ControlPanelConfig, diff --git a/superset-frontend/plugins/plugin-chart-echarts/src/Waterfall/EchartsWaterfall.tsx b/superset-frontend/plugins/plugin-chart-echarts/src/Waterfall/EchartsWaterfall.tsx index b69d2d72b7a8e..99d81354ebcd6 100644 --- a/superset-frontend/plugins/plugin-chart-echarts/src/Waterfall/EchartsWaterfall.tsx +++ b/superset-frontend/plugins/plugin-chart-echarts/src/Waterfall/EchartsWaterfall.tsx @@ -16,7 +16,6 @@ * specific language governing permissions and limitations * under the License. */ -import React from 'react'; import Echart from '../components/Echart'; import { WaterfallChartTransformedProps } from './types'; import { EventHandlers } from '../types'; diff --git a/superset-frontend/plugins/plugin-chart-echarts/src/Waterfall/controlPanel.tsx b/superset-frontend/plugins/plugin-chart-echarts/src/Waterfall/controlPanel.tsx index 7a71dd4fcba55..e18ba6ba6b7ac 100644 --- a/superset-frontend/plugins/plugin-chart-echarts/src/Waterfall/controlPanel.tsx +++ b/superset-frontend/plugins/plugin-chart-echarts/src/Waterfall/controlPanel.tsx @@ -16,7 +16,6 @@ * specific language governing permissions and limitations * under the License. */ -import React from 'react'; import { t } from '@superset-ui/core'; import { ControlPanelConfig, diff --git a/superset-frontend/plugins/plugin-chart-echarts/src/components/Echart.tsx b/superset-frontend/plugins/plugin-chart-echarts/src/components/Echart.tsx index 011d62abacec4..5d85fac317ffc 100644 --- a/superset-frontend/plugins/plugin-chart-echarts/src/components/Echart.tsx +++ b/superset-frontend/plugins/plugin-chart-echarts/src/components/Echart.tsx @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import React, { +import { useRef, useEffect, useMemo, @@ -24,7 +24,9 @@ import React, { useImperativeHandle, useLayoutEffect, useCallback, + Ref, } from 'react'; + import { styled } from '@superset-ui/core'; import { ECharts, init } from 'echarts'; import { EchartsHandler, EchartsProps, EchartsStylesProps } from '../types'; @@ -44,7 +46,7 @@ function Echart( selectedValues = {}, refs, }: EchartsProps, - ref: React.Ref, + ref: Ref, ) { const divRef = useRef(null); if (refs) { diff --git a/superset-frontend/plugins/plugin-chart-echarts/src/components/ExtraControls.tsx b/superset-frontend/plugins/plugin-chart-echarts/src/components/ExtraControls.tsx index 33e9ab016eb0e..d3492a657cc41 100644 --- a/superset-frontend/plugins/plugin-chart-echarts/src/components/ExtraControls.tsx +++ b/superset-frontend/plugins/plugin-chart-echarts/src/components/ExtraControls.tsx @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import React, { useState, useEffect, useMemo, useCallback } from 'react'; +import { useState, useEffect, useMemo, useCallback } from 'react'; import { HandlerFunction, JsonValue, styled } from '@superset-ui/core'; import { RadioButtonOption, diff --git a/superset-frontend/plugins/plugin-chart-echarts/src/controls.tsx b/superset-frontend/plugins/plugin-chart-echarts/src/controls.tsx index c91d27acc6ab1..13a8b2ff060ba 100644 --- a/superset-frontend/plugins/plugin-chart-echarts/src/controls.tsx +++ b/superset-frontend/plugins/plugin-chart-echarts/src/controls.tsx @@ -16,7 +16,6 @@ * specific language governing permissions and limitations * under the License. */ -import React from 'react'; import { t } from '@superset-ui/core'; import { ControlPanelsContainerProps, diff --git a/superset-frontend/plugins/plugin-chart-echarts/src/types.ts b/superset-frontend/plugins/plugin-chart-echarts/src/types.ts index 790c95e05bffb..4126aaeda742d 100644 --- a/superset-frontend/plugins/plugin-chart-echarts/src/types.ts +++ b/superset-frontend/plugins/plugin-chart-echarts/src/types.ts @@ -16,7 +16,8 @@ * specific language governing permissions and limitations * under the License. */ -import React, { RefObject } from 'react'; +import { RefObject, Ref } from 'react'; + import { ChartDataResponseResult, ChartProps, @@ -41,7 +42,7 @@ export type EchartsStylesProps = { }; export type Refs = { - echartRef?: React.Ref; + echartRef?: Ref; divRef?: RefObject; }; diff --git a/superset-frontend/plugins/plugin-chart-handlebars/src/Handlebars.tsx b/superset-frontend/plugins/plugin-chart-handlebars/src/Handlebars.tsx index c219e4256e484..c4305a2a8c8ba 100644 --- a/superset-frontend/plugins/plugin-chart-handlebars/src/Handlebars.tsx +++ b/superset-frontend/plugins/plugin-chart-handlebars/src/Handlebars.tsx @@ -17,7 +17,7 @@ * under the License. */ import { styled } from '@superset-ui/core'; -import React, { createRef } from 'react'; +import { createRef } from 'react'; import { HandlebarsViewer } from './components/Handlebars/HandlebarsViewer'; import { HandlebarsProps, HandlebarsStylesProps } from './types'; diff --git a/superset-frontend/plugins/plugin-chart-handlebars/src/components/CodeEditor/CodeEditor.tsx b/superset-frontend/plugins/plugin-chart-handlebars/src/components/CodeEditor/CodeEditor.tsx index 5128fd8275388..ef37e5468aefc 100644 --- a/superset-frontend/plugins/plugin-chart-handlebars/src/components/CodeEditor/CodeEditor.tsx +++ b/superset-frontend/plugins/plugin-chart-handlebars/src/components/CodeEditor/CodeEditor.tsx @@ -17,7 +17,7 @@ * under the License. */ -import React, { FC } from 'react'; +import { FC } from 'react'; import AceEditor, { IAceEditorProps } from 'react-ace'; // must go after AceEditor import diff --git a/superset-frontend/plugins/plugin-chart-handlebars/src/components/ControlHeader/controlHeader.tsx b/superset-frontend/plugins/plugin-chart-handlebars/src/components/ControlHeader/controlHeader.tsx index 460b56f196917..9bdb452f7a783 100644 --- a/superset-frontend/plugins/plugin-chart-handlebars/src/components/ControlHeader/controlHeader.tsx +++ b/superset-frontend/plugins/plugin-chart-handlebars/src/components/ControlHeader/controlHeader.tsx @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import React, { ReactNode } from 'react'; +import { ReactNode } from 'react'; interface ControlHeaderProps { children: ReactNode; diff --git a/superset-frontend/plugins/plugin-chart-handlebars/src/components/Handlebars/HandlebarsViewer.tsx b/superset-frontend/plugins/plugin-chart-handlebars/src/components/Handlebars/HandlebarsViewer.tsx index 371b4f48f91a6..45a191757fd01 100644 --- a/superset-frontend/plugins/plugin-chart-handlebars/src/components/Handlebars/HandlebarsViewer.tsx +++ b/superset-frontend/plugins/plugin-chart-handlebars/src/components/Handlebars/HandlebarsViewer.tsx @@ -19,7 +19,7 @@ import { SafeMarkdown, styled, t } from '@superset-ui/core'; import Handlebars from 'handlebars'; import moment from 'moment'; -import React, { useMemo, useState } from 'react'; +import { useMemo, useState } from 'react'; import { isPlainObject } from 'lodash'; import Helpers from 'just-handlebars-helpers'; diff --git a/superset-frontend/plugins/plugin-chart-handlebars/src/plugin/controls/handlebarTemplate.tsx b/superset-frontend/plugins/plugin-chart-handlebars/src/plugin/controls/handlebarTemplate.tsx index efe027b86fb31..71b5b9b067a6f 100644 --- a/superset-frontend/plugins/plugin-chart-handlebars/src/plugin/controls/handlebarTemplate.tsx +++ b/superset-frontend/plugins/plugin-chart-handlebars/src/plugin/controls/handlebarTemplate.tsx @@ -22,7 +22,6 @@ import { sharedControls, } from '@superset-ui/chart-controls'; import { t, validateNonEmpty } from '@superset-ui/core'; -import React from 'react'; import { CodeEditor } from '../../components/CodeEditor/CodeEditor'; import { ControlHeader } from '../../components/ControlHeader/controlHeader'; import { debounceFunc } from '../../consts'; diff --git a/superset-frontend/plugins/plugin-chart-handlebars/src/plugin/controls/style.tsx b/superset-frontend/plugins/plugin-chart-handlebars/src/plugin/controls/style.tsx index f89a1a6679e1f..b5f8dc93827a8 100644 --- a/superset-frontend/plugins/plugin-chart-handlebars/src/plugin/controls/style.tsx +++ b/superset-frontend/plugins/plugin-chart-handlebars/src/plugin/controls/style.tsx @@ -23,7 +23,6 @@ import { InfoTooltipWithTrigger, } from '@superset-ui/chart-controls'; import { t, useTheme } from '@superset-ui/core'; -import React from 'react'; import { CodeEditor } from '../../components/CodeEditor/CodeEditor'; import { ControlHeader } from '../../components/ControlHeader/controlHeader'; import { debounceFunc } from '../../consts'; diff --git a/superset-frontend/plugins/plugin-chart-pivot-table/src/PivotTableChart.tsx b/superset-frontend/plugins/plugin-chart-pivot-table/src/PivotTableChart.tsx index c727e0cfcad69..0c83a152df95e 100644 --- a/superset-frontend/plugins/plugin-chart-pivot-table/src/PivotTableChart.tsx +++ b/superset-frontend/plugins/plugin-chart-pivot-table/src/PivotTableChart.tsx @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import React, { useCallback, useMemo } from 'react'; +import { useCallback, useMemo } from 'react'; import { MinusSquareOutlined, PlusSquareOutlined } from '@ant-design/icons'; import { AdhocMetric, diff --git a/superset-frontend/plugins/plugin-chart-pivot-table/src/plugin/controlPanel.tsx b/superset-frontend/plugins/plugin-chart-pivot-table/src/plugin/controlPanel.tsx index 7351d6d9ee386..9f6164e944eeb 100644 --- a/superset-frontend/plugins/plugin-chart-pivot-table/src/plugin/controlPanel.tsx +++ b/superset-frontend/plugins/plugin-chart-pivot-table/src/plugin/controlPanel.tsx @@ -16,7 +16,6 @@ * specific language governing permissions and limitations * under the License. */ -import React from 'react'; import { ensureIsArray, isAdhocColumn, diff --git a/superset-frontend/plugins/plugin-chart-pivot-table/src/react-pivottable/PivotTable.jsx b/superset-frontend/plugins/plugin-chart-pivot-table/src/react-pivottable/PivotTable.jsx index 610e80c0c3fe0..aa8fbe4f5b52f 100644 --- a/superset-frontend/plugins/plugin-chart-pivot-table/src/react-pivottable/PivotTable.jsx +++ b/superset-frontend/plugins/plugin-chart-pivot-table/src/react-pivottable/PivotTable.jsx @@ -17,10 +17,10 @@ * under the License. */ -import React from 'react'; +import { PureComponent } from 'react'; import { TableRenderer } from './TableRenderers'; -class PivotTable extends React.PureComponent { +class PivotTable extends PureComponent { render() { return ; } diff --git a/superset-frontend/plugins/plugin-chart-pivot-table/src/react-pivottable/TableRenderers.jsx b/superset-frontend/plugins/plugin-chart-pivot-table/src/react-pivottable/TableRenderers.jsx index 88d410193b49e..055c87b046344 100644 --- a/superset-frontend/plugins/plugin-chart-pivot-table/src/react-pivottable/TableRenderers.jsx +++ b/superset-frontend/plugins/plugin-chart-pivot-table/src/react-pivottable/TableRenderers.jsx @@ -17,7 +17,7 @@ * under the License. */ -import React from 'react'; +import { Component } from 'react'; import { t } from '@superset-ui/core'; import PropTypes from 'prop-types'; import { PivotData, flatKey } from './utilities'; @@ -59,7 +59,7 @@ function displayHeaderCell( ); } -export class TableRenderer extends React.Component { +export class TableRenderer extends Component { constructor(props) { super(props); diff --git a/superset-frontend/plugins/plugin-chart-table/src/DataTable/DataTable.tsx b/superset-frontend/plugins/plugin-chart-table/src/DataTable/DataTable.tsx index 67202d5a0e08f..0501b9e0f87b1 100644 --- a/superset-frontend/plugins/plugin-chart-table/src/DataTable/DataTable.tsx +++ b/superset-frontend/plugins/plugin-chart-table/src/DataTable/DataTable.tsx @@ -16,14 +16,16 @@ * specific language governing permissions and limitations * under the License. */ -import React, { +import { useCallback, useRef, ReactNode, HTMLProps, MutableRefObject, CSSProperties, + DragEvent, } from 'react'; + import { useTable, usePagination, @@ -223,7 +225,7 @@ export default typedMemo(function DataTable({ let columnBeingDragged = -1; - const onDragStart = (e: React.DragEvent) => { + const onDragStart = (e: DragEvent) => { const el = e.target as HTMLTableCellElement; columnBeingDragged = allColumns.findIndex( col => col.id === el.dataset.columnName, @@ -231,7 +233,7 @@ export default typedMemo(function DataTable({ e.dataTransfer.setData('text/plain', `${columnBeingDragged}`); }; - const onDrop = (e: React.DragEvent) => { + const onDrop = (e: DragEvent) => { const el = e.target as HTMLTableCellElement; const newPosition = allColumns.findIndex( col => col.id === el.dataset.columnName, diff --git a/superset-frontend/plugins/plugin-chart-table/src/DataTable/components/GlobalFilter.tsx b/superset-frontend/plugins/plugin-chart-table/src/DataTable/components/GlobalFilter.tsx index 8e36905ee8526..89e18140f22ed 100644 --- a/superset-frontend/plugins/plugin-chart-table/src/DataTable/components/GlobalFilter.tsx +++ b/superset-frontend/plugins/plugin-chart-table/src/DataTable/components/GlobalFilter.tsx @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import React, { ComponentType, ChangeEventHandler } from 'react'; +import { memo, ComponentType, ChangeEventHandler } from 'react'; import { Row, FilterValue } from 'react-table'; import useAsyncState from '../utils/useAsyncState'; @@ -49,7 +49,7 @@ function DefaultSearchInput({ count, value, onChange }: SearchInputProps) { ); } -export default (React.memo as (fn: T) => T)(function GlobalFilter< +export default (memo as (fn: T) => T)(function GlobalFilter< D extends object, >({ preGlobalFilteredRows, diff --git a/superset-frontend/plugins/plugin-chart-table/src/DataTable/components/Pagination.tsx b/superset-frontend/plugins/plugin-chart-table/src/DataTable/components/Pagination.tsx index 8d7e81ac1fef6..482300fdd421b 100644 --- a/superset-frontend/plugins/plugin-chart-table/src/DataTable/components/Pagination.tsx +++ b/superset-frontend/plugins/plugin-chart-table/src/DataTable/components/Pagination.tsx @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import React, { CSSProperties, forwardRef } from 'react'; +import { CSSProperties, forwardRef, memo, Ref } from 'react'; export interface PaginationProps { pageCount: number; // number of pages @@ -71,7 +71,7 @@ export function generatePageItems( return items; } -export default React.memo( +export default memo( forwardRef(function Pagination( { style, @@ -80,7 +80,7 @@ export default React.memo( maxPageItemCount = 9, onPageChange, }: PaginationProps, - ref: React.Ref, + ref: Ref, ) { const pageItems = generatePageItems( pageCount, diff --git a/superset-frontend/plugins/plugin-chart-table/src/DataTable/components/SelectPageSize.tsx b/superset-frontend/plugins/plugin-chart-table/src/DataTable/components/SelectPageSize.tsx index 48d4b9a66874e..d97d6411b7897 100644 --- a/superset-frontend/plugins/plugin-chart-table/src/DataTable/components/SelectPageSize.tsx +++ b/superset-frontend/plugins/plugin-chart-table/src/DataTable/components/SelectPageSize.tsx @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import React from 'react'; +import { memo } from 'react'; import { t } from '@superset-ui/core'; import { formatSelectOptions } from '@superset-ui/chart-controls'; @@ -70,7 +70,7 @@ function getOptionValue(x: SizeOption) { return Array.isArray(x) ? x[0] : x; } -export default React.memo(function SelectPageSize({ +export default memo(function SelectPageSize({ total, options: sizeOptions, current: currentSize, diff --git a/superset-frontend/plugins/plugin-chart-table/src/DataTable/hooks/useSticky.tsx b/superset-frontend/plugins/plugin-chart-table/src/DataTable/hooks/useSticky.tsx index 1b533c25decce..4470ea19d726e 100644 --- a/superset-frontend/plugins/plugin-chart-table/src/DataTable/hooks/useSticky.tsx +++ b/superset-frontend/plugins/plugin-chart-table/src/DataTable/hooks/useSticky.tsx @@ -16,7 +16,9 @@ * specific language governing permissions and limitations * under the License. */ -import React, { +import { + Children, + cloneElement, useRef, useMemo, useLayoutEffect, @@ -130,7 +132,7 @@ function StickyWrap({ let tbody: Tbody | undefined; let tfoot: Tfoot | undefined; - React.Children.forEach(table.props.children, node => { + Children.forEach(table.props.children, node => { if (!node) { return; } @@ -148,7 +150,7 @@ function StickyWrap({ ); } const columnCount = useMemo(() => { - const headerRows = React.Children.toArray( + const headerRows = Children.toArray( thead?.props.children, ).pop() as TrWithTh; return headerRows.props.children.length; @@ -218,8 +220,8 @@ function StickyWrap({ let bodyTable: ReactElement | undefined; if (needSizer) { - const theadWithRef = React.cloneElement(thead, { ref: theadRef }); - const tfootWithRef = tfoot && React.cloneElement(tfoot, { ref: tfootRef }); + const theadWithRef = cloneElement(thead, { ref: theadRef }); + const tfootWithRef = tfoot && cloneElement(tfoot, { ref: tfootRef }); sizerTable = (
- {React.cloneElement( + {cloneElement( table, { role: 'presentation' }, theadWithRef, @@ -265,8 +267,8 @@ function StickyWrap({ }} role="presentation" > - {React.cloneElement( - React.cloneElement(table, { role: 'presentation' }), + {cloneElement( + cloneElement(table, { role: 'presentation' }), mergeStyleProp(table, fixedTableLayout), colgroup, thead, @@ -285,8 +287,8 @@ function StickyWrap({ }} role="presentation" > - {React.cloneElement( - React.cloneElement(table, { role: 'presentation' }), + {cloneElement( + cloneElement(table, { role: 'presentation' }), mergeStyleProp(table, fixedTableLayout), colgroup, tfoot, @@ -315,8 +317,8 @@ function StickyWrap({ onScroll={sticky.hasHorizontalScroll ? onScroll : undefined} role="presentation" > - {React.cloneElement( - React.cloneElement(table, { role: 'presentation' }), + {cloneElement( + cloneElement(table, { role: 'presentation' }), mergeStyleProp(table, fixedTableLayout), colgroup, tbody, diff --git a/superset-frontend/plugins/plugin-chart-table/src/DataTable/types/react-table.d.ts b/superset-frontend/plugins/plugin-chart-table/src/DataTable/types/react-table.d.ts index c1f49ea396f25..6c319f768453c 100644 --- a/superset-frontend/plugins/plugin-chart-table/src/DataTable/types/react-table.d.ts +++ b/superset-frontend/plugins/plugin-chart-table/src/DataTable/types/react-table.d.ts @@ -42,6 +42,7 @@ import { HeaderProps, TableFooterProps, } from 'react-table'; +import { DragEvent } from 'react'; import { UseStickyState, @@ -81,14 +82,14 @@ declare module 'react-table' { // Typing from @types/react-table is incomplete interface TableSortByToggleProps { - style?: React.CSSProperties; + style?: CSSProperties; title?: string; - onClick?: React.MouseEventHandler; + onClick?: MouseEventHandler; } interface TableRearrangeColumnsProps { - onDragStart: (e: React.DragEvent) => void; - onDrop: (e: React.DragEvent) => void; + onDragStart: (e: DragEvent) => void; + onDrop: (e: DragEvent) => void; } export interface ColumnInterface diff --git a/superset-frontend/plugins/plugin-chart-table/src/TableChart.tsx b/superset-frontend/plugins/plugin-chart-table/src/TableChart.tsx index 0f1be177a41ca..0e4c4ddb00fda 100644 --- a/superset-frontend/plugins/plugin-chart-table/src/TableChart.tsx +++ b/superset-frontend/plugins/plugin-chart-table/src/TableChart.tsx @@ -16,14 +16,16 @@ * specific language governing permissions and limitations * under the License. */ -import React, { +import { CSSProperties, useCallback, useLayoutEffect, useMemo, useState, MouseEvent, + KeyboardEvent as ReactKeyboardEvent, } from 'react'; + import { ColumnInstance, ColumnWithLooseAccessor, @@ -604,7 +606,7 @@ export default function TableChart( ...sharedStyle, ...style, }} - onKeyDown={(e: React.KeyboardEvent) => { + onKeyDown={(e: ReactKeyboardEvent) => { // programatically sort column on keypress if (Object.values(ACTION_KEYS).includes(e.key)) { col.toggleSortBy(); diff --git a/superset-frontend/plugins/plugin-chart-table/src/controlPanel.tsx b/superset-frontend/plugins/plugin-chart-table/src/controlPanel.tsx index 6cce125f36405..41ca0a58a1293 100644 --- a/superset-frontend/plugins/plugin-chart-table/src/controlPanel.tsx +++ b/superset-frontend/plugins/plugin-chart-table/src/controlPanel.tsx @@ -17,7 +17,6 @@ * specific language governing permissions and limitations * under the License. */ -import React from 'react'; import { ChartDataResponseResult, ensureIsArray, diff --git a/superset-frontend/plugins/plugin-chart-table/test/TableChart.test.tsx b/superset-frontend/plugins/plugin-chart-table/test/TableChart.test.tsx index 52cfab166215f..978616a0a1b98 100644 --- a/superset-frontend/plugins/plugin-chart-table/test/TableChart.test.tsx +++ b/superset-frontend/plugins/plugin-chart-table/test/TableChart.test.tsx @@ -16,7 +16,6 @@ * specific language governing permissions and limitations * under the License. */ -import React from 'react'; import { CommonWrapper } from 'enzyme'; import { render, screen } from '@testing-library/react'; import '@testing-library/jest-dom'; diff --git a/superset-frontend/plugins/plugin-chart-table/test/enzyme.tsx b/superset-frontend/plugins/plugin-chart-table/test/enzyme.tsx index afd95b5b6ebab..303fbcc03a56e 100644 --- a/superset-frontend/plugins/plugin-chart-table/test/enzyme.tsx +++ b/superset-frontend/plugins/plugin-chart-table/test/enzyme.tsx @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import React, { ReactElement } from 'react'; +import { ReactElement } from 'react'; import { shallow as enzymeShallow, mount as enzymeMount } from 'enzyme'; import { EmotionCacheProvider, diff --git a/superset-frontend/plugins/plugin-chart-word-cloud/src/chart/WordCloud.tsx b/superset-frontend/plugins/plugin-chart-word-cloud/src/chart/WordCloud.tsx index e05559b84baa3..fa2300128352e 100644 --- a/superset-frontend/plugins/plugin-chart-word-cloud/src/chart/WordCloud.tsx +++ b/superset-frontend/plugins/plugin-chart-word-cloud/src/chart/WordCloud.tsx @@ -17,7 +17,7 @@ * under the License. */ -import React from 'react'; +import { PureComponent } from 'react'; import cloudLayout, { Word } from 'd3-cloud'; import { PlainObject, @@ -88,10 +88,7 @@ const MAX_SCALE_FACTOR = 3; // Needed to avoid clutter when shrinking a chart with many records. const TOP_RESULTS_PERCENTAGE = 0.1; -class WordCloud extends React.PureComponent< - FullWordCloudProps, - WordCloudState -> { +class WordCloud extends PureComponent { static defaultProps = defaultProps; // Cannot name it isMounted because of conflict diff --git a/superset-frontend/spec/__mocks__/svgrMock.tsx b/superset-frontend/spec/__mocks__/svgrMock.tsx index b057bc67b3466..4f1178bee8d91 100644 --- a/superset-frontend/spec/__mocks__/svgrMock.tsx +++ b/superset-frontend/spec/__mocks__/svgrMock.tsx @@ -17,7 +17,7 @@ * under the License. */ -import React, { SVGProps, forwardRef } from 'react'; +import { SVGProps, forwardRef } from 'react'; const SvgrMock = forwardRef>( (props, ref) => , diff --git a/superset-frontend/spec/helpers/ProviderWrapper.tsx b/superset-frontend/spec/helpers/ProviderWrapper.tsx index f505a81141561..144d75401a30a 100644 --- a/superset-frontend/spec/helpers/ProviderWrapper.tsx +++ b/superset-frontend/spec/helpers/ProviderWrapper.tsx @@ -17,7 +17,6 @@ * under the License. */ -import React from 'react'; import { ThemeProvider } from '@superset-ui/core'; import { BrowserRouter as Router, Route } from 'react-router-dom'; import { QueryParamProvider } from 'use-query-params'; diff --git a/superset-frontend/spec/helpers/setup.ts b/superset-frontend/spec/helpers/setup.ts index 281ab4ae4bb1c..a73d8d6ccbad1 100644 --- a/superset-frontend/spec/helpers/setup.ts +++ b/superset-frontend/spec/helpers/setup.ts @@ -18,6 +18,8 @@ */ import 'jest-enzyme'; import './shim'; +// eslint-disable-next-line no-restricted-syntax -- whole React import is required for mocking React module in tests. +import React from 'react'; import { configure as configureTestingLibrary } from '@testing-library/react'; import { matchers } from '@emotion/jest'; @@ -27,3 +29,6 @@ configureTestingLibrary({ document.body.innerHTML = '
'; expect.extend(matchers); + +// Allow JSX tests to have React import readily available +global.React = React; diff --git a/superset-frontend/spec/helpers/shim.tsx b/superset-frontend/spec/helpers/shim.tsx index 8270c56317184..40b3478875fda 100644 --- a/superset-frontend/spec/helpers/shim.tsx +++ b/superset-frontend/spec/helpers/shim.tsx @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import React from 'react'; +import { AriaAttributes } from 'react'; import 'core-js/stable'; import 'regenerator-runtime/runtime'; import 'abortcontroller-polyfill/dist/abortcontroller-polyfill-only'; @@ -101,7 +101,7 @@ jest.mock('src/components/Icons/Icon', () => ({ }: { fileName: string; role: string; - 'aria-label': React.AriaAttributes['aria-label']; + 'aria-label': AriaAttributes['aria-label']; }) => ( ({ ...rest }: { role: string; - 'aria-label': React.AriaAttributes['aria-label']; + 'aria-label': AriaAttributes['aria-label']; }) => , })); diff --git a/superset-frontend/spec/helpers/testing-library.tsx b/superset-frontend/spec/helpers/testing-library.tsx index 9a8649a8623f4..61ccc7fb0d765 100644 --- a/superset-frontend/spec/helpers/testing-library.tsx +++ b/superset-frontend/spec/helpers/testing-library.tsx @@ -17,7 +17,7 @@ * under the License. */ import '@testing-library/jest-dom/extend-expect'; -import React, { ReactNode, ReactElement } from 'react'; +import { ReactNode, ReactElement } from 'react'; import { render, RenderOptions } from '@testing-library/react'; import { ThemeProvider, supersetTheme } from '@superset-ui/core'; import { BrowserRouter } from 'react-router-dom'; diff --git a/superset-frontend/src/GlobalStyles.tsx b/superset-frontend/src/GlobalStyles.tsx index eceefaff62f2a..bd882e39732b1 100644 --- a/superset-frontend/src/GlobalStyles.tsx +++ b/superset-frontend/src/GlobalStyles.tsx @@ -16,7 +16,6 @@ * specific language governing permissions and limitations * under the License. */ -import React from 'react'; import { css } from '@superset-ui/core'; import { Global } from '@emotion/react'; import { mix } from 'polished'; diff --git a/superset-frontend/src/SqlLab/SqlLabGlobalStyles.tsx b/superset-frontend/src/SqlLab/SqlLabGlobalStyles.tsx index f1398e3be9ac4..ef9fb8be62b97 100644 --- a/superset-frontend/src/SqlLab/SqlLabGlobalStyles.tsx +++ b/superset-frontend/src/SqlLab/SqlLabGlobalStyles.tsx @@ -17,7 +17,6 @@ * under the License. */ -import React from 'react'; import { Global } from '@emotion/react'; import { css } from '@superset-ui/core'; diff --git a/superset-frontend/src/SqlLab/components/AceEditorWrapper/AceEditorWrapper.test.tsx b/superset-frontend/src/SqlLab/components/AceEditorWrapper/AceEditorWrapper.test.tsx index 72daff7602b24..ea3c21640a877 100644 --- a/superset-frontend/src/SqlLab/components/AceEditorWrapper/AceEditorWrapper.test.tsx +++ b/superset-frontend/src/SqlLab/components/AceEditorWrapper/AceEditorWrapper.test.tsx @@ -16,7 +16,6 @@ * specific language governing permissions and limitations * under the License. */ -import React from 'react'; import configureStore from 'redux-mock-store'; import thunk from 'redux-thunk'; import { render, waitFor } from 'spec/helpers/testing-library'; diff --git a/superset-frontend/src/SqlLab/components/AceEditorWrapper/index.tsx b/superset-frontend/src/SqlLab/components/AceEditorWrapper/index.tsx index 219a1f9bbaad2..80ccc6ed1c07f 100644 --- a/superset-frontend/src/SqlLab/components/AceEditorWrapper/index.tsx +++ b/superset-frontend/src/SqlLab/components/AceEditorWrapper/index.tsx @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import React, { useState, useEffect, useRef } from 'react'; +import { useState, useEffect, useRef } from 'react'; import type { IAceEditor } from 'react-ace/lib/types'; import { useDispatch } from 'react-redux'; import { css, styled, usePrevious, useTheme } from '@superset-ui/core'; diff --git a/superset-frontend/src/SqlLab/components/App/App.test.tsx b/superset-frontend/src/SqlLab/components/App/App.test.tsx index 027347daacad3..eab125ba24c50 100644 --- a/superset-frontend/src/SqlLab/components/App/App.test.tsx +++ b/superset-frontend/src/SqlLab/components/App/App.test.tsx @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import React from 'react'; +import { isValidElement } from 'react'; import { AnyAction, combineReducers } from 'redux'; import Mousetrap from 'mousetrap'; import configureStore from 'redux-mock-store'; @@ -61,7 +61,7 @@ describe('SqlLab App', () => { }); it('is valid', () => { - expect(React.isValidElement()).toBe(true); + expect(isValidElement()).toBe(true); }); it('should render', () => { diff --git a/superset-frontend/src/SqlLab/components/App/index.tsx b/superset-frontend/src/SqlLab/components/App/index.tsx index 973fc79dcb101..5bb617223afb9 100644 --- a/superset-frontend/src/SqlLab/components/App/index.tsx +++ b/superset-frontend/src/SqlLab/components/App/index.tsx @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import React from 'react'; +import { PureComponent } from 'react'; import { connect } from 'react-redux'; import { Redirect } from 'react-router-dom'; import Mousetrap from 'mousetrap'; @@ -111,7 +111,7 @@ interface AppState { hash: string; } -class App extends React.PureComponent { +class App extends PureComponent { hasLoggedLocalStorageUsage: boolean; constructor(props: AppProps) { diff --git a/superset-frontend/src/SqlLab/components/ColumnElement/ColumnElement.test.tsx b/superset-frontend/src/SqlLab/components/ColumnElement/ColumnElement.test.tsx index f97b0cc287957..20abcc896dfc7 100644 --- a/superset-frontend/src/SqlLab/components/ColumnElement/ColumnElement.test.tsx +++ b/superset-frontend/src/SqlLab/components/ColumnElement/ColumnElement.test.tsx @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import React from 'react'; +import { isValidElement } from 'react'; import { styledMount as mount } from 'spec/helpers/theming'; import ColumnElement from 'src/SqlLab/components/ColumnElement'; import { mockedActions, table } from 'src/SqlLab/fixtures'; @@ -27,7 +27,7 @@ describe('ColumnElement', () => { column: table.columns[0], }; it('is valid with props', () => { - expect(React.isValidElement()).toBe(true); + expect(isValidElement()).toBe(true); }); it('renders a proper primary key', () => { const wrapper = mount(); diff --git a/superset-frontend/src/SqlLab/components/ColumnElement/index.tsx b/superset-frontend/src/SqlLab/components/ColumnElement/index.tsx index 2b341b0bd17eb..e5f307753b61d 100644 --- a/superset-frontend/src/SqlLab/components/ColumnElement/index.tsx +++ b/superset-frontend/src/SqlLab/components/ColumnElement/index.tsx @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import React from 'react'; +import { ReactNode } from 'react'; import { ClassNames } from '@emotion/react'; import { styled, useTheme, t } from '@superset-ui/core'; import { Tooltip } from 'src/components/Tooltip'; @@ -80,7 +80,7 @@ const NowrapDiv = styled.div` `; const ColumnElement = ({ column }: ColumnElementProps) => { - let columnName: React.ReactNode = column.name; + let columnName: ReactNode = column.name; let icons; if (column.keys && column.keys.length > 0) { columnName = {column.name}; diff --git a/superset-frontend/src/SqlLab/components/EditorAutoSync/EditorAutoSync.test.tsx b/superset-frontend/src/SqlLab/components/EditorAutoSync/EditorAutoSync.test.tsx index 52e1d44b247f8..b81a703c56c21 100644 --- a/superset-frontend/src/SqlLab/components/EditorAutoSync/EditorAutoSync.test.tsx +++ b/superset-frontend/src/SqlLab/components/EditorAutoSync/EditorAutoSync.test.tsx @@ -34,7 +34,6 @@ * specific language governing permissions and limitations * under the License. */ -import React from 'react'; import fetchMock from 'fetch-mock'; import { render, waitFor } from 'spec/helpers/testing-library'; import ToastContainer from 'src/components/MessageToasts/ToastContainer'; diff --git a/superset-frontend/src/SqlLab/components/EditorAutoSync/index.tsx b/superset-frontend/src/SqlLab/components/EditorAutoSync/index.tsx index 51399753e95b7..0e563f0f6af9f 100644 --- a/superset-frontend/src/SqlLab/components/EditorAutoSync/index.tsx +++ b/superset-frontend/src/SqlLab/components/EditorAutoSync/index.tsx @@ -17,7 +17,8 @@ * under the License. */ -import React, { useRef, useEffect } from 'react'; +import { useRef, useEffect, FC } from 'react'; + import { useDispatch, useSelector } from 'react-redux'; import { logging } from '@superset-ui/core'; import { @@ -54,7 +55,7 @@ export function filterUnsavedQueryEditorList( .filter(queryEditor => hasUnsavedChanges(queryEditor, lastSavedTimestamp)); } -const EditorAutoSync: React.FC = () => { +const EditorAutoSync: FC = () => { const queryEditors = useSelector( state => state.sqlLab.queryEditors, ); diff --git a/superset-frontend/src/SqlLab/components/EstimateQueryCostButton/EstimateQueryCostButton.test.tsx b/superset-frontend/src/SqlLab/components/EstimateQueryCostButton/EstimateQueryCostButton.test.tsx index 7fe7680f17f26..9a4dd6e04f9da 100644 --- a/superset-frontend/src/SqlLab/components/EstimateQueryCostButton/EstimateQueryCostButton.test.tsx +++ b/superset-frontend/src/SqlLab/components/EstimateQueryCostButton/EstimateQueryCostButton.test.tsx @@ -16,7 +16,6 @@ * specific language governing permissions and limitations * under the License. */ -import React from 'react'; import configureStore from 'redux-mock-store'; import thunk from 'redux-thunk'; import { fireEvent, render } from 'spec/helpers/testing-library'; diff --git a/superset-frontend/src/SqlLab/components/EstimateQueryCostButton/index.tsx b/superset-frontend/src/SqlLab/components/EstimateQueryCostButton/index.tsx index 4dd5c489582a6..4c50541afd5b8 100644 --- a/superset-frontend/src/SqlLab/components/EstimateQueryCostButton/index.tsx +++ b/superset-frontend/src/SqlLab/components/EstimateQueryCostButton/index.tsx @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import React, { useMemo } from 'react'; +import { useMemo } from 'react'; import { useSelector } from 'react-redux'; import { css, styled, t } from '@superset-ui/core'; diff --git a/superset-frontend/src/SqlLab/components/ExploreCtasResultsButton/ExploreCtasResultsButton.test.tsx b/superset-frontend/src/SqlLab/components/ExploreCtasResultsButton/ExploreCtasResultsButton.test.tsx index e107c5109d492..eddd1acb90e04 100644 --- a/superset-frontend/src/SqlLab/components/ExploreCtasResultsButton/ExploreCtasResultsButton.test.tsx +++ b/superset-frontend/src/SqlLab/components/ExploreCtasResultsButton/ExploreCtasResultsButton.test.tsx @@ -16,7 +16,6 @@ * specific language governing permissions and limitations * under the License. */ -import React from 'react'; import configureStore from 'redux-mock-store'; import fetchMock from 'fetch-mock'; import thunk from 'redux-thunk'; diff --git a/superset-frontend/src/SqlLab/components/ExploreCtasResultsButton/index.tsx b/superset-frontend/src/SqlLab/components/ExploreCtasResultsButton/index.tsx index ef3f8462ee545..d7b73a7a4b989 100644 --- a/superset-frontend/src/SqlLab/components/ExploreCtasResultsButton/index.tsx +++ b/superset-frontend/src/SqlLab/components/ExploreCtasResultsButton/index.tsx @@ -16,7 +16,6 @@ * specific language governing permissions and limitations * under the License. */ -import React from 'react'; import { useSelector, useDispatch } from 'react-redux'; import { t, JsonObject } from '@superset-ui/core'; import { diff --git a/superset-frontend/src/SqlLab/components/ExploreResultsButton/ExploreResultsButton.test.tsx b/superset-frontend/src/SqlLab/components/ExploreResultsButton/ExploreResultsButton.test.tsx index 5126299feabd3..7ab859512a346 100644 --- a/superset-frontend/src/SqlLab/components/ExploreResultsButton/ExploreResultsButton.test.tsx +++ b/superset-frontend/src/SqlLab/components/ExploreResultsButton/ExploreResultsButton.test.tsx @@ -16,7 +16,6 @@ * specific language governing permissions and limitations * under the License. */ -import React from 'react'; import { render, screen } from 'spec/helpers/testing-library'; import ExploreResultsButton, { diff --git a/superset-frontend/src/SqlLab/components/ExploreResultsButton/index.tsx b/superset-frontend/src/SqlLab/components/ExploreResultsButton/index.tsx index 454f3a26b0f41..5594479f5bd3a 100644 --- a/superset-frontend/src/SqlLab/components/ExploreResultsButton/index.tsx +++ b/superset-frontend/src/SqlLab/components/ExploreResultsButton/index.tsx @@ -16,7 +16,6 @@ * specific language governing permissions and limitations * under the License. */ -import React from 'react'; import { t } from '@superset-ui/core'; import { InfoTooltipWithTrigger } from '@superset-ui/chart-controls'; import Button, { OnClickHandler } from 'src/components/Button'; diff --git a/superset-frontend/src/SqlLab/components/HighlightedSql/HighlightedSql.test.tsx b/superset-frontend/src/SqlLab/components/HighlightedSql/HighlightedSql.test.tsx index e932c35e085ab..70f63a2d0ffe4 100644 --- a/superset-frontend/src/SqlLab/components/HighlightedSql/HighlightedSql.test.tsx +++ b/superset-frontend/src/SqlLab/components/HighlightedSql/HighlightedSql.test.tsx @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import React from 'react'; +import { isValidElement } from 'react'; import HighlightedSql from 'src/SqlLab/components/HighlightedSql'; import { fireEvent, render } from 'spec/helpers/testing-library'; @@ -24,7 +24,7 @@ import { fireEvent, render } from 'spec/helpers/testing-library'; const sql = "SELECT * FROM test WHERE something='fkldasjfklajdslfkjadlskfjkldasjfkladsjfkdjsa'"; test('renders HighlightedSql component with sql prop', () => { - expect(React.isValidElement()).toBe(true); + expect(isValidElement()).toBe(true); }); test('renders a ModalTrigger component', () => { const { getByTestId } = render(); diff --git a/superset-frontend/src/SqlLab/components/HighlightedSql/index.tsx b/superset-frontend/src/SqlLab/components/HighlightedSql/index.tsx index 67b4df665db2a..ff0b472a218d2 100644 --- a/superset-frontend/src/SqlLab/components/HighlightedSql/index.tsx +++ b/superset-frontend/src/SqlLab/components/HighlightedSql/index.tsx @@ -16,7 +16,6 @@ * specific language governing permissions and limitations * under the License. */ -import React from 'react'; import SyntaxHighlighter from 'react-syntax-highlighter/dist/cjs/light'; import sql from 'react-syntax-highlighter/dist/cjs/languages/hljs/sql'; import github from 'react-syntax-highlighter/dist/cjs/styles/hljs/github'; diff --git a/superset-frontend/src/SqlLab/components/KeyboardShortcutButton/KeyboardShortcutButton.test.tsx b/superset-frontend/src/SqlLab/components/KeyboardShortcutButton/KeyboardShortcutButton.test.tsx index 9582b9cab3b0a..b3c16de1075cf 100644 --- a/superset-frontend/src/SqlLab/components/KeyboardShortcutButton/KeyboardShortcutButton.test.tsx +++ b/superset-frontend/src/SqlLab/components/KeyboardShortcutButton/KeyboardShortcutButton.test.tsx @@ -16,7 +16,6 @@ * specific language governing permissions and limitations * under the License. */ -import React from 'react'; import { fireEvent, render } from 'spec/helpers/testing-library'; import KeyboardShortcutButton, { KEY_MAP } from '.'; diff --git a/superset-frontend/src/SqlLab/components/KeyboardShortcutButton/index.tsx b/superset-frontend/src/SqlLab/components/KeyboardShortcutButton/index.tsx index 764884614c5d8..d3c54933126d4 100644 --- a/superset-frontend/src/SqlLab/components/KeyboardShortcutButton/index.tsx +++ b/superset-frontend/src/SqlLab/components/KeyboardShortcutButton/index.tsx @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import React from 'react'; +import { FC } from 'react'; import { styled, t, css } from '@superset-ui/core'; import ModalTrigger from 'src/components/ModalTrigger'; import { detectOS } from 'src/utils/common'; @@ -88,7 +88,7 @@ const ShortcutCode = styled.code` padding: ${({ theme }) => `${theme.gridUnit}px ${theme.gridUnit * 2}px`}; `; -const KeyboardShortcutButton: React.FC<{}> = ({ children }) => ( +const KeyboardShortcutButton: FC<{}> = ({ children }) => ( { - expect(React.isValidElement()).toBe(true); + expect(isValidElement()).toBe(true); }); test('has an Overlay and a Popover', () => { const { getByTestId } = render(); diff --git a/superset-frontend/src/SqlLab/components/QueryStateLabel/index.tsx b/superset-frontend/src/SqlLab/components/QueryStateLabel/index.tsx index f450ecdde5177..b11efecdd2706 100644 --- a/superset-frontend/src/SqlLab/components/QueryStateLabel/index.tsx +++ b/superset-frontend/src/SqlLab/components/QueryStateLabel/index.tsx @@ -16,7 +16,6 @@ * specific language governing permissions and limitations * under the License. */ -import React from 'react'; import Label from 'src/components/Label'; import { STATE_TYPE_MAP, STATE_TYPE_MAP_LOCALIZED } from 'src/SqlLab/constants'; import { styled, Query } from '@superset-ui/core'; diff --git a/superset-frontend/src/SqlLab/components/QueryTable/QueryTable.test.tsx b/superset-frontend/src/SqlLab/components/QueryTable/QueryTable.test.tsx index 9b72e692dc936..4be4c995452c5 100644 --- a/superset-frontend/src/SqlLab/components/QueryTable/QueryTable.test.tsx +++ b/superset-frontend/src/SqlLab/components/QueryTable/QueryTable.test.tsx @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import React from 'react'; +import { isValidElement } from 'react'; import thunk from 'redux-thunk'; import configureStore from 'redux-mock-store'; import { styledMount as mount } from 'spec/helpers/theming'; @@ -32,10 +32,10 @@ const mockedProps = { latestQueryId: 'ryhMUZCGb', }; test('is valid', () => { - expect(React.isValidElement()).toBe(true); + expect(isValidElement()).toBe(true); }); test('is valid with props', () => { - expect(React.isValidElement()).toBe(true); + expect(isValidElement()).toBe(true); }); test('renders a proper table', () => { const mockStore = configureStore([thunk]); diff --git a/superset-frontend/src/SqlLab/components/QueryTable/index.tsx b/superset-frontend/src/SqlLab/components/QueryTable/index.tsx index 3282a939ef768..916c04aece109 100644 --- a/superset-frontend/src/SqlLab/components/QueryTable/index.tsx +++ b/superset-frontend/src/SqlLab/components/QueryTable/index.tsx @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import React, { useMemo } from 'react'; +import { useMemo } from 'react'; import moment from 'moment'; import Card from 'src/components/Card'; import ProgressBar from 'src/components/ProgressBar'; diff --git a/superset-frontend/src/SqlLab/components/ResultSet/ResultSet.test.tsx b/superset-frontend/src/SqlLab/components/ResultSet/ResultSet.test.tsx index e5844fed5cfc9..d5f30a575a74d 100644 --- a/superset-frontend/src/SqlLab/components/ResultSet/ResultSet.test.tsx +++ b/superset-frontend/src/SqlLab/components/ResultSet/ResultSet.test.tsx @@ -16,7 +16,6 @@ * specific language governing permissions and limitations * under the License. */ -import React from 'react'; import { render, screen, waitFor } from 'spec/helpers/testing-library'; import configureStore from 'redux-mock-store'; import { Store } from 'redux'; diff --git a/superset-frontend/src/SqlLab/components/ResultSet/index.tsx b/superset-frontend/src/SqlLab/components/ResultSet/index.tsx index a6bbb84bac942..3496624aa64cf 100644 --- a/superset-frontend/src/SqlLab/components/ResultSet/index.tsx +++ b/superset-frontend/src/SqlLab/components/ResultSet/index.tsx @@ -16,7 +16,15 @@ * specific language governing permissions and limitations * under the License. */ -import React, { useCallback, useEffect, useState } from 'react'; +import { + useCallback, + useEffect, + useState, + memo, + ChangeEvent, + MouseEvent, +} from 'react'; + import { shallowEqual, useDispatch, useSelector } from 'react-redux'; import { useHistory } from 'react-router-dom'; import { pick } from 'lodash'; @@ -242,11 +250,11 @@ const ResultSet = ({ dispatch(addQueryEditor(qe)); }; - const changeSearch = (event: React.ChangeEvent) => { + const changeSearch = (event: ChangeEvent) => { setSearchText(event.target.value); }; - const createExploreResultsOnClick = async (clickEvent: React.MouseEvent) => { + const createExploreResultsOnClick = async (clickEvent: MouseEvent) => { const { results } = query; const openInNewWindow = clickEvent.metaKey; @@ -695,4 +703,4 @@ const ResultSet = ({ ); }; -export default React.memo(ResultSet); +export default memo(ResultSet); diff --git a/superset-frontend/src/SqlLab/components/RunQueryActionButton/RunQueryActionButton.test.tsx b/superset-frontend/src/SqlLab/components/RunQueryActionButton/RunQueryActionButton.test.tsx index 3549439088233..40df87b68e454 100644 --- a/superset-frontend/src/SqlLab/components/RunQueryActionButton/RunQueryActionButton.test.tsx +++ b/superset-frontend/src/SqlLab/components/RunQueryActionButton/RunQueryActionButton.test.tsx @@ -16,7 +16,6 @@ * specific language governing permissions and limitations * under the License. */ -import React from 'react'; import configureStore from 'redux-mock-store'; import thunk from 'redux-thunk'; import { Store } from 'redux'; diff --git a/superset-frontend/src/SqlLab/components/RunQueryActionButton/index.tsx b/superset-frontend/src/SqlLab/components/RunQueryActionButton/index.tsx index 30f8121132162..40769c110c4f2 100644 --- a/superset-frontend/src/SqlLab/components/RunQueryActionButton/index.tsx +++ b/superset-frontend/src/SqlLab/components/RunQueryActionButton/index.tsx @@ -16,7 +16,8 @@ * specific language governing permissions and limitations * under the License. */ -import React, { useMemo } from 'react'; +import { useMemo, FC, ReactElement } from 'react'; + import { t, styled, useTheme } from '@superset-ui/core'; import Button from 'src/components/Button'; @@ -32,7 +33,7 @@ export interface RunQueryActionButtonProps { queryState?: string; runQuery: (c?: boolean) => void; stopQuery: () => void; - overlayCreateAsMenu: React.ReactElement | null; + overlayCreateAsMenu: ReactElement | null; } const buildText = ( @@ -99,8 +100,8 @@ const RunQueryActionButton = ({ const shouldShowStopBtn = !!queryState && ['running', 'pending'].indexOf(queryState) > -1; - const ButtonComponent: React.FC = overlayCreateAsMenu - ? (DropdownButton as React.FC) + const ButtonComponent: FC = overlayCreateAsMenu + ? (DropdownButton as FC) : Button; const sqlContent = selectedText || sql || ''; diff --git a/superset-frontend/src/SqlLab/components/SaveDatasetActionButton/SaveDatasetActionButton.test.tsx b/superset-frontend/src/SqlLab/components/SaveDatasetActionButton/SaveDatasetActionButton.test.tsx index 316404e3e4f3a..27b49f27209f7 100644 --- a/superset-frontend/src/SqlLab/components/SaveDatasetActionButton/SaveDatasetActionButton.test.tsx +++ b/superset-frontend/src/SqlLab/components/SaveDatasetActionButton/SaveDatasetActionButton.test.tsx @@ -16,7 +16,6 @@ * specific language governing permissions and limitations * under the License. */ -import React from 'react'; import { render, screen } from 'spec/helpers/testing-library'; import userEvent from '@testing-library/user-event'; import { Menu } from 'src/components/Menu'; diff --git a/superset-frontend/src/SqlLab/components/SaveDatasetActionButton/index.tsx b/superset-frontend/src/SqlLab/components/SaveDatasetActionButton/index.tsx index 79a3bf0b8ee9c..57d721503d127 100644 --- a/superset-frontend/src/SqlLab/components/SaveDatasetActionButton/index.tsx +++ b/superset-frontend/src/SqlLab/components/SaveDatasetActionButton/index.tsx @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import React from 'react'; +import { FC } from 'react'; import { t, useTheme, styled } from '@superset-ui/core'; import Icons from 'src/components/Icons'; import { DropdownButton } from 'src/components/DropdownButton'; @@ -35,7 +35,7 @@ const SaveDatasetActionButton = ({ const theme = useTheme(); const StyledDropdownButton = styled( - DropdownButton as React.FC, + DropdownButton as FC, )` &.ant-dropdown-button button.ant-btn.ant-btn-default { &:first-of-type { diff --git a/superset-frontend/src/SqlLab/components/SaveDatasetModal/SaveDatasetModal.test.tsx b/superset-frontend/src/SqlLab/components/SaveDatasetModal/SaveDatasetModal.test.tsx index c3d1658f3a4ef..de22d0db408cc 100644 --- a/superset-frontend/src/SqlLab/components/SaveDatasetModal/SaveDatasetModal.test.tsx +++ b/superset-frontend/src/SqlLab/components/SaveDatasetModal/SaveDatasetModal.test.tsx @@ -16,7 +16,6 @@ * specific language governing permissions and limitations * under the License. */ -import React from 'react'; import * as reactRedux from 'react-redux'; import { fireEvent, diff --git a/superset-frontend/src/SqlLab/components/SaveDatasetModal/index.tsx b/superset-frontend/src/SqlLab/components/SaveDatasetModal/index.tsx index 011d4a7d21189..e2277408f3c39 100644 --- a/superset-frontend/src/SqlLab/components/SaveDatasetModal/index.tsx +++ b/superset-frontend/src/SqlLab/components/SaveDatasetModal/index.tsx @@ -17,7 +17,8 @@ * under the License. */ -import React, { useCallback, useState } from 'react'; +import { useCallback, useState, FormEvent } from 'react'; + import { Radio } from 'src/components/Radio'; import { RadioChangeEvent, AsyncSelect } from 'src/components'; import { Input } from 'src/components/Input'; @@ -328,7 +329,7 @@ export const SaveDatasetModal = ({ setSelectedDatasetToOverwrite(value); }; - const handleDatasetNameChange = (e: React.FormEvent) => { + const handleDatasetNameChange = (e: FormEvent) => { // @ts-expect-error setDatasetName(e.target.value); }; diff --git a/superset-frontend/src/SqlLab/components/SaveQuery/SaveQuery.test.tsx b/superset-frontend/src/SqlLab/components/SaveQuery/SaveQuery.test.tsx index 3d0413f62c72d..8b5dbb833617b 100644 --- a/superset-frontend/src/SqlLab/components/SaveQuery/SaveQuery.test.tsx +++ b/superset-frontend/src/SqlLab/components/SaveQuery/SaveQuery.test.tsx @@ -16,7 +16,6 @@ * specific language governing permissions and limitations * under the License. */ -import React from 'react'; import configureStore from 'redux-mock-store'; import thunk from 'redux-thunk'; import { render, screen, waitFor } from 'spec/helpers/testing-library'; diff --git a/superset-frontend/src/SqlLab/components/SaveQuery/index.tsx b/superset-frontend/src/SqlLab/components/SaveQuery/index.tsx index 2cb50b0c066cb..11b3d4233b437 100644 --- a/superset-frontend/src/SqlLab/components/SaveQuery/index.tsx +++ b/superset-frontend/src/SqlLab/components/SaveQuery/index.tsx @@ -16,7 +16,8 @@ * specific language governing permissions and limitations * under the License. */ -import React, { useState, useEffect, useMemo } from 'react'; +import { useState, useEffect, useMemo, ChangeEvent } from 'react'; + import type { DatabaseObject } from 'src/features/databases/types'; import { Row, Col } from 'src/components'; import { Input, TextArea } from 'src/components/Input'; @@ -138,11 +139,11 @@ const SaveQuery = ({ close(); }; - const onLabelChange = (e: React.ChangeEvent) => { + const onLabelChange = (e: ChangeEvent) => { setLabel(e.target.value); }; - const onDescriptionChange = (e: React.ChangeEvent) => { + const onDescriptionChange = (e: ChangeEvent) => { setDescription(e.target.value); }; diff --git a/superset-frontend/src/SqlLab/components/ScheduleQueryButton/index.tsx b/superset-frontend/src/SqlLab/components/ScheduleQueryButton/index.tsx index 9258b33f53c14..f08ac4b648f4f 100644 --- a/superset-frontend/src/SqlLab/components/ScheduleQueryButton/index.tsx +++ b/superset-frontend/src/SqlLab/components/ScheduleQueryButton/index.tsx @@ -16,7 +16,8 @@ * specific language governing permissions and limitations * under the License. */ -import React, { FunctionComponent, useState, useRef } from 'react'; +import { FunctionComponent, useState, useRef, ChangeEvent } from 'react'; + import SchemaForm, { FormProps, FormValidation } from 'react-jsonschema-form'; import { Row, Col } from 'src/components'; import { Input, TextArea } from 'src/components/Input'; @@ -173,7 +174,7 @@ const ScheduleQueryButton: FunctionComponent = ({ type="text" placeholder={t('Label for your query')} value={label} - onChange={(event: React.ChangeEvent) => + onChange={(event: ChangeEvent) => setLabel(event.target.value) } /> @@ -187,7 +188,7 @@ const ScheduleQueryButton: FunctionComponent = ({ rows={4} placeholder={t('Write a description for your query')} value={description} - onChange={(event: React.ChangeEvent) => + onChange={(event: ChangeEvent) => setDescription(event.target.value) } /> diff --git a/superset-frontend/src/SqlLab/components/ShareSqlLabQuery/ShareSqlLabQuery.test.tsx b/superset-frontend/src/SqlLab/components/ShareSqlLabQuery/ShareSqlLabQuery.test.tsx index 877edb76c89fd..a1251e8bcfa4e 100644 --- a/superset-frontend/src/SqlLab/components/ShareSqlLabQuery/ShareSqlLabQuery.test.tsx +++ b/superset-frontend/src/SqlLab/components/ShareSqlLabQuery/ShareSqlLabQuery.test.tsx @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import React from 'react'; +import { FC } from 'react'; import configureStore from 'redux-mock-store'; import thunk from 'redux-thunk'; import fetchMock from 'fetch-mock'; @@ -59,7 +59,7 @@ const mockState = { const store = mockStore(mockState); let isFeatureEnabledMock: jest.SpyInstance; -const standardProvider: React.FC = ({ children }) => ( +const standardProvider: FC = ({ children }) => ( {children} @@ -75,7 +75,7 @@ const unsavedQueryEditor = { templateParams: '{ "my_value": "foo" }', }; -const standardProviderWithUnsaved: React.FC = ({ children }) => ( +const standardProviderWithUnsaved: FC = ({ children }) => ( = ({ +const Results: FC = ({ latestQueryId, height, displayLimit, diff --git a/superset-frontend/src/SqlLab/components/SouthPane/SouthPane.test.tsx b/superset-frontend/src/SqlLab/components/SouthPane/SouthPane.test.tsx index 2e66c2f33c3ad..38ffa445c1612 100644 --- a/superset-frontend/src/SqlLab/components/SouthPane/SouthPane.test.tsx +++ b/superset-frontend/src/SqlLab/components/SouthPane/SouthPane.test.tsx @@ -16,7 +16,6 @@ * specific language governing permissions and limitations * under the License. */ -import React from 'react'; import { render } from 'spec/helpers/testing-library'; import SouthPane from 'src/SqlLab/components/SouthPane'; import '@testing-library/jest-dom/extend-expect'; diff --git a/superset-frontend/src/SqlLab/components/SouthPane/index.tsx b/superset-frontend/src/SqlLab/components/SouthPane/index.tsx index 941f0f7523c6b..a00980002fd3c 100644 --- a/superset-frontend/src/SqlLab/components/SouthPane/index.tsx +++ b/superset-frontend/src/SqlLab/components/SouthPane/index.tsx @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import React, { createRef, useMemo } from 'react'; +import { createRef, useMemo } from 'react'; import { shallowEqual, useDispatch, useSelector } from 'react-redux'; import shortid from 'shortid'; import Tabs from 'src/components/Tabs'; diff --git a/superset-frontend/src/SqlLab/components/SqlEditor/SqlEditor.test.tsx b/superset-frontend/src/SqlLab/components/SqlEditor/SqlEditor.test.tsx index a21b597c96bd6..6368f0b6e462f 100644 --- a/superset-frontend/src/SqlLab/components/SqlEditor/SqlEditor.test.tsx +++ b/superset-frontend/src/SqlLab/components/SqlEditor/SqlEditor.test.tsx @@ -16,7 +16,7 @@ * specific language governing permissions and limitations * under the License. */ -import React from 'react'; +import { FocusEventHandler } from 'react'; import * as uiCore from '@superset-ui/core'; import { act } from 'react-dom/test-utils'; import { fireEvent, render, waitFor } from 'spec/helpers/testing-library'; @@ -45,7 +45,7 @@ jest.mock('src/components/AsyncAceEditor', () => ({ value, }: { onChange: (value: string) => void; - onBlur: React.FocusEventHandler; + onBlur: FocusEventHandler; value: string; }) => (