diff --git a/eslint-suppressions.json b/eslint-suppressions.json index e17566e3b87..237e55d979c 100644 --- a/eslint-suppressions.json +++ b/eslint-suppressions.json @@ -470,6 +470,11 @@ "count": 1 } }, + "packages/grafana-runtime/src/components/DataSourcePicker.tsx": { + "react-prefer-function-component/react-prefer-function-component": { + "count": 1 + } + }, "packages/grafana-runtime/src/config.ts": { "@typescript-eslint/consistent-type-assertions": { "count": 5 @@ -539,6 +544,11 @@ "count": 2 } }, + "packages/grafana-sql/src/components/ErrorBoundary.tsx": { + "react-prefer-function-component/react-prefer-function-component": { + "count": 1 + } + }, "packages/grafana-sql/src/components/configuration/ConnectionLimits.tsx": { "no-restricted-syntax": { "count": 2 @@ -564,9 +574,37 @@ "count": 1 } }, + "packages/grafana-ui/src/components/BarGauge/BarGauge.tsx": { + "react-prefer-function-component/react-prefer-function-component": { + "count": 1 + } + }, + "packages/grafana-ui/src/components/BigValue/BigValue.tsx": { + "react-prefer-function-component/react-prefer-function-component": { + "count": 1 + } + }, + "packages/grafana-ui/src/components/BigValue/BigValueLayout.tsx": { + "react-prefer-function-component/react-prefer-function-component": { + "count": 1 + } + }, + "packages/grafana-ui/src/components/Cascader/Cascader.tsx": { + "react-prefer-function-component/react-prefer-function-component": { + "count": 1 + } + }, "packages/grafana-ui/src/components/ColorPicker/ColorPicker.tsx": { "@typescript-eslint/no-explicit-any": { "count": 2 + }, + "react-prefer-function-component/react-prefer-function-component": { + "count": 1 + } + }, + "packages/grafana-ui/src/components/ColorPicker/ColorPickerPopover.tsx": { + "react-prefer-function-component/react-prefer-function-component": { + "count": 1 } }, "packages/grafana-ui/src/components/Combobox/Combobox.story.tsx": { @@ -613,6 +651,9 @@ }, "no-restricted-syntax": { "count": 3 + }, + "react-prefer-function-component/react-prefer-function-component": { + "count": 1 } }, "packages/grafana-ui/src/components/DataSourceSettings/SecureSocksProxySettings.tsx": { @@ -635,6 +676,11 @@ "count": 3 } }, + "packages/grafana-ui/src/components/ErrorBoundary/ErrorBoundary.tsx": { + "react-prefer-function-component/react-prefer-function-component": { + "count": 1 + } + }, "packages/grafana-ui/src/components/FileDropzone/FileDropzone.story.tsx": { "no-restricted-syntax": { "count": 1 @@ -674,6 +720,9 @@ }, "no-restricted-syntax": { "count": 1 + }, + "react-prefer-function-component/react-prefer-function-component": { + "count": 1 } }, "packages/grafana-ui/src/components/Forms/Legacy/Select/NoOptionsMessage.tsx": { @@ -687,6 +736,9 @@ }, "no-restricted-syntax": { "count": 6 + }, + "react-prefer-function-component/react-prefer-function-component": { + "count": 3 } }, "packages/grafana-ui/src/components/Forms/Legacy/Select/SelectOption.tsx": { @@ -700,11 +752,22 @@ "packages/grafana-ui/src/components/Forms/Legacy/Select/SelectOptionGroup.tsx": { "@typescript-eslint/no-explicit-any": { "count": 3 + }, + "react-prefer-function-component/react-prefer-function-component": { + "count": 1 } }, "packages/grafana-ui/src/components/Forms/Legacy/Switch/Switch.tsx": { "no-restricted-syntax": { "count": 3 + }, + "react-prefer-function-component/react-prefer-function-component": { + "count": 1 + } + }, + "packages/grafana-ui/src/components/Gauge/Gauge.tsx": { + "react-prefer-function-component/react-prefer-function-component": { + "count": 1 } }, "packages/grafana-ui/src/components/Icon/Icon.story.tsx": { @@ -717,6 +780,11 @@ "count": 3 } }, + "packages/grafana-ui/src/components/JSONFormatter/JSONFormatter.tsx": { + "react-prefer-function-component/react-prefer-function-component": { + "count": 1 + } + }, "packages/grafana-ui/src/components/JSONFormatter/json_explorer/json_explorer.ts": { "@typescript-eslint/no-explicit-any": { "count": 2 @@ -727,6 +795,21 @@ "count": 1 } }, + "packages/grafana-ui/src/components/List/AbstractList.tsx": { + "react-prefer-function-component/react-prefer-function-component": { + "count": 1 + } + }, + "packages/grafana-ui/src/components/List/InlineList.tsx": { + "react-prefer-function-component/react-prefer-function-component": { + "count": 1 + } + }, + "packages/grafana-ui/src/components/List/List.tsx": { + "react-prefer-function-component/react-prefer-function-component": { + "count": 1 + } + }, "packages/grafana-ui/src/components/MatchersUI/FieldValueMatcher.tsx": { "@typescript-eslint/consistent-type-assertions": { "count": 1 @@ -750,6 +833,14 @@ "packages/grafana-ui/src/components/Modal/ModalsContext.tsx": { "@typescript-eslint/no-explicit-any": { "count": 4 + }, + "react-prefer-function-component/react-prefer-function-component": { + "count": 1 + } + }, + "packages/grafana-ui/src/components/Monaco/CodeEditor.tsx": { + "react-prefer-function-component/react-prefer-function-component": { + "count": 1 } }, "packages/grafana-ui/src/components/PageLayout/PageToolbar.story.tsx": { @@ -777,6 +868,16 @@ "count": 1 } }, + "packages/grafana-ui/src/components/QueryField/QueryField.tsx": { + "react-prefer-function-component/react-prefer-function-component": { + "count": 1 + } + }, + "packages/grafana-ui/src/components/RefreshPicker/RefreshPicker.tsx": { + "react-prefer-function-component/react-prefer-function-component": { + "count": 1 + } + }, "packages/grafana-ui/src/components/SecretFormField/SecretFormField.tsx": { "no-restricted-syntax": { "count": 2 @@ -815,6 +916,11 @@ "count": 4 } }, + "packages/grafana-ui/src/components/Select/ValueContainer.tsx": { + "react-prefer-function-component/react-prefer-function-component": { + "count": 1 + } + }, "packages/grafana-ui/src/components/Select/resetSelectStyles.ts": { "@typescript-eslint/no-explicit-any": { "count": 4 @@ -825,6 +931,11 @@ "count": 6 } }, + "packages/grafana-ui/src/components/SetInterval/SetInterval.tsx": { + "react-prefer-function-component/react-prefer-function-component": { + "count": 1 + } + }, "packages/grafana-ui/src/components/SingleStatShared/SingleStatBaseOptions.ts": { "@typescript-eslint/consistent-type-assertions": { "count": 3 @@ -833,6 +944,21 @@ "count": 13 } }, + "packages/grafana-ui/src/components/Sparkline/Sparkline.tsx": { + "react-prefer-function-component/react-prefer-function-component": { + "count": 1 + } + }, + "packages/grafana-ui/src/components/StatsPicker/StatsPicker.story.tsx": { + "react-prefer-function-component/react-prefer-function-component": { + "count": 1 + } + }, + "packages/grafana-ui/src/components/StatsPicker/StatsPicker.tsx": { + "react-prefer-function-component/react-prefer-function-component": { + "count": 1 + } + }, "packages/grafana-ui/src/components/Table/Cells/TableCell.tsx": { "@typescript-eslint/consistent-type-assertions": { "count": 3 @@ -913,11 +1039,31 @@ "count": 1 } }, + "packages/grafana-ui/src/components/TableInputCSV/TableInputCSV.tsx": { + "react-prefer-function-component/react-prefer-function-component": { + "count": 1 + } + }, "packages/grafana-ui/src/components/Tags/Tag.tsx": { "@typescript-eslint/consistent-type-assertions": { "count": 1 } }, + "packages/grafana-ui/src/components/Tooltip/PopoverController.tsx": { + "react-prefer-function-component/react-prefer-function-component": { + "count": 1 + } + }, + "packages/grafana-ui/src/components/Typeahead/Typeahead.tsx": { + "react-prefer-function-component/react-prefer-function-component": { + "count": 2 + } + }, + "packages/grafana-ui/src/components/UnitPicker/UnitPicker.tsx": { + "react-prefer-function-component/react-prefer-function-component": { + "count": 1 + } + }, "packages/grafana-ui/src/components/ValuePicker/ValuePicker.tsx": { "@grafana/no-aria-label-selectors": { "count": 1 @@ -936,6 +1082,9 @@ "packages/grafana-ui/src/components/VizRepeater/VizRepeater.tsx": { "@typescript-eslint/consistent-type-assertions": { "count": 2 + }, + "react-prefer-function-component/react-prefer-function-component": { + "count": 1 } }, "packages/grafana-ui/src/components/VizTooltip/VizTooltip.tsx": { @@ -951,6 +1100,9 @@ "packages/grafana-ui/src/components/uPlot/Plot.tsx": { "@typescript-eslint/consistent-type-assertions": { "count": 2 + }, + "react-prefer-function-component/react-prefer-function-component": { + "count": 1 } }, "packages/grafana-ui/src/components/uPlot/config/UPlotAxisBuilder.ts": { @@ -1062,6 +1214,11 @@ "count": 1 } }, + "public/app/AppWrapper.tsx": { + "react-prefer-function-component/react-prefer-function-component": { + "count": 1 + } + }, "public/app/core/TableModel.ts": { "@typescript-eslint/no-explicit-any": { "count": 2 @@ -1113,6 +1270,14 @@ }, "@typescript-eslint/no-explicit-any": { "count": 2 + }, + "react-prefer-function-component/react-prefer-function-component": { + "count": 1 + } + }, + "public/app/core/components/Login/LoginCtrl.tsx": { + "react-prefer-function-component/react-prefer-function-component": { + "count": 1 } }, "public/app/core/components/Login/LoginForm.tsx": { @@ -1138,6 +1303,9 @@ "public/app/core/components/OptionsUI/NumberInput.tsx": { "no-restricted-syntax": { "count": 1 + }, + "react-prefer-function-component/react-prefer-function-component": { + "count": 1 } }, "public/app/core/components/OptionsUI/fieldColor.tsx": { @@ -1145,6 +1313,21 @@ "count": 1 } }, + "public/app/core/components/OptionsUI/multiSelect.tsx": { + "react-prefer-function-component/react-prefer-function-component": { + "count": 1 + } + }, + "public/app/core/components/OptionsUI/select.tsx": { + "react-prefer-function-component/react-prefer-function-component": { + "count": 1 + } + }, + "public/app/core/components/OptionsUI/strings.tsx": { + "react-prefer-function-component/react-prefer-function-component": { + "count": 1 + } + }, "public/app/core/components/Page/EditableTitle.tsx": { "no-restricted-syntax": { "count": 1 @@ -1165,10 +1348,28 @@ "count": 1 } }, + "public/app/core/components/Select/ServiceAccountPicker.tsx": { + "react-prefer-function-component/react-prefer-function-component": { + "count": 1 + } + }, + "public/app/core/components/Select/TeamPicker.tsx": { + "react-prefer-function-component/react-prefer-function-component": { + "count": 1 + } + }, + "public/app/core/components/Select/UserPicker.tsx": { + "react-prefer-function-component/react-prefer-function-component": { + "count": 1 + } + }, "public/app/core/components/SharedPreferences/SharedPreferences.tsx": { "no-restricted-syntax": { "count": 8 }, + "react-prefer-function-component/react-prefer-function-component": { + "count": 1 + }, "react/no-unescaped-entities": { "count": 1 } @@ -1183,6 +1384,11 @@ "count": 1 } }, + "public/app/core/components/SplitPaneWrapper/SplitPaneWrapper.tsx": { + "react-prefer-function-component/react-prefer-function-component": { + "count": 1 + } + }, "public/app/core/components/TagFilter/TagFilter.tsx": { "@typescript-eslint/no-explicit-any": { "count": 1 @@ -1193,6 +1399,11 @@ "count": 1 } }, + "public/app/core/components/TimeSeries/TimeSeries.tsx": { + "react-prefer-function-component/react-prefer-function-component": { + "count": 1 + } + }, "public/app/core/components/TimeSeries/utils.ts": { "@typescript-eslint/consistent-type-assertions": { "count": 1 @@ -1201,6 +1412,11 @@ "count": 2 } }, + "public/app/core/components/TimelineChart/TimelineChart.tsx": { + "react-prefer-function-component/react-prefer-function-component": { + "count": 1 + } + }, "public/app/core/config.ts": { "no-barrel-files/no-barrel-files": { "count": 2 @@ -1347,11 +1563,27 @@ "public/app/features/admin/UserLdapSyncInfo.tsx": { "no-restricted-syntax": { "count": 3 + }, + "react-prefer-function-component/react-prefer-function-component": { + "count": 1 } }, "public/app/features/admin/UserOrgs.tsx": { "no-restricted-syntax": { "count": 2 + }, + "react-prefer-function-component/react-prefer-function-component": { + "count": 3 + } + }, + "public/app/features/admin/UserProfile.tsx": { + "react-prefer-function-component/react-prefer-function-component": { + "count": 1 + } + }, + "public/app/features/admin/UserSessions.tsx": { + "react-prefer-function-component/react-prefer-function-component": { + "count": 1 } }, "public/app/features/admin/ldap/LdapDrawer.tsx": { @@ -1616,6 +1848,9 @@ }, "no-restricted-syntax": { "count": 1 + }, + "react-prefer-function-component/react-prefer-function-component": { + "count": 1 } }, "public/app/features/alerting/unified/components/rule-editor/RuleInspector.tsx": { @@ -1813,6 +2048,16 @@ "count": 1 } }, + "public/app/features/annotations/components/AnnotationResultMapper.tsx": { + "react-prefer-function-component/react-prefer-function-component": { + "count": 1 + } + }, + "public/app/features/annotations/components/StandardAnnotationQueryEditor.tsx": { + "react-prefer-function-component/react-prefer-function-component": { + "count": 1 + } + }, "public/app/features/annotations/events_processing.ts": { "@typescript-eslint/no-explicit-any": { "count": 1 @@ -1856,6 +2101,36 @@ "count": 1 } }, + "public/app/features/canvas/elements/notFound.tsx": { + "react-prefer-function-component/react-prefer-function-component": { + "count": 1 + } + }, + "public/app/features/canvas/elements/rectangle.tsx": { + "react-prefer-function-component/react-prefer-function-component": { + "count": 1 + } + }, + "public/app/features/canvas/runtime/element.tsx": { + "react-prefer-function-component/react-prefer-function-component": { + "count": 1 + } + }, + "public/app/features/canvas/runtime/frame.tsx": { + "react-prefer-function-component/react-prefer-function-component": { + "count": 1 + } + }, + "public/app/features/canvas/runtime/root.tsx": { + "react-prefer-function-component/react-prefer-function-component": { + "count": 1 + } + }, + "public/app/features/canvas/runtime/scene.tsx": { + "react-prefer-function-component/react-prefer-function-component": { + "count": 1 + } + }, "public/app/features/commandPalette/actions/scopeActions.tsx": { "react-hooks/rules-of-hooks": { "count": 4 @@ -1960,6 +2235,21 @@ "count": 2 } }, + "public/app/features/dashboard-scene/conditional-rendering/conditions/ConditionalRenderingData.tsx": { + "react-prefer-function-component/react-prefer-function-component": { + "count": 1 + } + }, + "public/app/features/dashboard-scene/conditional-rendering/conditions/ConditionalRenderingTimeRangeSize.tsx": { + "react-prefer-function-component/react-prefer-function-component": { + "count": 1 + } + }, + "public/app/features/dashboard-scene/conditional-rendering/conditions/ConditionalRenderingVariable.tsx": { + "react-prefer-function-component/react-prefer-function-component": { + "count": 1 + } + }, "public/app/features/dashboard-scene/edit-pane/DashboardEditPaneRenderer.tsx": { "@typescript-eslint/consistent-type-assertions": { "count": 1 @@ -1970,6 +2260,11 @@ "count": 4 } }, + "public/app/features/dashboard-scene/edit-pane/DashboardEditableElement.tsx": { + "react-prefer-function-component/react-prefer-function-component": { + "count": 1 + } + }, "public/app/features/dashboard-scene/edit-pane/DashboardOutline.tsx": { "@typescript-eslint/consistent-type-assertions": { "count": 1 @@ -1985,11 +2280,31 @@ "count": 1 } }, + "public/app/features/dashboard-scene/inspect/InspectDataTab.tsx": { + "react-prefer-function-component/react-prefer-function-component": { + "count": 1 + } + }, "public/app/features/dashboard-scene/inspect/InspectJsonTab.tsx": { "no-restricted-syntax": { "count": 1 } }, + "public/app/features/dashboard-scene/inspect/InspectMetaDataTab.tsx": { + "react-prefer-function-component/react-prefer-function-component": { + "count": 1 + } + }, + "public/app/features/dashboard-scene/inspect/InspectQueryTab.tsx": { + "react-prefer-function-component/react-prefer-function-component": { + "count": 1 + } + }, + "public/app/features/dashboard-scene/inspect/InspectStatsTab.tsx": { + "react-prefer-function-component/react-prefer-function-component": { + "count": 1 + } + }, "public/app/features/dashboard-scene/pages/DashboardScenePage.tsx": { "@typescript-eslint/consistent-type-assertions": { "count": 2 @@ -2003,11 +2318,26 @@ "count": 1 } }, + "public/app/features/dashboard-scene/panel-edit/PanelDataPane/PanelDataAlertingTab.tsx": { + "react-prefer-function-component/react-prefer-function-component": { + "count": 1 + } + }, "public/app/features/dashboard-scene/panel-edit/PanelDataPane/PanelDataPane.tsx": { "@typescript-eslint/consistent-type-assertions": { "count": 1 } }, + "public/app/features/dashboard-scene/panel-edit/PanelDataPane/PanelDataQueriesTab.tsx": { + "react-prefer-function-component/react-prefer-function-component": { + "count": 1 + } + }, + "public/app/features/dashboard-scene/panel-edit/PanelDataPane/PanelDataTransformationsTab.tsx": { + "react-prefer-function-component/react-prefer-function-component": { + "count": 1 + } + }, "public/app/features/dashboard-scene/panel-edit/PanelOptionsPane.test.tsx": { "@typescript-eslint/no-explicit-any": { "count": 1 @@ -2036,6 +2366,21 @@ "count": 1 } }, + "public/app/features/dashboard-scene/scene/AddLibraryPanelDrawer.tsx": { + "react-prefer-function-component/react-prefer-function-component": { + "count": 1 + } + }, + "public/app/features/dashboard-scene/scene/CustomTimeRangeCompare.tsx": { + "react-prefer-function-component/react-prefer-function-component": { + "count": 1 + } + }, + "public/app/features/dashboard-scene/scene/DashboardDataLayerSet.tsx": { + "react-prefer-function-component/react-prefer-function-component": { + "count": 1 + } + }, "public/app/features/dashboard-scene/scene/PanelMenuBehavior.tsx": { "@typescript-eslint/consistent-type-assertions": { "count": 1 @@ -2046,6 +2391,11 @@ "count": 1 } }, + "public/app/features/dashboard-scene/scene/ViewPanelScene.tsx": { + "react-prefer-function-component/react-prefer-function-component": { + "count": 1 + } + }, "public/app/features/dashboard-scene/scene/export/exporters.test.ts": { "@typescript-eslint/no-explicit-any": { "count": 6 @@ -2105,6 +2455,11 @@ "count": 1 } }, + "public/app/features/dashboard-scene/serialization/custom-variables/SnapshotVariable.tsx": { + "react-prefer-function-component/react-prefer-function-component": { + "count": 1 + } + }, "public/app/features/dashboard-scene/serialization/transformSceneToSaveModel.test.ts": { "@typescript-eslint/no-explicit-any": { "count": 1 @@ -2286,6 +2641,11 @@ "count": 1 } }, + "public/app/features/dashboard/components/DashNav/DashNavTimeControls.tsx": { + "react-prefer-function-component/react-prefer-function-component": { + "count": 1 + } + }, "public/app/features/dashboard/components/DashNav/index.ts": { "no-barrel-files/no-barrel-files": { "count": 1 @@ -2309,6 +2669,11 @@ "count": 1 } }, + "public/app/features/dashboard/components/DashboardRow/DashboardRow.tsx": { + "react-prefer-function-component/react-prefer-function-component": { + "count": 1 + } + }, "public/app/features/dashboard/components/DashboardRow/index.ts": { "no-barrel-files/no-barrel-files": { "count": 1 @@ -2327,6 +2692,14 @@ "public/app/features/dashboard/components/DashboardSettings/TimePickerSettings.tsx": { "no-restricted-syntax": { "count": 5 + }, + "react-prefer-function-component/react-prefer-function-component": { + "count": 1 + } + }, + "public/app/features/dashboard/components/DashboardSettings/VersionsSettings.tsx": { + "react-prefer-function-component/react-prefer-function-component": { + "count": 1 } }, "public/app/features/dashboard/components/DashboardSettings/index.ts": { @@ -2349,6 +2722,11 @@ "count": 1 } }, + "public/app/features/dashboard/components/PanelEditor/OptionsPaneCategoryDescriptor.tsx": { + "react-prefer-function-component/react-prefer-function-component": { + "count": 1 + } + }, "public/app/features/dashboard/components/PanelEditor/OptionsPaneItemDescriptor.tsx": { "@grafana/no-aria-label-selectors": { "count": 1 @@ -2358,11 +2736,32 @@ }, "no-restricted-syntax": { "count": 1 + }, + "react-prefer-function-component/react-prefer-function-component": { + "count": 1 + } + }, + "public/app/features/dashboard/components/PanelEditor/OptionsPaneOptions.test.tsx": { + "react-prefer-function-component/react-prefer-function-component": { + "count": 1 } }, "public/app/features/dashboard/components/PanelEditor/PanelEditor.tsx": { "@typescript-eslint/consistent-type-assertions": { "count": 1 + }, + "react-prefer-function-component/react-prefer-function-component": { + "count": 1 + } + }, + "public/app/features/dashboard/components/PanelEditor/PanelEditorQueries.tsx": { + "react-prefer-function-component/react-prefer-function-component": { + "count": 1 + } + }, + "public/app/features/dashboard/components/PanelEditor/PanelHeaderCorner.tsx": { + "react-prefer-function-component/react-prefer-function-component": { + "count": 1 } }, "public/app/features/dashboard/components/PanelEditor/VisualizationSelectPane.tsx": { @@ -2422,11 +2821,22 @@ }, "no-restricted-syntax": { "count": 1 + }, + "react-prefer-function-component/react-prefer-function-component": { + "count": 1 } }, "public/app/features/dashboard/components/ShareModal/ShareLink.tsx": { "no-restricted-syntax": { "count": 3 + }, + "react-prefer-function-component/react-prefer-function-component": { + "count": 1 + } + }, + "public/app/features/dashboard/components/ShareModal/ShareModal.tsx": { + "react-prefer-function-component/react-prefer-function-component": { + "count": 1 } }, "public/app/features/dashboard/components/ShareModal/SharePublicDashboard/ConfigPublicDashboard/ConfigPublicDashboard.tsx": { @@ -2442,6 +2852,9 @@ "public/app/features/dashboard/components/ShareModal/ShareSnapshot.tsx": { "no-restricted-syntax": { "count": 4 + }, + "react-prefer-function-component/react-prefer-function-component": { + "count": 1 } }, "public/app/features/dashboard/components/ShareModal/ThemePicker.tsx": { @@ -2462,6 +2875,11 @@ "count": 1 } }, + "public/app/features/dashboard/components/SubMenu/SubMenu.tsx": { + "react-prefer-function-component/react-prefer-function-component": { + "count": 1 + } + }, "public/app/features/dashboard/components/SubMenu/SubMenuItems.tsx": { "no-restricted-syntax": { "count": 1 @@ -2480,6 +2898,9 @@ "public/app/features/dashboard/components/TransformationsEditor/TransformationsEditor.tsx": { "@typescript-eslint/consistent-type-assertions": { "count": 2 + }, + "react-prefer-function-component/react-prefer-function-component": { + "count": 1 } }, "public/app/features/dashboard/components/VersionHistory/useDashboardRestore.tsx": { @@ -2490,6 +2911,11 @@ "count": 1 } }, + "public/app/features/dashboard/containers/DashboardPage.test.tsx": { + "react-prefer-function-component/react-prefer-function-component": { + "count": 1 + } + }, "public/app/features/dashboard/containers/DashboardPage.tsx": { "@grafana/no-aria-label-selectors": { "count": 1 @@ -2499,6 +2925,9 @@ }, "@typescript-eslint/no-explicit-any": { "count": 2 + }, + "react-prefer-function-component/react-prefer-function-component": { + "count": 1 } }, "public/app/features/dashboard/containers/DashboardPageProxy.tsx": { @@ -2511,6 +2940,26 @@ "count": 1 } }, + "public/app/features/dashboard/containers/SoloPanelPage.test.tsx": { + "react-prefer-function-component/react-prefer-function-component": { + "count": 1 + } + }, + "public/app/features/dashboard/dashgrid/DashboardGrid.tsx": { + "react-prefer-function-component/react-prefer-function-component": { + "count": 1 + } + }, + "public/app/features/dashboard/dashgrid/DashboardPanel.tsx": { + "react-prefer-function-component/react-prefer-function-component": { + "count": 1 + } + }, + "public/app/features/dashboard/dashgrid/PanelStateWrapper.tsx": { + "react-prefer-function-component/react-prefer-function-component": { + "count": 1 + } + }, "public/app/features/dashboard/dashgrid/SeriesVisibilityConfigFactory.ts": { "@typescript-eslint/consistent-type-assertions": { "count": 1 @@ -2621,6 +3070,11 @@ "count": 1 } }, + "public/app/features/datasources/components/DataSourcePluginSettings.tsx": { + "react-prefer-function-component/react-prefer-function-component": { + "count": 1 + } + }, "public/app/features/datasources/components/DataSourcePluginState.tsx": { "no-restricted-syntax": { "count": 3 @@ -2709,6 +3163,14 @@ "public/app/features/dimensions/editors/ThresholdsEditor/ThresholdsEditor.tsx": { "@typescript-eslint/consistent-type-assertions": { "count": 1 + }, + "react-prefer-function-component/react-prefer-function-component": { + "count": 1 + } + }, + "public/app/features/dimensions/editors/ThresholdsEditor/thresholds.tsx": { + "react-prefer-function-component/react-prefer-function-component": { + "count": 1 } }, "public/app/features/dimensions/editors/URLPickerTab.tsx": { @@ -2741,21 +3203,66 @@ "count": 4 } }, + "public/app/features/explore/Explore.tsx": { + "react-prefer-function-component/react-prefer-function-component": { + "count": 1 + } + }, + "public/app/features/explore/ExploreTimeControls.tsx": { + "react-prefer-function-component/react-prefer-function-component": { + "count": 1 + } + }, + "public/app/features/explore/Logs/LiveLogs.tsx": { + "react-prefer-function-component/react-prefer-function-component": { + "count": 1 + } + }, "public/app/features/explore/Logs/LogsColumnSearch.tsx": { "no-restricted-syntax": { "count": 1 } }, + "public/app/features/explore/Logs/LogsContainer.tsx": { + "react-prefer-function-component/react-prefer-function-component": { + "count": 1 + } + }, + "public/app/features/explore/RawPrometheus/RawPrometheusContainer.tsx": { + "react-prefer-function-component/react-prefer-function-component": { + "count": 1 + } + }, "public/app/features/explore/RichHistory/RichHistorySettingsTab.tsx": { "no-restricted-syntax": { "count": 1 } }, + "public/app/features/explore/Table/TableContainer.tsx": { + "react-prefer-function-component/react-prefer-function-component": { + "count": 1 + } + }, "public/app/features/explore/TraceView/TraceView.tsx": { "@typescript-eslint/consistent-type-assertions": { "count": 2 } }, + "public/app/features/explore/TraceView/components/TracePageHeader/SpanGraph/CanvasSpanGraph.tsx": { + "react-prefer-function-component/react-prefer-function-component": { + "count": 1 + } + }, + "public/app/features/explore/TraceView/components/TracePageHeader/SpanGraph/ViewingLayer.tsx": { + "react-prefer-function-component/react-prefer-function-component": { + "count": 1 + } + }, + "public/app/features/explore/TraceView/components/TracePageHeader/SpanGraph/index.tsx": { + "react-prefer-function-component/react-prefer-function-component": { + "count": 1 + } + }, "public/app/features/explore/TraceView/components/TracePageHeader/TracePageHeader.tsx": { "react-hooks/rules-of-hooks": { "count": 1 @@ -2766,26 +3273,71 @@ "count": 1 } }, + "public/app/features/explore/TraceView/components/TraceTimelineViewer/ListView/index.tsx": { + "react-prefer-function-component/react-prefer-function-component": { + "count": 1 + } + }, + "public/app/features/explore/TraceView/components/TraceTimelineViewer/SpanBarRow.tsx": { + "react-prefer-function-component/react-prefer-function-component": { + "count": 1 + } + }, "public/app/features/explore/TraceView/components/TraceTimelineViewer/SpanDetail/SpanDetailLinkButtons.tsx": { "react-hooks/rules-of-hooks": { "count": 1 } }, + "public/app/features/explore/TraceView/components/TraceTimelineViewer/SpanDetailRow.tsx": { + "react-prefer-function-component/react-prefer-function-component": { + "count": 1 + } + }, "public/app/features/explore/TraceView/components/TraceTimelineViewer/SpanLinks.tsx": { "no-restricted-syntax": { "count": 1 } }, + "public/app/features/explore/TraceView/components/TraceTimelineViewer/SpanTreeOffset.tsx": { + "react-prefer-function-component/react-prefer-function-component": { + "count": 1 + } + }, + "public/app/features/explore/TraceView/components/TraceTimelineViewer/TimelineHeaderRow/TimelineColumnResizer.tsx": { + "react-prefer-function-component/react-prefer-function-component": { + "count": 1 + } + }, + "public/app/features/explore/TraceView/components/TraceTimelineViewer/TimelineHeaderRow/TimelineViewingLayer.tsx": { + "react-prefer-function-component/react-prefer-function-component": { + "count": 1 + } + }, "public/app/features/explore/TraceView/components/TraceTimelineViewer/TimelineHeaderRow/index.tsx": { "no-barrel-files/no-barrel-files": { "count": 1 } }, + "public/app/features/explore/TraceView/components/TraceTimelineViewer/VirtualizedTraceView.tsx": { + "react-prefer-function-component/react-prefer-function-component": { + "count": 1 + } + }, + "public/app/features/explore/TraceView/components/TraceTimelineViewer/index.tsx": { + "react-prefer-function-component/react-prefer-function-component": { + "count": 1 + } + }, "public/app/features/explore/TraceView/components/TraceTimelineViewer/utils.tsx": { "no-barrel-files/no-barrel-files": { "count": 1 } }, + "public/app/features/explore/TraceView/components/common/SearchBarInput.tsx": { + "react-prefer-function-component/react-prefer-function-component": { + "count": 1 + } + }, "public/app/features/explore/TraceView/components/demo/trace-generators.ts": { "@typescript-eslint/consistent-type-assertions": { "count": 1 @@ -2809,6 +3361,21 @@ "count": 1 } }, + "public/app/features/explore/TraceView/components/utils/DraggableManager/demo/DividerDemo.tsx": { + "react-prefer-function-component/react-prefer-function-component": { + "count": 1 + } + }, + "public/app/features/explore/TraceView/components/utils/DraggableManager/demo/DraggableManagerDemo.tsx": { + "react-prefer-function-component/react-prefer-function-component": { + "count": 1 + } + }, + "public/app/features/explore/TraceView/components/utils/DraggableManager/demo/RegionDemo.tsx": { + "react-prefer-function-component/react-prefer-function-component": { + "count": 1 + } + }, "public/app/features/explore/TraceView/components/utils/DraggableManager/demo/index.tsx": { "no-barrel-files/no-barrel-files": { "count": 1 @@ -2886,6 +3453,9 @@ "public/app/features/inspector/InspectDataTab.tsx": { "@grafana/no-aria-label-selectors": { "count": 1 + }, + "react-prefer-function-component/react-prefer-function-component": { + "count": 1 } }, "public/app/features/inspector/InspectJSONTab.tsx": { @@ -2904,6 +3474,19 @@ }, "@typescript-eslint/no-explicit-any": { "count": 1 + }, + "react-prefer-function-component/react-prefer-function-component": { + "count": 1 + } + }, + "public/app/features/invites/InviteeRow.tsx": { + "react-prefer-function-component/react-prefer-function-component": { + "count": 1 + } + }, + "public/app/features/invites/InviteesTable.tsx": { + "react-prefer-function-component/react-prefer-function-component": { + "count": 1 } }, "public/app/features/invites/SignupInvited.tsx": { @@ -2916,6 +3499,11 @@ "count": 2 } }, + "public/app/features/live/LiveConnectionWarning.tsx": { + "react-prefer-function-component/react-prefer-function-component": { + "count": 1 + } + }, "public/app/features/live/centrifuge/LiveDataStream.ts": { "@typescript-eslint/consistent-type-assertions": { "count": 1 @@ -2926,6 +3514,21 @@ "count": 1 } }, + "public/app/features/logs/components/LogDetails.tsx": { + "react-prefer-function-component/react-prefer-function-component": { + "count": 1 + } + }, + "public/app/features/logs/components/LogDetailsRow.tsx": { + "react-prefer-function-component/react-prefer-function-component": { + "count": 1 + } + }, + "public/app/features/logs/components/LogMessageAnsi.tsx": { + "react-prefer-function-component/react-prefer-function-component": { + "count": 1 + } + }, "public/app/features/logs/logsFrame.ts": { "@typescript-eslint/consistent-type-assertions": { "count": 1 @@ -2942,6 +3545,9 @@ "public/app/features/manage-dashboards/DashboardImportPage.tsx": { "no-restricted-syntax": { "count": 2 + }, + "react-prefer-function-component/react-prefer-function-component": { + "count": 1 } }, "public/app/features/manage-dashboards/components/ImportDashboardForm.tsx": { @@ -2957,6 +3563,11 @@ "count": 1 } }, + "public/app/features/manage-dashboards/components/ImportDashboardOverview.tsx": { + "react-prefer-function-component/react-prefer-function-component": { + "count": 1 + } + }, "public/app/features/manage-dashboards/components/PublicDashboardListTable/PublicDashboardListTable.tsx": { "no-restricted-syntax": { "count": 1 @@ -3013,6 +3624,11 @@ "count": 1 } }, + "public/app/features/org/OrgDetailsPage.tsx": { + "react-prefer-function-component/react-prefer-function-component": { + "count": 1 + } + }, "public/app/features/org/OrgProfile.tsx": { "no-restricted-syntax": { "count": 1 @@ -3028,6 +3644,11 @@ "count": 1 } }, + "public/app/features/panel/components/PanelPluginError.tsx": { + "react-prefer-function-component/react-prefer-function-component": { + "count": 3 + } + }, "public/app/features/panel/components/VizTypePicker/PanelTypeCard.tsx": { "@grafana/no-aria-label-selectors": { "count": 1 @@ -3076,6 +3697,11 @@ "count": 1 } }, + "public/app/features/plugins/admin/components/PluginDashboards.tsx": { + "react-prefer-function-component/react-prefer-function-component": { + "count": 1 + } + }, "public/app/features/plugins/admin/components/PluginDetailsPage.tsx": { "@typescript-eslint/consistent-type-assertions": { "count": 1 @@ -3104,6 +3730,11 @@ "count": 1 } }, + "public/app/features/plugins/components/AppRootPage.test.tsx": { + "react-prefer-function-component/react-prefer-function-component": { + "count": 1 + } + }, "public/app/features/plugins/datasource_srv.test.ts": { "@typescript-eslint/no-explicit-any": { "count": 3 @@ -3147,11 +3778,26 @@ "count": 3 } }, + "public/app/features/profile/UserOrganizations.tsx": { + "react-prefer-function-component/react-prefer-function-component": { + "count": 1 + } + }, "public/app/features/profile/UserProfileEditForm.tsx": { "no-restricted-syntax": { "count": 3 } }, + "public/app/features/profile/UserSessions.tsx": { + "react-prefer-function-component/react-prefer-function-component": { + "count": 1 + } + }, + "public/app/features/profile/UserTeams.tsx": { + "react-prefer-function-component/react-prefer-function-component": { + "count": 1 + } + }, "public/app/features/provisioning/Config/ConfigFormGithubCollapse.tsx": { "no-restricted-syntax": { "count": 2 @@ -3189,6 +3835,9 @@ }, "react-hooks/rules-of-hooks": { "count": 1 + }, + "react-prefer-function-component/react-prefer-function-component": { + "count": 1 } }, "public/app/features/query/components/QueryEditorRowHeader.tsx": { @@ -3196,9 +3845,17 @@ "count": 1 } }, + "public/app/features/query/components/QueryEditorRows.tsx": { + "react-prefer-function-component/react-prefer-function-component": { + "count": 1 + } + }, "public/app/features/query/components/QueryGroup.tsx": { "@grafana/no-aria-label-selectors": { "count": 2 + }, + "react-prefer-function-component/react-prefer-function-component": { + "count": 1 } }, "public/app/features/query/state/DashboardQueryRunner/AnnotationsQueryRunner.ts": { @@ -3287,6 +3944,11 @@ "count": 2 } }, + "public/app/features/teams/TeamGroupSync.tsx": { + "react-prefer-function-component/react-prefer-function-component": { + "count": 1 + } + }, "public/app/features/teams/TeamSettings.tsx": { "no-restricted-syntax": { "count": 4 @@ -3360,11 +4022,21 @@ "count": 1 } }, + "public/app/features/transformers/editors/ConcatenateTransformerEditor.tsx": { + "react-prefer-function-component/react-prefer-function-component": { + "count": 1 + } + }, "public/app/features/transformers/editors/ConvertFieldTypeTransformerEditor.tsx": { "@typescript-eslint/consistent-type-assertions": { "count": 1 } }, + "public/app/features/transformers/editors/FilterByNameTransformerEditor.tsx": { + "react-prefer-function-component/react-prefer-function-component": { + "count": 1 + } + }, "public/app/features/transformers/editors/GroupToNestedTableTransformerEditor.tsx": { "no-restricted-syntax": { "count": 1 @@ -3375,6 +4047,11 @@ "count": 1 } }, + "public/app/features/transformers/editors/RenameByRegexTransformer.tsx": { + "react-prefer-function-component/react-prefer-function-component": { + "count": 1 + } + }, "public/app/features/transformers/editors/SortByTransformerEditor.tsx": { "@typescript-eslint/consistent-type-assertions": { "count": 1 @@ -3429,9 +4106,17 @@ "count": 3 } }, + "public/app/features/variables/adhoc/AdHocVariableEditor.tsx": { + "react-prefer-function-component/react-prefer-function-component": { + "count": 1 + } + }, "public/app/features/variables/adhoc/picker/AdHocFilter.tsx": { "no-restricted-syntax": { "count": 1 + }, + "react-prefer-function-component/react-prefer-function-component": { + "count": 1 } }, "public/app/features/variables/adhoc/picker/AdHocFilterKey.tsx": { @@ -3449,24 +4134,52 @@ "count": 1 } }, + "public/app/features/variables/adhoc/picker/AdHocPicker.tsx": { + "react-prefer-function-component/react-prefer-function-component": { + "count": 1 + } + }, "public/app/features/variables/adhoc/picker/ConditionSegment.tsx": { "no-restricted-syntax": { "count": 2 } }, + "public/app/features/variables/constant/ConstantVariableEditor.tsx": { + "react-prefer-function-component/react-prefer-function-component": { + "count": 1 + } + }, "public/app/features/variables/constant/reducer.ts": { "@typescript-eslint/consistent-type-assertions": { "count": 1 } }, + "public/app/features/variables/custom/CustomVariableEditor.tsx": { + "react-prefer-function-component/react-prefer-function-component": { + "count": 1 + } + }, "public/app/features/variables/custom/reducer.ts": { "@typescript-eslint/consistent-type-assertions": { "count": 1 } }, + "public/app/features/variables/datasource/DataSourceVariableEditor.tsx": { + "react-prefer-function-component/react-prefer-function-component": { + "count": 1 + } + }, "public/app/features/variables/editor/VariableEditorContainer.tsx": { "@typescript-eslint/consistent-type-assertions": { "count": 2 + }, + "react-prefer-function-component/react-prefer-function-component": { + "count": 1 + } + }, + "public/app/features/variables/editor/VariableEditorEditor.tsx": { + "react-prefer-function-component/react-prefer-function-component": { + "count": 1 } }, "public/app/features/variables/editor/VariableEditorList.tsx": { @@ -3497,6 +4210,11 @@ "count": 4 } }, + "public/app/features/variables/pickers/OptionsPicker/OptionsPicker.tsx": { + "react-prefer-function-component/react-prefer-function-component": { + "count": 1 + } + }, "public/app/features/variables/pickers/OptionsPicker/actions.ts": { "@typescript-eslint/no-explicit-any": { "count": 2 @@ -3518,16 +4236,25 @@ "public/app/features/variables/pickers/shared/VariableInput.tsx": { "no-restricted-syntax": { "count": 1 + }, + "react-prefer-function-component/react-prefer-function-component": { + "count": 1 } }, "public/app/features/variables/pickers/shared/VariableOptions.tsx": { "@grafana/no-aria-label-selectors": { "count": 1 + }, + "react-prefer-function-component/react-prefer-function-component": { + "count": 1 } }, "public/app/features/variables/query/QueryVariableEditor.tsx": { "@typescript-eslint/no-explicit-any": { "count": 2 + }, + "react-prefer-function-component/react-prefer-function-component": { + "count": 1 } }, "public/app/features/variables/query/QueryVariableRefreshSelect.tsx": { @@ -3658,6 +4385,11 @@ "count": 1 } }, + "public/app/plugins/datasource/azuremonitor/components/ConfigEditor/ConfigEditor.tsx": { + "react-prefer-function-component/react-prefer-function-component": { + "count": 1 + } + }, "public/app/plugins/datasource/azuremonitor/components/ConfigEditor/CurrentUserFallbackCredentials.tsx": { "no-restricted-syntax": { "count": 2 @@ -3751,6 +4483,16 @@ "count": 1 } }, + "public/app/plugins/datasource/cloud-monitoring/components/CloudMonitoringCheatSheet.tsx": { + "react-prefer-function-component/react-prefer-function-component": { + "count": 1 + } + }, + "public/app/plugins/datasource/cloud-monitoring/components/ConfigEditor/ConfigEditor.tsx": { + "react-prefer-function-component/react-prefer-function-component": { + "count": 1 + } + }, "public/app/plugins/datasource/cloud-monitoring/components/Fields.tsx": { "no-restricted-syntax": { "count": 1 @@ -3759,6 +4501,9 @@ "public/app/plugins/datasource/cloud-monitoring/components/VariableQueryEditor.tsx": { "@typescript-eslint/consistent-type-assertions": { "count": 1 + }, + "react-prefer-function-component/react-prefer-function-component": { + "count": 1 } }, "public/app/plugins/datasource/cloud-monitoring/datasource.ts": { @@ -3945,6 +4690,11 @@ "count": 1 } }, + "public/app/plugins/datasource/grafana-testdata-datasource/ConfigEditor.tsx": { + "react-prefer-function-component/react-prefer-function-component": { + "count": 1 + } + }, "public/app/plugins/datasource/grafana-testdata-datasource/QueryEditor.tsx": { "@typescript-eslint/consistent-type-assertions": { "count": 3 @@ -3956,6 +4706,16 @@ "count": 1 } }, + "public/app/plugins/datasource/grafana-testdata-datasource/TestInfoTab.tsx": { + "react-prefer-function-component/react-prefer-function-component": { + "count": 1 + } + }, + "public/app/plugins/datasource/grafana-testdata-datasource/components/CSVWaveEditor.tsx": { + "react-prefer-function-component/react-prefer-function-component": { + "count": 1 + } + }, "public/app/plugins/datasource/grafana-testdata-datasource/components/RandomWalkEditor.tsx": { "@typescript-eslint/consistent-type-assertions": { "count": 2 @@ -3990,6 +4750,9 @@ "public/app/plugins/datasource/grafana/components/QueryEditor.tsx": { "@typescript-eslint/consistent-type-assertions": { "count": 2 + }, + "react-prefer-function-component/react-prefer-function-component": { + "count": 1 } }, "public/app/plugins/datasource/grafana/components/TimeRegionEditor.tsx": { @@ -4005,9 +4768,17 @@ "count": 1 } }, + "public/app/plugins/datasource/graphite/components/MetricTankMetaInspector.tsx": { + "react-prefer-function-component/react-prefer-function-component": { + "count": 1 + } + }, "public/app/plugins/datasource/graphite/configuration/ConfigEditor.tsx": { "no-restricted-syntax": { "count": 3 + }, + "react-prefer-function-component/react-prefer-function-component": { + "count": 1 } }, "public/app/plugins/datasource/graphite/datasource.ts": { @@ -4085,6 +4856,9 @@ }, "no-restricted-syntax": { "count": 1 + }, + "react-prefer-function-component/react-prefer-function-component": { + "count": 1 } }, "public/app/plugins/datasource/influxdb/components/editor/config/InfluxSQLConfig.tsx": { @@ -4100,6 +4874,14 @@ "public/app/plugins/datasource/influxdb/components/editor/query/flux/FluxQueryEditor.tsx": { "no-restricted-syntax": { "count": 3 + }, + "react-prefer-function-component/react-prefer-function-component": { + "count": 1 + } + }, + "public/app/plugins/datasource/influxdb/components/editor/query/fsql/FSQLEditor.tsx": { + "react-prefer-function-component/react-prefer-function-component": { + "count": 1 } }, "public/app/plugins/datasource/influxdb/components/editor/query/influxql/visual/PartListSection.tsx": { @@ -4150,11 +4932,21 @@ "count": 2 } }, + "public/app/plugins/datasource/loki/components/LokiCheatSheet.tsx": { + "react-prefer-function-component/react-prefer-function-component": { + "count": 1 + } + }, "public/app/plugins/datasource/loki/components/LokiContextUi.tsx": { "no-restricted-syntax": { "count": 7 } }, + "public/app/plugins/datasource/loki/components/LokiLabelBrowser.tsx": { + "react-prefer-function-component/react-prefer-function-component": { + "count": 1 + } + }, "public/app/plugins/datasource/loki/components/LokiQueryEditor.tsx": { "no-restricted-syntax": { "count": 2 @@ -4163,6 +4955,9 @@ "public/app/plugins/datasource/loki/components/LokiQueryField.tsx": { "no-restricted-syntax": { "count": 2 + }, + "react-prefer-function-component/react-prefer-function-component": { + "count": 1 } }, "public/app/plugins/datasource/loki/configuration/DerivedField.tsx": { @@ -4270,6 +5065,11 @@ "count": 15 } }, + "public/app/plugins/datasource/tempo/QueryField.tsx": { + "react-prefer-function-component/react-prefer-function-component": { + "count": 1 + } + }, "public/app/plugins/datasource/tempo/ServiceGraphSection.tsx": { "@typescript-eslint/consistent-type-assertions": { "count": 1 @@ -4278,6 +5078,9 @@ "public/app/plugins/datasource/tempo/_importedDependencies/components/AdHocFilter/AdHocFilter.tsx": { "no-restricted-syntax": { "count": 1 + }, + "react-prefer-function-component/react-prefer-function-component": { + "count": 1 } }, "public/app/plugins/datasource/tempo/_importedDependencies/components/AdHocFilter/AdHocFilterKey.tsx": { @@ -4350,6 +5153,11 @@ "count": 1 } }, + "public/app/plugins/panel/annolist/AnnoListPanel.tsx": { + "react-prefer-function-component/react-prefer-function-component": { + "count": 1 + } + }, "public/app/plugins/panel/annolist/AnnotationListItem.tsx": { "no-restricted-syntax": { "count": 1 @@ -4365,6 +5173,11 @@ "count": 1 } }, + "public/app/plugins/panel/bargauge/BarGaugePanel.tsx": { + "react-prefer-function-component/react-prefer-function-component": { + "count": 1 + } + }, "public/app/plugins/panel/candlestick/CandlestickPanel.tsx": { "@typescript-eslint/consistent-type-assertions": { "count": 1 @@ -4378,6 +5191,21 @@ "count": 8 } }, + "public/app/plugins/panel/canvas/CanvasPanel.tsx": { + "react-prefer-function-component/react-prefer-function-component": { + "count": 1 + } + }, + "public/app/plugins/panel/canvas/components/connections/Connections.tsx": { + "react-prefer-function-component/react-prefer-function-component": { + "count": 1 + } + }, + "public/app/plugins/panel/canvas/components/connections/Connections2.tsx": { + "react-prefer-function-component/react-prefer-function-component": { + "count": 1 + } + }, "public/app/plugins/panel/canvas/editor/LineStyleEditor.tsx": { "no-restricted-syntax": { "count": 1 @@ -4404,11 +5232,27 @@ }, "@typescript-eslint/no-explicit-any": { "count": 1 + }, + "react-prefer-function-component/react-prefer-function-component": { + "count": 1 + } + }, + "public/app/plugins/panel/debug/DebugPanel.tsx": { + "react-prefer-function-component/react-prefer-function-component": { + "count": 1 } }, "public/app/plugins/panel/debug/EventBusLogger.tsx": { "@typescript-eslint/no-explicit-any": { "count": 2 + }, + "react-prefer-function-component/react-prefer-function-component": { + "count": 1 + } + }, + "public/app/plugins/panel/debug/RenderInfoViewer.tsx": { + "react-prefer-function-component/react-prefer-function-component": { + "count": 1 } }, "public/app/plugins/panel/debug/StateView.tsx": { @@ -4421,9 +5265,22 @@ "count": 1 } }, + "public/app/plugins/panel/gauge/GaugePanel.tsx": { + "react-prefer-function-component/react-prefer-function-component": { + "count": 1 + } + }, + "public/app/plugins/panel/geomap/GeomapPanel.tsx": { + "react-prefer-function-component/react-prefer-function-component": { + "count": 1 + } + }, "public/app/plugins/panel/geomap/components/DebugOverlay.tsx": { "@grafana/no-aria-label-selectors": { "count": 1 + }, + "react-prefer-function-component/react-prefer-function-component": { + "count": 1 } }, "public/app/plugins/panel/geomap/components/MarkersLegend.tsx": { @@ -4434,6 +5291,11 @@ "count": 1 } }, + "public/app/plugins/panel/geomap/components/ObservablePropsWrapper.tsx": { + "react-prefer-function-component/react-prefer-function-component": { + "count": 1 + } + }, "public/app/plugins/panel/geomap/editor/GeomapStyleRulesEditor.tsx": { "@typescript-eslint/consistent-type-assertions": { "count": 1 @@ -4482,6 +5344,11 @@ "count": 2 } }, + "public/app/plugins/panel/gettingstarted/GettingStarted.tsx": { + "react-prefer-function-component/react-prefer-function-component": { + "count": 1 + } + }, "public/app/plugins/panel/heatmap/HeatmapPanel.tsx": { "@typescript-eslint/consistent-type-assertions": { "count": 1 @@ -4516,6 +5383,11 @@ "count": 17 } }, + "public/app/plugins/panel/histogram/Histogram.tsx": { + "react-prefer-function-component/react-prefer-function-component": { + "count": 1 + } + }, "public/app/plugins/panel/live/LiveChannelEditor.tsx": { "@typescript-eslint/consistent-type-assertions": { "count": 2 @@ -4527,6 +5399,9 @@ "public/app/plugins/panel/live/LivePanel.tsx": { "@typescript-eslint/consistent-type-assertions": { "count": 1 + }, + "react-prefer-function-component/react-prefer-function-component": { + "count": 1 } }, "public/app/plugins/panel/nodeGraph/Edge.tsx": { @@ -4569,6 +5444,11 @@ "count": 1 } }, + "public/app/plugins/panel/stat/StatPanel.tsx": { + "react-prefer-function-component/react-prefer-function-component": { + "count": 1 + } + }, "public/app/plugins/panel/state-timeline/migrations.ts": { "@typescript-eslint/no-explicit-any": { "count": 2 diff --git a/eslint.config.js b/eslint.config.js index cb8fba5222d..417d8e552b2 100644 --- a/eslint.config.js +++ b/eslint.config.js @@ -8,6 +8,7 @@ const jsxA11yPlugin = require('eslint-plugin-jsx-a11y'); const lodashPlugin = require('eslint-plugin-lodash'); const barrelPlugin = require('eslint-plugin-no-barrel-files'); const reactPlugin = require('eslint-plugin-react'); +const reactPreferFunctionComponentPlugin = require('eslint-plugin-react-prefer-function-component'); const testingLibraryPlugin = require('eslint-plugin-testing-library'); const unicornPlugin = require('eslint-plugin-unicorn'); @@ -140,6 +141,7 @@ module.exports = [ 'no-barrel-files': barrelPlugin, '@grafana': grafanaPlugin, unicorn: unicornPlugin, + 'react-prefer-function-component': reactPreferFunctionComponentPlugin, }, settings: { @@ -156,6 +158,7 @@ module.exports = [ '@grafana/no-border-radius-literal': 'error', '@grafana/no-unreduced-motion': 'error', '@grafana/no-restricted-img-srcs': 'error', + 'react-prefer-function-component/react-prefer-function-component': 'error', 'react/prop-types': 'off', // need to ignore emotion's `css` prop, see https://github.com/jsx-eslint/eslint-plugin-react/blob/master/docs/rules/no-unknown-property.md#rule-options 'react/no-unknown-property': ['error', { ignore: ['css'] }], diff --git a/package.json b/package.json index 68aa8df691e..39fc401989a 100644 --- a/package.json +++ b/package.json @@ -198,6 +198,7 @@ "eslint-plugin-no-barrel-files": "^1.1.1", "eslint-plugin-react": "7.37.5", "eslint-plugin-react-hooks": "5.2.0", + "eslint-plugin-react-prefer-function-component": "4.0.1", "eslint-plugin-testing-library": "^7.0.0", "eslint-plugin-unicorn": "^56.0.0", "eslint-scope": "^8.1.0", diff --git a/packages/grafana-runtime/src/services/pluginExtensions/utils.test.tsx b/packages/grafana-runtime/src/services/pluginExtensions/utils.test.tsx index 14f1a9082be..b57a795c3b5 100644 --- a/packages/grafana-runtime/src/services/pluginExtensions/utils.test.tsx +++ b/packages/grafana-runtime/src/services/pluginExtensions/utils.test.tsx @@ -108,11 +108,15 @@ describe('Plugin Extensions / Utils', () => { test('should work when using class components', () => { const props = {}; + // this specifically needs to be a class component + // eslint-disable-next-line react-prefer-function-component/react-prefer-function-component const Component1 = class extends React.Component<{}> { render() { return