diff --git a/superset-frontend/.storybook/preview.jsx b/superset-frontend/.storybook/preview.jsx index 4339552bac7..84a54ba2087 100644 --- a/superset-frontend/.storybook/preview.jsx +++ b/superset-frontend/.storybook/preview.jsx @@ -22,7 +22,7 @@ import thunk from 'redux-thunk'; import { Provider } from 'react-redux'; import reducerIndex from 'spec/helpers/reducerIndex'; import { Global } from '@emotion/react'; -import { App, Layout, Space, Content } from 'antd'; +import { App, Layout } from 'antd'; import 'src/theme.ts'; import './storybook.css'; diff --git a/superset-frontend/oxlint.json b/superset-frontend/oxlint.json index 7812bbfe6a9..27563d81c5e 100644 --- a/superset-frontend/oxlint.json +++ b/superset-frontend/oxlint.json @@ -232,7 +232,14 @@ "@typescript-eslint/no-non-null-assertion": "off", "@typescript-eslint/explicit-function-return-type": "off", "@typescript-eslint/explicit-module-boundary-types": "off", - "@typescript-eslint/no-unused-vars": "warn", + "@typescript-eslint/no-unused-vars": [ + "error", + { + "argsIgnorePattern": "^_", + "varsIgnorePattern": "^_", + "caughtErrors": "none" + } + ], "@typescript-eslint/prefer-optional-chain": "error", // === Unicorn rules (bonus coverage) === diff --git a/superset-frontend/packages/superset-ui-core/src/chart/components/Matrixify/MatrixifyGridCell.tsx b/superset-frontend/packages/superset-ui-core/src/chart/components/Matrixify/MatrixifyGridCell.tsx index 5a808378c84..ddcb7a8d86c 100644 --- a/superset-frontend/packages/superset-ui-core/src/chart/components/Matrixify/MatrixifyGridCell.tsx +++ b/superset-frontend/packages/superset-ui-core/src/chart/components/Matrixify/MatrixifyGridCell.tsx @@ -92,7 +92,7 @@ const MatrixNoDataComponent = () => { * Individual grid cell component - memoized to prevent unnecessary re-renders */ const MatrixifyGridCell = memo( - ({ cell, rowHeight, datasource, hooks }: MatrixifyGridCellProps) => { + ({ cell, hooks }: MatrixifyGridCellProps) => { // Use computed title from template (will be empty string if no template) const cellLabel = cell.title || ''; diff --git a/superset-frontend/packages/superset-ui-core/src/chart/components/Matrixify/MatrixifyGridRenderer.tsx b/superset-frontend/packages/superset-ui-core/src/chart/components/Matrixify/MatrixifyGridRenderer.tsx index fc4b6422459..4882ce85163 100644 --- a/superset-frontend/packages/superset-ui-core/src/chart/components/Matrixify/MatrixifyGridRenderer.tsx +++ b/superset-frontend/packages/superset-ui-core/src/chart/components/Matrixify/MatrixifyGridRenderer.tsx @@ -118,7 +118,6 @@ interface MatrixifyGridRendererProps { function MatrixifyGridRenderer({ formData, datasource, - width, height, hooks, }: MatrixifyGridRendererProps) { @@ -249,7 +248,7 @@ function MatrixifyGridRenderer({ {/* Row cells for this column group */} {row .slice(colGroup.startIdx, colGroup.endIdx) - .map((cell, colIdx) => + .map(cell => cell ? ( '#ccc'; // fallback if scheme not found + : (_v: number) => '#ccc'; // fallback if scheme not found const legend = d3Range(steps).map(i => extents[0] + step * i); const legendColors = legend.map(x => colorScale(x)); diff --git a/superset-frontend/plugins/legacy-plugin-chart-country-map/src/CountryMap.ts b/superset-frontend/plugins/legacy-plugin-chart-country-map/src/CountryMap.ts index ad3733df31d..d5383d95981 100644 --- a/superset-frontend/plugins/legacy-plugin-chart-country-map/src/CountryMap.ts +++ b/superset-frontend/plugins/legacy-plugin-chart-country-map/src/CountryMap.ts @@ -22,7 +22,6 @@ import d3 from 'd3'; import { extent as d3Extent } from 'd3-array'; import { ValueFormatter, - getNumberFormatter, getSequentialSchemeRegistry, CategoricalColorNamespace, } from '@superset-ui/core'; @@ -187,9 +186,11 @@ function CountryMap(element: HTMLElement, props: CountryMapProps) { region => region.country_id === d.properties.ISO, ); - hoverPopup.style('display', 'block').html( - `
${getNameOfRegion(d)}
${result.length > 0 ? formatter(result[0].metric) : ''}
`, - ); + hoverPopup + .style('display', 'block') + .html( + `
${getNameOfRegion(d)}
${result.length > 0 ? formatter(result[0].metric) : ''}
`, + ); updatePopupPosition(); }; diff --git a/superset-frontend/plugins/plugin-chart-ag-grid-table/src/renderers/NumericCellRenderer.tsx b/superset-frontend/plugins/plugin-chart-ag-grid-table/src/renderers/NumericCellRenderer.tsx index 87529673110..27d10bfb7bb 100644 --- a/superset-frontend/plugins/plugin-chart-ag-grid-table/src/renderers/NumericCellRenderer.tsx +++ b/superset-frontend/plugins/plugin-chart-ag-grid-table/src/renderers/NumericCellRenderer.tsx @@ -16,14 +16,9 @@ * specific language governing permissions and limitations * under the License. */ -import { - styled, - useTheme, - type SupersetTheme, -} from '@apache-superset/core/theme'; +import { styled } from '@apache-superset/core/theme'; import { CustomCellRendererProps } from '@superset-ui/core/components/ThemedAgGridReact'; import { BasicColorFormatterType, InputColumn, ValueRange } from '../types'; -import { useIsDark } from '../utils/useTableTheme'; const StyledTotalCell = styled.div` ${() => ` @@ -110,13 +105,9 @@ function cellOffset({ function cellBackground({ value, colorPositiveNegative = false, - isDarkTheme = false, - theme, }: { value: number; colorPositiveNegative: boolean; - isDarkTheme: boolean; - theme: SupersetTheme | null; }) { if (!colorPositiveNegative) { return 'transparent'; // Use transparent background when colorPositiveNegative is false @@ -153,9 +144,6 @@ export const NumericCellRenderer = ( colorPositiveNegative, } = params; - const isDarkTheme = useIsDark(); - const theme = !colorPositiveNegative ? null : useTheme(); - if (node?.rowPinned === 'bottom') { return {valueFormatted ?? value}; } @@ -199,8 +187,6 @@ export const NumericCellRenderer = ( const background = cellBackground({ value: value as number, colorPositiveNegative, - isDarkTheme, - theme, }); return ( diff --git a/superset-frontend/plugins/plugin-chart-ag-grid-table/src/utils/useColDefs.ts b/superset-frontend/plugins/plugin-chart-ag-grid-table/src/utils/useColDefs.ts index 1ade82887d4..b9f084d0cd7 100644 --- a/superset-frontend/plugins/plugin-chart-ag-grid-table/src/utils/useColDefs.ts +++ b/superset-frontend/plugins/plugin-chart-ag-grid-table/src/utils/useColDefs.ts @@ -20,7 +20,7 @@ import { t } from '@apache-superset/core/translation'; import { ColDef } from '@superset-ui/core/components/ThemedAgGridReact'; import { useCallback, useMemo } from 'react'; -import { DataRecord, DataRecordValue, JsonObject } from '@superset-ui/core'; +import { DataRecordValue, JsonObject } from '@superset-ui/core'; import { GenericDataType } from '@apache-superset/core/common'; import { useTheme } from '@apache-superset/core/theme'; import { ColorFormatters } from '@superset-ui/chart-controls'; @@ -61,7 +61,6 @@ type UseColDefsProps = { defaultAlignPN: boolean; showCellBars: boolean; colorPositiveNegative: boolean; - totals: DataRecord | undefined; columnColorFormatters: ColorFormatters; allowRearrangeColumns?: boolean; basicColorFormatters?: { [Key: string]: BasicColorFormatterType }[]; @@ -227,7 +226,6 @@ export const useColDefs = ({ defaultAlignPN, showCellBars, colorPositiveNegative, - totals, columnColorFormatters, allowRearrangeColumns, basicColorFormatters, 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 9f5a9d0ccda..e889f9848f2 100644 --- a/superset-frontend/plugins/plugin-chart-echarts/src/BigNumber/BigNumberViz.tsx +++ b/superset-frontend/plugins/plugin-chart-echarts/src/BigNumber/BigNumberViz.tsx @@ -23,7 +23,6 @@ import { getTimeFormatter, SMART_DATE_VERBOSE_ID, computeMaxFontSize, - BRAND_COLOR, BinaryQueryObjectFilterClause, DTTM_ALIAS, } from '@superset-ui/core'; @@ -43,14 +42,11 @@ function BigNumberVis({ kickerFontSize = PROPORTION.KICKER, metricNameFontSize = PROPORTION.METRIC_NAME, showMetricName = true, - mainColor = BRAND_COLOR, showTimestamp = false, showTrendLine = false, - startYAxisAtZero = true, subheader = '', subheaderFontSize = PROPORTION.SUBHEADER, subtitleFontSize = PROPORTION.SUBHEADER, - timeRangeFixed = false, ...props }: BigNumberVizProps) { const theme = useTheme(); 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 da95df2d891..0f668dfeed0 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 @@ -372,13 +372,8 @@ const config: ControlPanelConfig = { description: t( 'Stack in groups, where each group corresponds to a dimension', ), - shouldMapStateToProps: ( - prevState, - state, - controlState, - chartState, - ) => true, - mapStateToProps: (state, controlState, chartState) => { + shouldMapStateToProps: () => true, + mapStateToProps: state => { const value: JsonArray = ensureIsArray( state.controls.groupby?.value, ) as JsonArray; diff --git a/superset-frontend/src/SqlLab/components/TableExploreTree/TreeNodeRenderer.tsx b/superset-frontend/src/SqlLab/components/TableExploreTree/TreeNodeRenderer.tsx index f3bdc73882f..91f37ed8060 100644 --- a/superset-frontend/src/SqlLab/components/TableExploreTree/TreeNodeRenderer.tsx +++ b/superset-frontend/src/SqlLab/components/TableExploreTree/TreeNodeRenderer.tsx @@ -102,7 +102,6 @@ export interface TreeNodeRendererProps extends NodeRendererProps { const TreeNodeRenderer: React.FC = ({ node, style, - manuallyOpenedNodes, loadingNodes, searchTerm, catalog, diff --git a/superset-frontend/src/components/Chart/ChartRenderer.tsx b/superset-frontend/src/components/Chart/ChartRenderer.tsx index 90a35d75a45..18c70e1477b 100644 --- a/superset-frontend/src/components/Chart/ChartRenderer.tsx +++ b/superset-frontend/src/components/Chart/ChartRenderer.tsx @@ -183,7 +183,6 @@ function ChartRendererComponent({ onFilterMenuClose = () => BLANK, initialValues = BLANK, setControlValue = () => {}, - triggerRender = false, ...restProps }: ChartRendererProps): JSX.Element | null { const { diff --git a/superset-frontend/src/components/Datasource/FoldersEditor/TreeItem.styles.ts b/superset-frontend/src/components/Datasource/FoldersEditor/TreeItem.styles.ts index 8c95a3a4a6a..d4c0e43d846 100644 --- a/superset-frontend/src/components/Datasource/FoldersEditor/TreeItem.styles.ts +++ b/superset-frontend/src/components/Datasource/FoldersEditor/TreeItem.styles.ts @@ -71,7 +71,7 @@ export const ItemSeparator = styled.div<{ export const TreeFolderContainer = styled(TreeItemContainer)<{ isForbiddenDropTarget?: boolean; }>` - ${({ theme, depth, isForbiddenDropTarget, isOverlay }) => ` + ${({ theme, depth, isForbiddenDropTarget }) => ` margin-top: 0; margin-bottom: 0; padding-top: ${theme.paddingSM}px; diff --git a/superset-frontend/src/components/Datasource/components/DatasourceEditor/DatasourceEditor.tsx b/superset-frontend/src/components/Datasource/components/DatasourceEditor/DatasourceEditor.tsx index 8bc2b6cf8f3..d0e557991aa 100644 --- a/superset-frontend/src/components/Datasource/components/DatasourceEditor/DatasourceEditor.tsx +++ b/superset-frontend/src/components/Datasource/components/DatasourceEditor/DatasourceEditor.tsx @@ -301,9 +301,7 @@ interface CollectionTabTitleProps { interface ColumnCollectionTableProps { columns: Column[]; - datasource: DatasourceObject; onColumnsChange: (columns: Column[]) => void; - onDatasourceChange: (datasource: DatasourceObject) => void; editableColumnName?: boolean; showExpression?: boolean; allowAddItem?: boolean; @@ -520,9 +518,7 @@ function FormContainer({ children }: FormContainerProps): JSX.Element { function ColumnCollectionTable({ columns, - datasource, onColumnsChange, - onDatasourceChange, editableColumnName = false, showExpression = false, allowAddItem = false, @@ -2428,11 +2424,9 @@ class DatasourceEditor extends PureComponent< columns={this.state.databaseColumns} filterTerm={this.state.columnSearchTerm} filterFields={['column_name']} - datasource={datasource} onColumnsChange={databaseColumns => this.setColumns({ databaseColumns }) } - onDatasourceChange={this.onDatasourceChange} /> {this.state.metadataLoading && } @@ -2474,8 +2468,6 @@ class DatasourceEditor extends PureComponent< 'as the alias in the SQL query.', ), }} - onDatasourceChange={this.onDatasourceChange} - datasource={datasource} editableColumnName showExpression allowAddItem diff --git a/superset-frontend/src/components/ErrorMessage/FrontendNetworkErrorMessage.tsx b/superset-frontend/src/components/ErrorMessage/FrontendNetworkErrorMessage.tsx index 899e332410c..486894b4be7 100644 --- a/superset-frontend/src/components/ErrorMessage/FrontendNetworkErrorMessage.tsx +++ b/superset-frontend/src/components/ErrorMessage/FrontendNetworkErrorMessage.tsx @@ -23,7 +23,6 @@ import { ErrorAlert } from './ErrorAlert'; export function FrontendNetworkErrorMessage({ error, - subtitle, compact, closable, }: ErrorMessageComponentProps) { diff --git a/superset-frontend/src/components/GridTable/index.tsx b/superset-frontend/src/components/GridTable/index.tsx index cafe7c67736..4ea218802fd 100644 --- a/superset-frontend/src/components/GridTable/index.tsx +++ b/superset-frontend/src/components/GridTable/index.tsx @@ -45,7 +45,6 @@ export function GridTable({ showRowNumber, enableActions, size = GridSize.Middle, - striped, }: TableProps) { const theme = useTheme(); const isExternalFilterPresent = useCallback( diff --git a/superset-frontend/src/components/Modal/CollapsibleModalSection.tsx b/superset-frontend/src/components/Modal/CollapsibleModalSection.tsx index cad4424ed1a..a27349464f6 100644 --- a/superset-frontend/src/components/Modal/CollapsibleModalSection.tsx +++ b/superset-frontend/src/components/Modal/CollapsibleModalSection.tsx @@ -24,7 +24,6 @@ interface CollapsibleModalSectionProps { sectionKey: string; title: string; subtitle?: string; - defaultExpanded?: boolean; hasErrors?: boolean; testId?: string; children: ReactNode; @@ -41,7 +40,6 @@ export function CollapsibleModalSection({ sectionKey, title, subtitle, - defaultExpanded = false, hasErrors = false, testId, children, diff --git a/superset-frontend/src/components/Modal/ModalFormField.tsx b/superset-frontend/src/components/Modal/ModalFormField.tsx index c825e465b58..7012379b4f5 100644 --- a/superset-frontend/src/components/Modal/ModalFormField.tsx +++ b/superset-frontend/src/components/Modal/ModalFormField.tsx @@ -29,8 +29,6 @@ interface ModalFormFieldProps { bottomSpacing?: boolean; children: ReactNode; testId?: string; - validateStatus?: 'success' | 'warning' | 'error' | 'validating'; - hasFeedback?: boolean; } const StyledFieldContainer = styled.div<{ bottomSpacing: boolean }>` @@ -125,8 +123,6 @@ export function ModalFormField({ bottomSpacing = true, children, testId, - validateStatus, - hasFeedback = false, }: ModalFormFieldProps) { return ( diff --git a/superset-frontend/src/components/Modal/StandardModal.tsx b/superset-frontend/src/components/Modal/StandardModal.tsx index 963afdbca53..a74f130d4d1 100644 --- a/superset-frontend/src/components/Modal/StandardModal.tsx +++ b/superset-frontend/src/components/Modal/StandardModal.tsx @@ -32,13 +32,10 @@ interface StandardModalProps { saveDisabled?: boolean; saveLoading?: boolean; saveText?: string; - cancelText?: string; errorTooltip?: ReactNode; children: ReactNode; isEditMode?: boolean; centered?: boolean; - destroyOnClose?: boolean; - maskClosable?: boolean; wrapProps?: object; contentLoading?: boolean; } @@ -107,13 +104,10 @@ export function StandardModal({ saveDisabled = false, saveLoading = false, saveText, - cancelText, errorTooltip, children, isEditMode = false, centered = true, - destroyOnClose = true, - maskClosable = false, wrapProps, contentLoading = false, }: StandardModalProps) { diff --git a/superset-frontend/src/components/Tag/utils.test.tsx b/superset-frontend/src/components/Tag/utils.test.tsx index 19b41159084..cb0bc24b0a0 100644 --- a/superset-frontend/src/components/Tag/utils.test.tsx +++ b/superset-frontend/src/components/Tag/utils.test.tsx @@ -166,7 +166,7 @@ describe('loadTags', () => { const calls = fetchMock.callHistory.calls(); // Verify all calls include the custom tag filter - calls.forEach(call => { + calls.forEach(_call => { const { url } = calls[0]; const urlObj = new URL(url); const queryParam = urlObj.searchParams.get('q'); diff --git a/superset-frontend/src/core/sqlLab/models.ts b/superset-frontend/src/core/sqlLab/models.ts index ce593c582f1..a1bfec12a2c 100644 --- a/superset-frontend/src/core/sqlLab/models.ts +++ b/superset-frontend/src/core/sqlLab/models.ts @@ -176,7 +176,7 @@ export class QueryResultContext requestedLimit?: number; } = {}, ) { - const { appliedLimit, appliedLimitingFactor, ...opt } = options; + const { appliedLimit, ...opt } = options; super(clientId, tab, runAsync, startDttm, opt); this.remoteId = remoteId; this.executedSql = executedSql; @@ -219,7 +219,7 @@ export class QueryErrorResultContext queryId?: number; } = {}, ) { - const { queryId, executedSql, endDttm, ...opt } = options; + const { executedSql, endDttm, ...opt } = options; super(clientId, tab, runAsync, startDttm, opt); this.executedSql = executedSql ?? null; this.errorMessage = errorMessage; diff --git a/superset-frontend/src/dashboard/components/Dashboard.tsx b/superset-frontend/src/dashboard/components/Dashboard.tsx index 410e9dec899..ac9b82cec6c 100644 --- a/superset-frontend/src/dashboard/components/Dashboard.tsx +++ b/superset-frontend/src/dashboard/components/Dashboard.tsx @@ -114,12 +114,8 @@ function Dashboard({ slices, activeFilters, chartConfiguration, - datasources, ownDataCharts, layout, - impressionId, - timeout = 60, - userId = '', children, }: DashboardProps): JSX.Element { const context = useContext(PluginContext) as PluginContextType; diff --git a/superset-frontend/src/dashboard/components/SaveModal.tsx b/superset-frontend/src/dashboard/components/SaveModal.tsx index 0e451d3f3af..1f8eb570274 100644 --- a/superset-frontend/src/dashboard/components/SaveModal.tsx +++ b/superset-frontend/src/dashboard/components/SaveModal.tsx @@ -65,18 +65,18 @@ type SaveModalProps = { function SaveModal({ saveType: initialSaveType = SAVE_TYPE_OVERWRITE, - colorNamespace, - colorScheme, + colorNamespace: _colorNamespace, + colorScheme: _colorScheme, shouldPersistRefreshFrequency = false, dashboardTitle, onSave, triggerNode, canOverwrite, - addSuccessToast, + addSuccessToast: _addSuccessToast, addDangerToast, dashboardId, dashboardInfo, - expandedSlices, + expandedSlices: _expandedSlices, layout, customCss, refreshFrequency, diff --git a/superset-frontend/src/dashboard/components/gridComponents/Divider/Divider.test.tsx b/superset-frontend/src/dashboard/components/gridComponents/Divider/Divider.test.tsx index 356f8077d3c..cb5c0817c13 100644 --- a/superset-frontend/src/dashboard/components/gridComponents/Divider/Divider.test.tsx +++ b/superset-frontend/src/dashboard/components/gridComponents/Divider/Divider.test.tsx @@ -35,7 +35,7 @@ describe('Divider', () => { index: 0, editMode: false, handleComponentDrop: jest.fn(), - deleteComponent: (id: string, parentId: string) => {}, + deleteComponent: (_id: string, _parentId: string) => {}, }; const setup = (overrideProps: Partial = {}) => diff --git a/superset-frontend/src/dashboard/components/gridComponents/TabsRenderer/TabsRenderer.tsx b/superset-frontend/src/dashboard/components/gridComponents/TabsRenderer/TabsRenderer.tsx index 6d030b06a56..d9e34e8ec23 100644 --- a/superset-frontend/src/dashboard/components/gridComponents/TabsRenderer/TabsRenderer.tsx +++ b/superset-frontend/src/dashboard/components/gridComponents/TabsRenderer/TabsRenderer.tsx @@ -117,7 +117,6 @@ interface DraggableTabNodeProps extends React.HTMLAttributes { } const DraggableTabNode: React.FC> = ({ - className, disabled = false, ...props }) => { @@ -170,7 +169,6 @@ const TabsRenderer = memo( tabBarPaddingLeft = 0, onTabsReorder, isEditingTabTitle = false, - onTabTitleEditingChange, }) => { const [activeId, setActiveId] = useState(null); diff --git a/superset-frontend/src/dashboard/components/nativeFilters/FilterBar/FilterControls/FilterControls.tsx b/superset-frontend/src/dashboard/components/nativeFilters/FilterBar/FilterControls/FilterControls.tsx index a5c86fa2131..e9bcbaa8b91 100644 --- a/superset-frontend/src/dashboard/components/nativeFilters/FilterBar/FilterControls/FilterControls.tsx +++ b/superset-frontend/src/dashboard/components/nativeFilters/FilterBar/FilterControls/FilterControls.tsx @@ -279,7 +279,7 @@ const FilterControls: FC = ({ ); const customizationRenderer = useCallback( - (item: ChartCustomization | ChartCustomizationDivider, index: number) => { + (item: ChartCustomization | ChartCustomizationDivider, _index: number) => { if (isChartCustomizationDivider(item)) { return ( = ({ onPendingCustomizationDataMaskChange, toggleFiltersBar, width, - clearAllTriggers, - onClearAllComplete, }) => { const theme = useTheme(); const [isScrolling, setIsScrolling] = useState(false); diff --git a/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/hooks/useCustomizationOperations.ts b/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/hooks/useCustomizationOperations.ts index 1390419e7f5..59aa89a4ffe 100644 --- a/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/hooks/useCustomizationOperations.ts +++ b/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/hooks/useCustomizationOperations.ts @@ -105,7 +105,7 @@ export function useCustomizationOperations({ ); const handleRearrangeCustomizations = useCallback( - (dragIndex: number, targetIndex: number, id: string) => { + (dragIndex: number, targetIndex: number, _id: string) => { const newOrderedIds = [...customizationState.orderedIds]; const [removed] = newOrderedIds.splice(dragIndex, 1); newOrderedIds.splice(targetIndex, 0, removed); diff --git a/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/hooks/useFilterOperations.ts b/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/hooks/useFilterOperations.ts index b57143e8533..cbd217ffde9 100644 --- a/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/hooks/useFilterOperations.ts +++ b/superset-frontend/src/dashboard/components/nativeFilters/FiltersConfigModal/hooks/useFilterOperations.ts @@ -125,7 +125,7 @@ export function useFilterOperations({ ); const handleRearrangeFilters = useCallback( - (dragIndex: number, targetIndex: number, id: string) => { + (dragIndex: number, targetIndex: number, _id: string) => { const newOrderedIds = [...filterState.orderedIds]; const [removed] = newOrderedIds.splice(dragIndex, 1); newOrderedIds.splice(targetIndex, 0, removed); diff --git a/superset-frontend/src/explore/components/DataTablesPane/components/SamplesPane.tsx b/superset-frontend/src/explore/components/DataTablesPane/components/SamplesPane.tsx index ae901bc23ac..e743ad6844a 100644 --- a/superset-frontend/src/explore/components/DataTablesPane/components/SamplesPane.tsx +++ b/superset-frontend/src/explore/components/DataTablesPane/components/SamplesPane.tsx @@ -60,7 +60,6 @@ export const SamplesPane = ({ queryFormData, queryForce, setForceQuery, - isVisible, canDownload, }: SamplesPaneProps) => { const [filterText, setFilterText] = useState(''); diff --git a/superset-frontend/src/explore/components/ExploreAlert.tsx b/superset-frontend/src/explore/components/ExploreAlert.tsx index d4a8a4b4405..456ad512234 100644 --- a/superset-frontend/src/explore/components/ExploreAlert.tsx +++ b/superset-frontend/src/explore/components/ExploreAlert.tsx @@ -51,7 +51,7 @@ export const ExploreAlert = forwardRef( type = 'info', className = '', }: ControlPanelAlertProps, - ref: RefObject, + _ref: RefObject, ) => ( - props.actions.setControlValue(controlName, value), + setControlValue: ( + controlName: string, + value: any, + _chartId: number, + ) => props.actions.setControlValue(controlName, value), }} can_overwrite={props.can_overwrite} can_download={props.can_download} diff --git a/superset-frontend/src/explore/components/controls/FilterControl/AdhocFilterEditPopover/index.tsx b/superset-frontend/src/explore/components/controls/FilterControl/AdhocFilterEditPopover/index.tsx index 7fc2dc0ff8f..62a06e24bb6 100644 --- a/superset-frontend/src/explore/components/controls/FilterControl/AdhocFilterEditPopover/index.tsx +++ b/superset-frontend/src/explore/components/controls/FilterControl/AdhocFilterEditPopover/index.tsx @@ -294,7 +294,7 @@ export default class AdhocFilterEditPopover extends Component< .filter((item: { sliceIndex: number }) => item.sliceIndex !== -1) .map( ({ - sliceIndex, + sliceIndex: _sliceIndex, ...item }: { sliceIndex: number; @@ -346,12 +346,12 @@ export default class AdhocFilterEditPopover extends Component< const { adhocFilter: propsAdhocFilter, options, - onChange, - onClose, - onResize, + onChange: _onChange, + onClose: _onClose, + onResize: _onResize, datasource, partitionColumn, - theme, + theme: _theme, operators, requireSave, ...popoverProps diff --git a/superset-frontend/src/explore/components/controls/MetricControl/AdhocMetricEditPopover/index.tsx b/superset-frontend/src/explore/components/controls/MetricControl/AdhocMetricEditPopover/index.tsx index 22fdeaa93ee..8d7e04704df 100644 --- a/superset-frontend/src/explore/components/controls/MetricControl/AdhocMetricEditPopover/index.tsx +++ b/superset-frontend/src/explore/components/controls/MetricControl/AdhocMetricEditPopover/index.tsx @@ -349,9 +349,9 @@ class AdhocMetricEditPopover extends PureComponent< savedMetric: propsSavedMetric, columns, savedMetricsOptions, - onChange, - onClose, - onResize, + onChange: _onChange, + onClose: _onClose, + onResize: _onResize, datasource, isNewMetric, isLabelModified, diff --git a/superset-frontend/src/explore/components/controls/TextAreaControl.tsx b/superset-frontend/src/explore/components/controls/TextAreaControl.tsx index e7ec1d93ca9..29ee91bdbea 100644 --- a/superset-frontend/src/explore/components/controls/TextAreaControl.tsx +++ b/superset-frontend/src/explore/components/controls/TextAreaControl.tsx @@ -146,19 +146,19 @@ class TextAreaControl extends Component { // - other control-specific props and explicitly-set props to avoid duplicate/conflicting assignments const { theme, - height, - offerEditInModal, - aboveEditorSection, + height: _height, + offerEditInModal: _offerEditInModal, + aboveEditorSection: _aboveEditorSection, resize, textAreaStyles, tooltipOptions, hotkeys, - debounceDelay, + debounceDelay: _debounceDelay, language, initialValue, readOnly, name, - onChange, + onChange: _onChange, value, minLines: minLinesProp, maxLines: maxLinesProp, diff --git a/superset-frontend/src/features/alerts/AlertReportModal.tsx b/superset-frontend/src/features/alerts/AlertReportModal.tsx index 64f1fa4024c..e553b2a5e3c 100644 --- a/superset-frontend/src/features/alerts/AlertReportModal.tsx +++ b/superset-frontend/src/features/alerts/AlertReportModal.tsx @@ -1152,7 +1152,7 @@ const AlertReportModal: FunctionComponent = ({ ); } }) - .catch(e => { + .catch(() => { addDangerToast(t('There was an error retrieving dashboard tabs.')); }); } diff --git a/superset-frontend/src/features/alerts/components/NotificationMethod.tsx b/superset-frontend/src/features/alerts/components/NotificationMethod.tsx index 72b19c2cbc2..f5cede3b79a 100644 --- a/superset-frontend/src/features/alerts/components/NotificationMethod.tsx +++ b/superset-frontend/src/features/alerts/components/NotificationMethod.tsx @@ -306,7 +306,7 @@ export const NotificationMethod: FunctionComponent = ({ } } }) - .catch(e => { + .catch(() => { // Fallback to slack v1 if slack v2 is not compatible setUseSlackV1(true); }) diff --git a/superset-frontend/src/features/allEntities/AllEntitiesTable.tsx b/superset-frontend/src/features/allEntities/AllEntitiesTable.tsx index 78a9f146c2f..210c5117380 100644 --- a/superset-frontend/src/features/allEntities/AllEntitiesTable.tsx +++ b/superset-frontend/src/features/allEntities/AllEntitiesTable.tsx @@ -59,7 +59,7 @@ interface AllEntitiesTableProps { } export default function AllEntitiesTable({ - search = '', + search: _search = '', setShowTagModal, objects, canEditTag, diff --git a/superset-frontend/src/features/annotations/AnnotationModal.tsx b/superset-frontend/src/features/annotations/AnnotationModal.tsx index e5e9d0c8121..ba83c8736a2 100644 --- a/superset-frontend/src/features/annotations/AnnotationModal.tsx +++ b/superset-frontend/src/features/annotations/AnnotationModal.tsx @@ -208,7 +208,7 @@ const AnnotationModal: FunctionComponent = ({ setCurrentAnnotation(data); }; - const onDateChange = (dates: any, dateString: Array) => { + const onDateChange = (dates: any, _dateString: Array) => { if (!dates?.[0] || !dates?.[1]) { const data = { ...currentAnnotation, diff --git a/superset-frontend/src/features/databases/DatabaseModal/index.test.tsx b/superset-frontend/src/features/databases/DatabaseModal/index.test.tsx index 0cfd11eede3..943e237d8da 100644 --- a/superset-frontend/src/features/databases/DatabaseModal/index.test.tsx +++ b/superset-frontend/src/features/databases/DatabaseModal/index.test.tsx @@ -1632,7 +1632,7 @@ test('validates fix by testing all form field types clear validation errors', () mockClearError(); }; - const handleChangeWithValidation = (actionType: any, payload: any) => { + const handleChangeWithValidation = (_actionType: any, _payload: any) => { handleClearValidationErrors(); }; diff --git a/superset-frontend/src/features/databases/UploadDataModel/index.tsx b/superset-frontend/src/features/databases/UploadDataModel/index.tsx index 91d20aa20a0..5bf0d23baad 100644 --- a/superset-frontend/src/features/databases/UploadDataModel/index.tsx +++ b/superset-frontend/src/features/databases/UploadDataModel/index.tsx @@ -359,7 +359,7 @@ const UploadDataModal: FunctionComponent = ({ const loadSchemaOptions = useMemo( () => - (input = '', page: number, pageSize: number) => { + (_input = '', _page: number, _pageSize: number) => { if (!currentDatabaseId) { return Promise.resolve({ data: [], totalCount: 0 }); } @@ -563,7 +563,7 @@ const UploadDataModal: FunctionComponent = ({ } }, [show]); - const validateUpload = (_: any, value: string) => { + const validateUpload = (_: any, _value: string) => { if (fileList.length === 0) { return Promise.reject(t('Uploading a file is required')); } diff --git a/superset-frontend/src/features/roles/RoleListEditModal.test.tsx b/superset-frontend/src/features/roles/RoleListEditModal.test.tsx index 9072f991f21..57f0769742a 100644 --- a/superset-frontend/src/features/roles/RoleListEditModal.test.tsx +++ b/superset-frontend/src/features/roles/RoleListEditModal.test.tsx @@ -252,9 +252,7 @@ describe('RoleListEditModal', () => { const mockGet = SupersetClient.get as jest.Mock; mockGet.mockImplementation(({ endpoint }) => { if ( - endpoint?.includes( - `/api/v1/security/roles/${mockRole.id}/permissions/`, - ) + endpoint?.includes(`/api/v1/security/roles/${mockRole.id}/permissions/`) ) { // Only return permission id=10, not id=20 return Promise.resolve({ @@ -298,9 +296,7 @@ describe('RoleListEditModal', () => { const mockGet = SupersetClient.get as jest.Mock; mockGet.mockImplementation(({ endpoint }) => { if ( - endpoint?.includes( - `/api/v1/security/roles/${mockRole.id}/permissions/`, - ) + endpoint?.includes(`/api/v1/security/roles/${mockRole.id}/permissions/`) ) { return Promise.reject(new Error('network error')); } @@ -333,7 +329,7 @@ describe('RoleListEditModal', () => { test('fires warning toast when hydration returns zero rows but IDs were expected', async () => { const mockGet = SupersetClient.get as jest.Mock; - mockGet.mockImplementation(({ endpoint }) => + mockGet.mockImplementation(() => Promise.resolve({ json: { count: 0, result: [] } }), ); @@ -371,7 +367,9 @@ describe('RoleListEditModal', () => { }; mockGet.mockImplementation(({ endpoint }) => { - if (endpoint?.includes(`/api/v1/security/roles/${roleA.id}/permissions/`)) { + if ( + endpoint?.includes(`/api/v1/security/roles/${roleA.id}/permissions/`) + ) { return Promise.resolve({ json: { result: roleA.permission_ids.map(pid => ({ @@ -382,7 +380,9 @@ describe('RoleListEditModal', () => { }, }); } - if (endpoint?.includes(`/api/v1/security/roles/${roleB.id}/permissions/`)) { + if ( + endpoint?.includes(`/api/v1/security/roles/${roleB.id}/permissions/`) + ) { return Promise.resolve({ json: { result: roleB.permission_ids.map(pid => ({ diff --git a/superset-frontend/src/features/tags/BulkTagModal.tsx b/superset-frontend/src/features/tags/BulkTagModal.tsx index 46adac21021..b54f9555c70 100644 --- a/superset-frontend/src/features/tags/BulkTagModal.tsx +++ b/superset-frontend/src/features/tags/BulkTagModal.tsx @@ -85,7 +85,7 @@ const BulkTagModal: FC = ({ } addSuccessToast(t('Tagged %s %ss', tagged.length, resourceName)); }) - .catch(err => { + .catch(() => { addDangerToast(t('Failed to tag items')); }); diff --git a/superset-frontend/src/features/tags/TagModal.tsx b/superset-frontend/src/features/tags/TagModal.tsx index 20736d4610c..aea360617de 100644 --- a/superset-frontend/src/features/tags/TagModal.tsx +++ b/superset-frontend/src/features/tags/TagModal.tsx @@ -130,7 +130,7 @@ const TagModal: FC = ({ setChartsToTag(resourceMap[TaggableResources.Chart]); setSavedQueriesToTag(resourceMap[TaggableResources.SavedQuery]); }, - (error: Response) => { + (_error: Response) => { addDangerToast('Error Fetching Tagged Objects'); }, ); diff --git a/superset-frontend/src/features/userInfo/UserInfoModal.tsx b/superset-frontend/src/features/userInfo/UserInfoModal.tsx index 1baeab7c68c..4f327f303a0 100644 --- a/superset-frontend/src/features/userInfo/UserInfoModal.tsx +++ b/superset-frontend/src/features/userInfo/UserInfoModal.tsx @@ -48,7 +48,7 @@ function UserInfoModal({ : {}; const handleFormSubmit = async (values: FormValues) => { try { - const { confirm_password, ...payload } = values; + const { confirm_password: _confirm_password, ...payload } = values; await SupersetClient.put({ endpoint: `/api/v1/me/`, jsonPayload: { ...payload }, diff --git a/superset-frontend/src/features/users/utils.ts b/superset-frontend/src/features/users/utils.ts index 2929ba09622..5450bdca49f 100644 --- a/superset-frontend/src/features/users/utils.ts +++ b/superset-frontend/src/features/users/utils.ts @@ -22,7 +22,7 @@ import { SelectOption } from 'src/components/ListView'; import { FormValues } from './types'; export const createUser = async (values: FormValues) => { - const { confirmPassword, ...payload } = values; + const { confirmPassword: _confirmPassword, ...payload } = values; if (payload.active == null) { payload.active = false; } diff --git a/superset-frontend/src/pages/AllEntities/index.tsx b/superset-frontend/src/pages/AllEntities/index.tsx index 2cb68d93ead..211b83b2674 100644 --- a/superset-frontend/src/pages/AllEntities/index.tsx +++ b/superset-frontend/src/pages/AllEntities/index.tsx @@ -155,7 +155,7 @@ function AllEntities() { setObjects(objects); setLoading(false); }, - (error: Response) => { + () => { addDangerToast('Error Fetching Tagged Objects'); setLoading(false); }, @@ -169,7 +169,7 @@ function AllEntities() { setTag(tag); setLoading(false); }, - (error: Response) => { + () => { addDangerToast(t('Error Fetching Tagged Objects')); setLoading(false); }, diff --git a/superset-frontend/src/pages/ChartList/ChartList.permissions.test.tsx b/superset-frontend/src/pages/ChartList/ChartList.permissions.test.tsx index 38db8180d20..4cb84d1b2ca 100644 --- a/superset-frontend/src/pages/ChartList/ChartList.permissions.test.tsx +++ b/superset-frontend/src/pages/ChartList/ChartList.permissions.test.tsx @@ -69,9 +69,9 @@ const createMockUser = (overrides = {}) => ({ const createMockStore = (initialState: any = {}) => configureStore({ reducer: { - user: (state = initialState.user || {}, action: any) => state, - common: (state = initialState.common || {}, action: any) => state, - charts: (state = initialState.charts || {}, action: any) => state, + user: (state = initialState.user || {}, _action: any) => state, + common: (state = initialState.common || {}, _action: any) => state, + charts: (state = initialState.charts || {}, _action: any) => state, }, preloadedState: initialState, middleware: getDefaultMiddleware => diff --git a/superset-frontend/src/pages/DashboardList/DashboardList.permissions.test.tsx b/superset-frontend/src/pages/DashboardList/DashboardList.permissions.test.tsx index 68d1229d97b..512722a2f8e 100644 --- a/superset-frontend/src/pages/DashboardList/DashboardList.permissions.test.tsx +++ b/superset-frontend/src/pages/DashboardList/DashboardList.permissions.test.tsx @@ -76,9 +76,10 @@ const createMockUser = (overrides = {}) => ({ const createMockStore = (initialState: any = {}) => configureStore({ reducer: { - user: (state = initialState.user || {}, action: any) => state, - common: (state = initialState.common || {}, action: any) => state, - dashboards: (state = initialState.dashboards || {}, action: any) => state, + user: (state = initialState.user || {}, _action: any) => state, + common: (state = initialState.common || {}, _action: any) => state, + dashboards: (state = initialState.dashboards || {}, _action: any) => + state, }, preloadedState: initialState, middleware: getDefaultMiddleware => diff --git a/superset-frontend/src/pages/GroupsList/index.tsx b/superset-frontend/src/pages/GroupsList/index.tsx index 5f56c46b7e3..2f1e1bc0e83 100644 --- a/superset-frontend/src/pages/GroupsList/index.tsx +++ b/superset-frontend/src/pages/GroupsList/index.tsx @@ -146,7 +146,7 @@ function GroupsList({ user }: GroupsListProps) { .then(() => { deletedGroupsNames.push(group.name); }) - .catch(err => { + .catch(() => { addDangerToast(t('Error deleting %s', group.name)); }), ), diff --git a/superset-frontend/src/pages/UsersList/index.tsx b/superset-frontend/src/pages/UsersList/index.tsx index c1bbd9c80b7..b2419641a33 100644 --- a/superset-frontend/src/pages/UsersList/index.tsx +++ b/superset-frontend/src/pages/UsersList/index.tsx @@ -168,7 +168,7 @@ function UsersList({ user }: UsersListProps) { .then(() => { deletedUserNames.push(user.username); }) - .catch(err => { + .catch(() => { addDangerToast(t('Error deleting %s', user.username)); }), ), diff --git a/superset-frontend/src/setup/setupCodeOverrides.ts b/superset-frontend/src/setup/setupCodeOverrides.ts index 6c4ea9ab723..e4a269899d8 100644 --- a/superset-frontend/src/setup/setupCodeOverrides.ts +++ b/superset-frontend/src/setup/setupCodeOverrides.ts @@ -31,4 +31,6 @@ interface CodeOverrideOptions { * Hook for individual deployments to add custom overrides * @param options - Configuration options for the setup process */ -export default function setupCodeOverrides(options: CodeOverrideOptions = {}) {} +export default function setupCodeOverrides( + _options: CodeOverrideOptions = {}, +) {} diff --git a/superset-frontend/src/theme/ThemeController.ts b/superset-frontend/src/theme/ThemeController.ts index 08d613fb3fe..2405c2512b5 100644 --- a/superset-frontend/src/theme/ThemeController.ts +++ b/superset-frontend/src/theme/ThemeController.ts @@ -346,7 +346,7 @@ export class ThemeController { * @throws {Error} If the user does not have permission to update the theme mode */ public setThemeMode(mode: ThemeMode): void { - this.validateModeUpdatePermission(mode); + this.validateModeUpdatePermission(); if ( this.currentMode === mode && @@ -530,7 +530,7 @@ export class ThemeController { let newMode: ThemeMode; try { - this.validateModeUpdatePermission(this.currentMode); + this.validateModeUpdatePermission(); const hasRequiredTheme = this.isValidThemeMode(this.currentMode); newMode = hasRequiredTheme ? this.currentMode @@ -838,10 +838,9 @@ export class ThemeController { /** * Validates permission to update mode. - * @param newMode - The new mode to validate * @throws {Error} If the user does not have permission to update the theme mode */ - private validateModeUpdatePermission(newMode: ThemeMode): void { + private validateModeUpdatePermission(): void { // Check if user can set a new theme mode (dark theme must exist) if (!this.canSetMode()) throw new Error(