diff --git a/e2e-playwright/cloud-plugins-suite/azure-monitor.spec.ts b/e2e-playwright/cloud-plugins-suite/azure-monitor.spec.ts index b9dd1e520d3..a866def1288 100644 --- a/e2e-playwright/cloud-plugins-suite/azure-monitor.spec.ts +++ b/e2e-playwright/cloud-plugins-suite/azure-monitor.spec.ts @@ -94,7 +94,7 @@ test.describe( }; } else { const yamlContent = readFileSync(provisioningPath, 'utf8'); - // eslint-disable-next-line @typescript-eslint/consistent-type-assertions + const yaml = load(yamlContent) as AzureMonitorProvision; datasourceConfig = yaml.datasources[0]; } diff --git a/e2e-playwright/smoke-tests-suite/panels.spec.ts b/e2e-playwright/smoke-tests-suite/panels.spec.ts index 822b0ad90b4..993aca11e91 100644 --- a/e2e-playwright/smoke-tests-suite/panels.spec.ts +++ b/e2e-playwright/smoke-tests-suite/panels.spec.ts @@ -24,7 +24,7 @@ test.describe( // Get panel types from window object const panelTypes = await page.evaluate(() => { // @grafana/plugin-e2e doesn't export the full bootdata config - // eslint-disable-next-line @typescript-eslint/consistent-type-assertions + const win = window as typeof window & { grafanaBootData: BootData }; return win.grafanaBootData?.settings?.panels ?? {}; }); diff --git a/eslint-suppressions.json b/eslint-suppressions.json index 096cff693dd..7c95f8421ba 100644 --- a/eslint-suppressions.json +++ b/eslint-suppressions.json @@ -273,11 +273,6 @@ "count": 1 } }, - "packages/grafana-data/src/types/scopes.ts": { - "@typescript-eslint/consistent-type-assertions": { - "count": 1 - } - }, "packages/grafana-data/src/types/select.ts": { "@typescript-eslint/no-explicit-any": { "count": 2 @@ -453,6 +448,9 @@ "packages/grafana-prometheus/src/querybuilder/components/LabelParamEditor.tsx": { "@typescript-eslint/consistent-type-assertions": { "count": 1 + }, + "jsx-a11y/no-autofocus": { + "count": 1 } }, "packages/grafana-prometheus/src/querybuilder/components/PromQueryCodeEditor.tsx": { @@ -460,11 +458,26 @@ "count": 1 } }, + "packages/grafana-prometheus/src/querybuilder/components/metrics-modal/MetricsModal.tsx": { + "jsx-a11y/no-autofocus": { + "count": 1 + } + }, "packages/grafana-prometheus/src/querybuilder/shared/OperationEditor.tsx": { "@typescript-eslint/no-explicit-any": { "count": 1 } }, + "packages/grafana-prometheus/src/querybuilder/shared/OperationHeader.tsx": { + "jsx-a11y/no-autofocus": { + "count": 1 + } + }, + "packages/grafana-prometheus/src/querybuilder/shared/OperationList.tsx": { + "jsx-a11y/no-autofocus": { + "count": 1 + } + }, "packages/grafana-prometheus/src/querybuilder/shared/OperationParamEditorRegistry.tsx": { "@typescript-eslint/consistent-type-assertions": { "count": 3 @@ -490,6 +503,11 @@ "count": 1 } }, + "packages/grafana-runtime/src/components/DataSourcePicker.tsx": { + "jsx-a11y/no-autofocus": { + "count": 1 + } + }, "packages/grafana-runtime/src/config.ts": { "@typescript-eslint/consistent-type-assertions": { "count": 5 @@ -584,16 +602,36 @@ "count": 1 } }, + "packages/grafana-ui/src/components/Carousel/Carousel.tsx": { + "jsx-a11y/no-autofocus": { + "count": 1 + } + }, + "packages/grafana-ui/src/components/Cascader/Cascader.tsx": { + "jsx-a11y/no-autofocus": { + "count": 2 + } + }, "packages/grafana-ui/src/components/ColorPicker/ColorPicker.tsx": { "@typescript-eslint/no-explicit-any": { "count": 2 } }, + "packages/grafana-ui/src/components/ColorPicker/ColorPickerPopover.tsx": { + "jsx-a11y/no-autofocus": { + "count": 1 + } + }, "packages/grafana-ui/src/components/Combobox/Combobox.story.tsx": { "react-hooks/rules-of-hooks": { "count": 5 } }, + "packages/grafana-ui/src/components/Combobox/Combobox.tsx": { + "jsx-a11y/no-autofocus": { + "count": 1 + } + }, "packages/grafana-ui/src/components/Combobox/MultiCombobox.story.tsx": { "no-restricted-syntax": { "count": 1 @@ -650,6 +688,51 @@ "count": 2 } }, + "packages/grafana-ui/src/components/DateTimePickers/DateTimePicker/DateTimePicker.tsx": { + "jsx-a11y/no-autofocus": { + "count": 2 + } + }, + "packages/grafana-ui/src/components/DateTimePickers/RelativeTimeRangePicker/RelativeTimeRangePicker.tsx": { + "jsx-a11y/no-autofocus": { + "count": 1 + } + }, + "packages/grafana-ui/src/components/DateTimePickers/TimeRangeInput.tsx": { + "jsx-a11y/no-autofocus": { + "count": 1 + } + }, + "packages/grafana-ui/src/components/DateTimePickers/TimeRangePicker.tsx": { + "jsx-a11y/no-autofocus": { + "count": 1 + } + }, + "packages/grafana-ui/src/components/DateTimePickers/TimeRangePicker/TimePickerCalendar.tsx": { + "jsx-a11y/no-autofocus": { + "count": 2 + } + }, + "packages/grafana-ui/src/components/DateTimePickers/TimeZonePicker.tsx": { + "jsx-a11y/no-autofocus": { + "count": 1 + } + }, + "packages/grafana-ui/src/components/DateTimePickers/WeekStartPicker.tsx": { + "jsx-a11y/no-autofocus": { + "count": 1 + } + }, + "packages/grafana-ui/src/components/Drawer/Drawer.tsx": { + "jsx-a11y/no-autofocus": { + "count": 1 + } + }, + "packages/grafana-ui/src/components/Dropdown/ButtonSelect.tsx": { + "jsx-a11y/no-autofocus": { + "count": 1 + } + }, "packages/grafana-ui/src/components/ElementSelectionContext/ElementSelectionContext.tsx": { "react-hooks/rules-of-hooks": { "count": 3 @@ -705,6 +788,9 @@ "@typescript-eslint/no-explicit-any": { "count": 1 }, + "jsx-a11y/no-autofocus": { + "count": 2 + }, "no-restricted-syntax": { "count": 6 } @@ -767,6 +853,11 @@ "count": 1 } }, + "packages/grafana-ui/src/components/Modal/Modal.tsx": { + "jsx-a11y/no-autofocus": { + "count": 1 + } + }, "packages/grafana-ui/src/components/Modal/ModalsContext.tsx": { "@typescript-eslint/no-explicit-any": { "count": 4 @@ -825,6 +916,9 @@ "packages/grafana-ui/src/components/Segment/SegmentSelect.tsx": { "@typescript-eslint/consistent-type-assertions": { "count": 1 + }, + "jsx-a11y/no-autofocus": { + "count": 1 } }, "packages/grafana-ui/src/components/Select/SelectBase.tsx": { @@ -963,9 +1057,17 @@ "count": 1 } }, + "packages/grafana-ui/src/components/ToolbarButton/ToolbarButtonRow.tsx": { + "jsx-a11y/no-autofocus": { + "count": 1 + } + }, "packages/grafana-ui/src/components/ValuePicker/ValuePicker.tsx": { "@grafana/no-aria-label-selectors": { "count": 1 + }, + "jsx-a11y/no-autofocus": { + "count": 1 } }, "packages/grafana-ui/src/components/VizLegend/VizLegend.story.tsx": { @@ -1127,6 +1229,11 @@ "count": 1 } }, + "public/app/core/components/AppChrome/AppChromeMenu.tsx": { + "jsx-a11y/no-autofocus": { + "count": 1 + } + }, "public/app/core/components/AppChrome/History/HistoryWrapper.tsx": { "no-restricted-syntax": { "count": 2 @@ -1143,6 +1250,9 @@ } }, "public/app/core/components/ForgottenPassword/ChangePassword.tsx": { + "jsx-a11y/no-autofocus": { + "count": 1 + }, "no-restricted-syntax": { "count": 2 } @@ -1160,17 +1270,31 @@ "count": 2 } }, + "public/app/core/components/Layers/LayerName.tsx": { + "jsx-a11y/no-autofocus": { + "count": 1 + } + }, "public/app/core/components/Login/LoginForm.tsx": { + "jsx-a11y/no-autofocus": { + "count": 1 + }, "no-restricted-syntax": { "count": 2 } }, "public/app/core/components/Login/PasswordlessConfirmationForm.tsx": { + "jsx-a11y/no-autofocus": { + "count": 3 + }, "no-restricted-syntax": { "count": 4 } }, "public/app/core/components/Login/PasswordlessLoginForm.tsx": { + "jsx-a11y/no-autofocus": { + "count": 1 + }, "no-restricted-syntax": { "count": 1 } @@ -1180,7 +1304,15 @@ "count": 1 } }, + "public/app/core/components/NestedFolderPicker/NestedFolderPicker.tsx": { + "jsx-a11y/no-autofocus": { + "count": 2 + } + }, "public/app/core/components/OptionsUI/NumberInput.tsx": { + "jsx-a11y/no-autofocus": { + "count": 1 + }, "no-restricted-syntax": { "count": 1 } @@ -1190,7 +1322,15 @@ "count": 1 } }, + "public/app/core/components/OptionsUI/strings.tsx": { + "jsx-a11y/no-autofocus": { + "count": 1 + } + }, "public/app/core/components/Page/EditableTitle.tsx": { + "jsx-a11y/no-autofocus": { + "count": 1 + }, "no-restricted-syntax": { "count": 1 } @@ -1219,6 +1359,9 @@ } }, "public/app/core/components/Signup/SignupPage.tsx": { + "jsx-a11y/no-autofocus": { + "count": 1 + }, "no-restricted-syntax": { "count": 6 } @@ -1356,7 +1499,15 @@ "count": 2 } }, + "public/app/extensions/recorded-queries/RecordedQueryCreateModal.tsx": { + "jsx-a11y/no-autofocus": { + "count": 1 + } + }, "public/app/features/actions/ActionEditor.tsx": { + "jsx-a11y/no-autofocus": { + "count": 1 + }, "no-restricted-syntax": { "count": 7 } @@ -1384,6 +1535,11 @@ "count": 3 } }, + "public/app/features/admin/OrgRolePicker.tsx": { + "jsx-a11y/no-autofocus": { + "count": 1 + } + }, "public/app/features/admin/ServerStatsCard.tsx": { "no-restricted-syntax": { "count": 1 @@ -1399,11 +1555,29 @@ "count": 3 } }, + "public/app/features/admin/UserListAdminPage.tsx": { + "jsx-a11y/no-autofocus": { + "count": 1 + } + }, + "public/app/features/admin/UserListAnonymousPage.tsx": { + "jsx-a11y/no-autofocus": { + "count": 1 + } + }, "public/app/features/admin/UserOrgs.tsx": { + "jsx-a11y/no-autofocus": { + "count": 2 + }, "no-restricted-syntax": { "count": 2 } }, + "public/app/features/admin/UserPermissions.tsx": { + "jsx-a11y/no-autofocus": { + "count": 1 + } + }, "public/app/features/admin/ldap/LdapDrawer.tsx": { "no-restricted-syntax": { "count": 23 @@ -1508,10 +1682,18 @@ } }, "public/app/features/alerting/unified/components/create-folder/CreateNewFolder.tsx": { + "jsx-a11y/no-autofocus": { + "count": 1 + }, "no-restricted-syntax": { "count": 1 } }, + "public/app/features/alerting/unified/components/expressions/Expression.tsx": { + "jsx-a11y/no-autofocus": { + "count": 1 + } + }, "public/app/features/alerting/unified/components/import-to-gma/NamespaceAndGroupFilter.tsx": { "no-restricted-syntax": { "count": 2 @@ -1538,6 +1720,9 @@ } }, "public/app/features/alerting/unified/components/notification-policies/EditNotificationPolicyForm.tsx": { + "jsx-a11y/no-autofocus": { + "count": 1 + }, "no-restricted-syntax": { "count": 13 } @@ -1547,6 +1732,16 @@ "count": 2 } }, + "public/app/features/alerting/unified/components/receivers/AlertInstanceModalSelector.tsx": { + "jsx-a11y/no-autofocus": { + "count": 1 + } + }, + "public/app/features/alerting/unified/components/receivers/TemplateForm.tsx": { + "jsx-a11y/no-autofocus": { + "count": 1 + } + }, "public/app/features/alerting/unified/components/receivers/TemplatePreview.tsx": { "react-hooks/rules-of-hooks": { "count": 1 @@ -1631,6 +1826,9 @@ } }, "public/app/features/alerting/unified/components/rule-editor/DashboardPicker.tsx": { + "jsx-a11y/no-autofocus": { + "count": 1 + }, "no-restricted-syntax": { "count": 1 } @@ -1646,6 +1844,9 @@ } }, "public/app/features/alerting/unified/components/rule-editor/GrafanaEvaluationBehavior.tsx": { + "jsx-a11y/no-autofocus": { + "count": 1 + }, "no-restricted-syntax": { "count": 10 } @@ -1673,6 +1874,11 @@ "count": 1 } }, + "public/app/features/alerting/unified/components/rule-editor/SelectWIthAdd.tsx": { + "jsx-a11y/no-autofocus": { + "count": 1 + } + }, "public/app/features/alerting/unified/components/rule-editor/alert-rule-form/AlertRuleForm.tsx": { "no-restricted-syntax": { "count": 8 @@ -1733,6 +1939,11 @@ "count": 4 } }, + "public/app/features/alerting/unified/components/rules/MultipleDataSourcePicker.tsx": { + "jsx-a11y/no-autofocus": { + "count": 1 + } + }, "public/app/features/alerting/unified/components/rules/RuleListGroupView.tsx": { "no-restricted-syntax": { "count": 2 @@ -1931,6 +2142,16 @@ "count": 1 } }, + "public/app/features/canvas/elements/text.tsx": { + "jsx-a11y/no-autofocus": { + "count": 1 + } + }, + "public/app/features/commandPalette/CommandPalette.tsx": { + "jsx-a11y/no-autofocus": { + "count": 1 + } + }, "public/app/features/commandPalette/actions/recentScopesActions.ts": { "react-hooks/rules-of-hooks": { "count": 1 @@ -2118,17 +2339,31 @@ "count": 1 } }, + "public/app/features/dashboard-scene/panel-edit/PanelOptionsPane.tsx": { + "jsx-a11y/no-autofocus": { + "count": 1 + } + }, "public/app/features/dashboard-scene/panel-edit/PanelVizTypePicker.tsx": { + "jsx-a11y/no-autofocus": { + "count": 1 + }, "no-restricted-syntax": { "count": 1 } }, "public/app/features/dashboard-scene/saving/SaveDashboardAsForm.tsx": { + "jsx-a11y/no-autofocus": { + "count": 1 + }, "no-restricted-syntax": { "count": 4 } }, "public/app/features/dashboard-scene/saving/SaveDashboardForm.tsx": { + "jsx-a11y/no-autofocus": { + "count": 1 + }, "no-restricted-syntax": { "count": 1 } @@ -2249,11 +2484,17 @@ } }, "public/app/features/dashboard-scene/settings/annotations/AnnotationSettingsEdit.tsx": { + "jsx-a11y/no-autofocus": { + "count": 1 + }, "no-restricted-syntax": { "count": 7 } }, "public/app/features/dashboard-scene/settings/links/DashboardLinkForm.tsx": { + "jsx-a11y/no-autofocus": { + "count": 1 + }, "no-restricted-syntax": { "count": 10 } @@ -2413,6 +2654,9 @@ } }, "public/app/features/dashboard/components/AnnotationSettings/AnnotationSettingsEdit.tsx": { + "jsx-a11y/no-autofocus": { + "count": 1 + }, "no-restricted-syntax": { "count": 7 } @@ -2518,6 +2762,9 @@ "@grafana/no-aria-label-selectors": { "count": 1 }, + "jsx-a11y/no-autofocus": { + "count": 1 + }, "no-restricted-syntax": { "count": 1 } @@ -2546,6 +2793,9 @@ } }, "public/app/features/dashboard/components/SaveDashboard/forms/SaveDashboardAsForm.tsx": { + "jsx-a11y/no-autofocus": { + "count": 2 + }, "no-restricted-syntax": { "count": 4 } @@ -2553,6 +2803,9 @@ "public/app/features/dashboard/components/SaveDashboard/forms/SaveDashboardForm.tsx": { "@grafana/no-aria-label-selectors": { "count": 3 + }, + "jsx-a11y/no-autofocus": { + "count": 1 } }, "public/app/features/dashboard/components/SaveDashboard/useDashboardSave.tsx": { @@ -2622,10 +2875,18 @@ } }, "public/app/features/dashboard/components/TransformationsEditor/TransformationPicker.tsx": { + "jsx-a11y/no-autofocus": { + "count": 1 + }, "no-restricted-syntax": { "count": 1 } }, + "public/app/features/dashboard/components/TransformationsEditor/TransformationPickerNg.tsx": { + "jsx-a11y/no-autofocus": { + "count": 1 + } + }, "public/app/features/dashboard/components/TransformationsEditor/TransformationsEditor.tsx": { "@typescript-eslint/consistent-type-assertions": { "count": 2 @@ -2803,6 +3064,11 @@ "count": 1 } }, + "public/app/features/datasources/components/picker/DataSourceModal.tsx": { + "jsx-a11y/no-autofocus": { + "count": 1 + } + }, "public/app/features/datasources/state/actions.test.ts": { "@typescript-eslint/no-explicit-any": { "count": 2 @@ -2855,6 +3121,11 @@ "count": 1 } }, + "public/app/features/dimensions/editors/ResourcePickerPopover.tsx": { + "jsx-a11y/no-autofocus": { + "count": 1 + } + }, "public/app/features/dimensions/editors/TextDimensionEditor.tsx": { "@typescript-eslint/consistent-type-assertions": { "count": 2 @@ -3090,6 +3361,11 @@ "count": 1 } }, + "public/app/features/logs/components/panel/LogListSearch.tsx": { + "jsx-a11y/no-autofocus": { + "count": 1 + } + }, "public/app/features/logs/logsFrame.ts": { "@typescript-eslint/consistent-type-assertions": { "count": 1 @@ -3331,6 +3607,16 @@ "count": 2 } }, + "public/app/features/provisioning/File/FilesView.tsx": { + "jsx-a11y/no-autofocus": { + "count": 1 + } + }, + "public/app/features/provisioning/Repository/RepositoryResources.tsx": { + "jsx-a11y/no-autofocus": { + "count": 1 + } + }, "public/app/features/provisioning/Shared/BranchValidationError.tsx": { "react/no-unescaped-entities": { "count": 26 @@ -3341,6 +3627,11 @@ "count": 2 } }, + "public/app/features/provisioning/Wizard/BootstrapStep.tsx": { + "jsx-a11y/no-autofocus": { + "count": 1 + } + }, "public/app/features/provisioning/Wizard/SynchronizeStep.tsx": { "react/no-unescaped-entities": { "count": 1 @@ -3363,6 +3654,9 @@ "public/app/features/query/components/QueryEditorRowHeader.tsx": { "@grafana/no-aria-label-selectors": { "count": 1 + }, + "jsx-a11y/no-autofocus": { + "count": 1 } }, "public/app/features/query/components/QueryGroup.tsx": { @@ -3408,6 +3702,11 @@ "count": 3 } }, + "public/app/features/scopes/selector/ScopesTreeSearch.tsx": { + "jsx-a11y/no-autofocus": { + "count": 1 + } + }, "public/app/features/search/page/components/columns.tsx": { "@typescript-eslint/consistent-type-assertions": { "count": 1 @@ -3440,6 +3739,9 @@ } }, "public/app/features/serviceaccounts/ServiceAccountCreatePage.tsx": { + "jsx-a11y/no-autofocus": { + "count": 2 + }, "no-restricted-syntax": { "count": 4 } @@ -3609,6 +3911,9 @@ "public/app/features/transformers/suggestionsInput/SuggestionsInput.tsx": { "@typescript-eslint/consistent-type-assertions": { "count": 4 + }, + "jsx-a11y/no-autofocus": { + "count": 2 } }, "public/app/features/variables/adapters.ts": { @@ -4153,6 +4458,11 @@ "count": 1 } }, + "public/app/plugins/datasource/grafana-testdata-datasource/components/CSVWaveEditor.tsx": { + "jsx-a11y/no-autofocus": { + "count": 1 + } + }, "public/app/plugins/datasource/grafana-testdata-datasource/components/RandomWalkEditor.tsx": { "@typescript-eslint/consistent-type-assertions": { "count": 2 @@ -4199,6 +4509,9 @@ } }, "public/app/plugins/datasource/grafana/components/TimeRegionEditor.tsx": { + "jsx-a11y/no-autofocus": { + "count": 1 + }, "no-restricted-syntax": { "count": 6 } @@ -4323,6 +4636,11 @@ "count": 2 } }, + "public/app/plugins/datasource/influxdb/components/editor/query/influxql/visual/Seg.tsx": { + "jsx-a11y/no-autofocus": { + "count": 3 + } + }, "public/app/plugins/datasource/influxdb/components/editor/query/influxql/visual/TagsSection.tsx": { "no-restricted-syntax": { "count": 1 @@ -4401,6 +4719,11 @@ "count": 2 } }, + "public/app/plugins/datasource/loki/querybuilder/components/LabelParamEditor.tsx": { + "jsx-a11y/no-autofocus": { + "count": 1 + } + }, "public/app/plugins/datasource/loki/querybuilder/components/LokiQueryBuilder.tsx": { "@typescript-eslint/consistent-type-assertions": { "count": 1 @@ -4866,6 +5189,11 @@ "count": 1 } }, + "public/app/plugins/panel/timeseries/NullsThresholdInput.tsx": { + "jsx-a11y/no-autofocus": { + "count": 1 + } + }, "public/app/plugins/panel/timeseries/migrations.ts": { "@typescript-eslint/consistent-type-assertions": { "count": 4 diff --git a/eslint.config.js b/eslint.config.js index 8b68f7180f2..563c7fa08b9 100644 --- a/eslint.config.js +++ b/eslint.config.js @@ -120,11 +120,6 @@ module.exports = [ }, { name: 'grafana/defaults', - linterOptions: { - // This reports unused disable directives that we can clean up but - // it also conflicts with the betterer eslint rules so disabled - reportUnusedDisableDirectives: false, - }, files: ['**/*.{ts,tsx,js}'], plugins: { '@emotion': emotionPlugin, diff --git a/packages/grafana-data/src/datetime/formatter.ts b/packages/grafana-data/src/datetime/formatter.ts index cc90e27491a..0d33f5e6c90 100644 --- a/packages/grafana-data/src/datetime/formatter.ts +++ b/packages/grafana-data/src/datetime/formatter.ts @@ -1,4 +1,3 @@ -/* eslint-disable id-blacklist, no-restricted-imports */ import moment, { Moment } from 'moment-timezone'; import { formatDate } from '@grafana/i18n'; diff --git a/packages/grafana-data/src/datetime/moment_wrapper.ts b/packages/grafana-data/src/datetime/moment_wrapper.ts index 0120e016d56..eb69ddbf1eb 100644 --- a/packages/grafana-data/src/datetime/moment_wrapper.ts +++ b/packages/grafana-data/src/datetime/moment_wrapper.ts @@ -2,7 +2,7 @@ import moment, { Moment, MomentInput, DurationInputArg1, DurationInputArg2 } fro import { tz } from 'moment-timezone'; import { TimeZone } from '../types/time'; -/* eslint-disable id-blacklist, no-restricted-imports */ + export interface DateTimeBuiltinFormat { __momentBuiltinFormatBrand: any; } diff --git a/packages/grafana-data/src/datetime/parser.ts b/packages/grafana-data/src/datetime/parser.ts index 11758b3cfb2..713cb6a77fe 100644 --- a/packages/grafana-data/src/datetime/parser.ts +++ b/packages/grafana-data/src/datetime/parser.ts @@ -1,4 +1,3 @@ -/* eslint-disable id-blacklist, no-restricted-imports */ import { lowerCase } from 'lodash'; import moment from 'moment-timezone'; diff --git a/packages/grafana-data/src/panel/PanelPlugin.test.tsx b/packages/grafana-data/src/panel/PanelPlugin.test.tsx index 59d8bf9d75b..0c2d53cc66d 100644 --- a/packages/grafana-data/src/panel/PanelPlugin.test.tsx +++ b/packages/grafana-data/src/panel/PanelPlugin.test.tsx @@ -46,9 +46,9 @@ describe('PanelPlugin', () => { path: 'custom', name: 'Custom', description: 'Custom field config property description', - // eslint-disable-next-line react/display-name + editor: () =>
Editor
, - // eslint-disable-next-line react/display-name + override: () =>
Editor
, process: identityOverrideProcessor, settings: {}, @@ -71,7 +71,7 @@ describe('PanelPlugin', () => { path: 'option', name: 'Option editor', description: 'Option editor description', - // eslint-disable-next-line react/display-name + editor: () =>
Editor
, settings: {}, }); @@ -111,7 +111,7 @@ describe('PanelPlugin', () => { path: 'customOption', name: 'Option editor', description: 'Option editor description', - // eslint-disable-next-line react/display-name + editor: () =>
Editor
, settings: {}, defaultValue: { value: 'Custom default value' }, @@ -173,9 +173,9 @@ describe('PanelPlugin', () => { path: 'customOption', name: 'Option editor', description: 'Option editor description', - // eslint-disable-next-line react/display-name + editor: () =>
Editor
, - // eslint-disable-next-line react/display-name + override: () =>
Override editor
, process: identityOverrideProcessor, shouldApply: () => true, diff --git a/packages/grafana-data/src/themes/createTransitions.test.ts b/packages/grafana-data/src/themes/createTransitions.test.ts index 99b66d5fd78..867846b2884 100644 --- a/packages/grafana-data/src/themes/createTransitions.test.ts +++ b/packages/grafana-data/src/themes/createTransitions.test.ts @@ -60,13 +60,13 @@ describe('transitions', () => { it('should return NaN when passed a negative number', () => { const zeroHeightDurationNegativeOne = getAutoHeightDuration(-1); - // eslint-disable-next-line no-restricted-globals + expect(isNaN(zeroHeightDurationNegativeOne)).toEqual(true); const zeroHeightDurationSmallNegative = getAutoHeightDuration(-0.000001); - // eslint-disable-next-line no-restricted-globals + expect(isNaN(zeroHeightDurationSmallNegative)).toEqual(true); const zeroHeightDurationBigNegative = getAutoHeightDuration(-100000); - // eslint-disable-next-line no-restricted-globals + expect(isNaN(zeroHeightDurationBigNegative)).toEqual(true); }); diff --git a/packages/grafana-data/src/transformations/transformDataFrame.ts b/packages/grafana-data/src/transformations/transformDataFrame.ts index 35951f9f5f6..b502ea44695 100644 --- a/packages/grafana-data/src/transformations/transformDataFrame.ts +++ b/packages/grafana-data/src/transformations/transformDataFrame.ts @@ -122,7 +122,7 @@ function isCustomTransformation(t: DataTransformerConfig | CustomTransformOperat } function deepIterate(obj: T, doSomething: (current: any) => any): T; -// eslint-disable-next-line no-redeclare + function deepIterate(obj: any, doSomething: (current: any) => any): any { if (Array.isArray(obj)) { return obj.map((o) => deepIterate(o, doSomething)); diff --git a/packages/grafana-data/src/transformations/transformers/histogram.ts b/packages/grafana-data/src/transformations/transformers/histogram.ts index 8fa69f64a40..9b71974e666 100644 --- a/packages/grafana-data/src/transformations/transformers/histogram.ts +++ b/packages/grafana-data/src/transformations/transformers/histogram.ts @@ -16,7 +16,6 @@ import { nullToValueField } from './nulls/nullToValue'; /** * @internal */ -/* eslint-disable */ // prettier-ignore export const histogramBucketSizes = [ 1e-9, 2e-9, 2.5e-9, 4e-9, 5e-9, @@ -39,7 +38,6 @@ export const histogramBucketSizes = [ 1e+8, 2e+8, 2.5e+8, 4e+8, 5e+8, 1e+9, 2e+9, 2.5e+9, 4e+9, 5e+9, ]; -/* eslint-enable */ const DEFAULT_BUCKET_COUNT = 30; diff --git a/packages/grafana-data/src/types/scopes.ts b/packages/grafana-data/src/types/scopes.ts index b90a0e9feb2..ad7e570aa06 100644 --- a/packages/grafana-data/src/types/scopes.ts +++ b/packages/grafana-data/src/types/scopes.ts @@ -34,9 +34,9 @@ export const scopeFilterOperatorMap: Record = { '!=|': 'not-one-of', }; +// eslint-disable-next-line @typescript-eslint/consistent-type-assertions export const reverseScopeFilterOperatorMap: Record = Object.fromEntries( Object.entries(scopeFilterOperatorMap).map(([symbol, operator]) => [operator, symbol]) - // eslint-disable-next-line @typescript-eslint/consistent-type-assertions ) as Record; export interface ScopeSpecFilter { diff --git a/packages/grafana-eslint-rules/tests/no-restricted-img-srcs.test.js b/packages/grafana-eslint-rules/tests/no-restricted-img-srcs.test.js index e3daa098418..ebee58dfd3e 100644 --- a/packages/grafana-eslint-rules/tests/no-restricted-img-srcs.test.js +++ b/packages/grafana-eslint-rules/tests/no-restricted-img-srcs.test.js @@ -1,4 +1,3 @@ -/* eslint-disable @grafana/no-restricted-img-srcs */ import { RuleTester } from 'eslint'; import noRestrictedImgSrcs from '../rules/no-restricted-img-srcs.cjs'; diff --git a/packages/grafana-flamegraph/src/FlameGraph/murmur3.ts b/packages/grafana-flamegraph/src/FlameGraph/murmur3.ts index 3847798d66e..cc2b78ce185 100644 --- a/packages/grafana-flamegraph/src/FlameGraph/murmur3.ts +++ b/packages/grafana-flamegraph/src/FlameGraph/murmur3.ts @@ -1,6 +1,5 @@ -// eslint-disable-next-line @typescript-eslint/ban-ts-comment // @ts-nocheck -/* eslint-disable @typescript-eslint/restrict-plus-operands */ + /* Copyright (c) 2011 Gary Court @@ -13,11 +12,6 @@ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLI */ -/* eslint-disable no-plusplus */ -/* eslint-disable prefer-const */ -/* eslint-disable no-bitwise */ -/* eslint-disable camelcase */ - export default function murmurhash3_32_gc(key: string, seed = 0) { let remainder; let bytes; diff --git a/packages/grafana-i18n/src/i18n.test.tsx b/packages/grafana-i18n/src/i18n.test.tsx index 9a1fd349673..e25e1523b1c 100644 --- a/packages/grafana-i18n/src/i18n.test.tsx +++ b/packages/grafana-i18n/src/i18n.test.tsx @@ -1,4 +1,3 @@ -/* eslint-disable no-restricted-imports */ import i18n from 'i18next'; import { initReactI18next, setDefaults, setI18n } from 'react-i18next'; diff --git a/packages/grafana-prometheus/src/components/VariableQueryEditor.tsx b/packages/grafana-prometheus/src/components/VariableQueryEditor.tsx index 2ec81339219..425297e3cb5 100644 --- a/packages/grafana-prometheus/src/components/VariableQueryEditor.tsx +++ b/packages/grafana-prometheus/src/components/VariableQueryEditor.tsx @@ -120,7 +120,7 @@ export const PromVariableQueryEditor = ({ onChange, query, datasource, range }: }); } else { // fetch the labels filtered by the metric - // eslint-disable-next-line @grafana/i18n/no-untranslated-strings + const labelToConsider = [{ label: '__name__', op: '=', value: metric }]; const expr = promQueryModeller.renderLabels(labelToConsider); diff --git a/packages/grafana-prometheus/src/querybuilder/components/LabelParamEditor.tsx b/packages/grafana-prometheus/src/querybuilder/components/LabelParamEditor.tsx index 0fc93905f4d..b43acbfcc97 100644 --- a/packages/grafana-prometheus/src/querybuilder/components/LabelParamEditor.tsx +++ b/packages/grafana-prometheus/src/querybuilder/components/LabelParamEditor.tsx @@ -73,7 +73,6 @@ async function loadGroupByLabels( // This function is used by both Prometheus and Loki and this the only difference. if (datasource.type === 'prometheus') { - // eslint-disable-next-line @grafana/i18n/no-untranslated-strings labels = [{ label: '__name__', op: '=', value: query.metric }, ...query.labels]; } diff --git a/packages/grafana-prometheus/src/querybuilder/components/MetricsLabelsSection.tsx b/packages/grafana-prometheus/src/querybuilder/components/MetricsLabelsSection.tsx index 321cf89a792..2422fa3613e 100644 --- a/packages/grafana-prometheus/src/querybuilder/components/MetricsLabelsSection.tsx +++ b/packages/grafana-prometheus/src/querybuilder/components/MetricsLabelsSection.tsx @@ -69,7 +69,7 @@ export function MetricsLabelsSection({ } const labelsToConsider = query.labels.filter((x) => x !== forLabel); - // eslint-disable-next-line @grafana/i18n/no-untranslated-strings + labelsToConsider.push({ label: '__name__', op: '=', value: query.metric }); const expr = promQueryModeller.renderLabels(labelsToConsider); @@ -93,7 +93,6 @@ export function MetricsLabelsSection({ const labelsToConsider = query.labels.filter((x) => x.label !== forLabel.label); labelsToConsider.push(forLabel); if (query.metric) { - // eslint-disable-next-line @grafana/i18n/no-untranslated-strings labelsToConsider.push({ label: '__name__', op: '=', value: query.metric }); } const interpolatedLabelsToConsider = labelsToConsider.map((labelObject) => ({ @@ -121,7 +120,7 @@ export function MetricsLabelsSection({ } const labelsToConsider = query.labels.filter((x) => x !== forLabel); - // eslint-disable-next-line @grafana/i18n/no-untranslated-strings + labelsToConsider.push({ label: '__name__', op: '=', value: query.metric }); const interpolatedLabelsToConsider = labelsToConsider.map((labelObject) => ({ diff --git a/packages/grafana-prometheus/src/querybuilder/operationUtils.ts b/packages/grafana-prometheus/src/querybuilder/operationUtils.ts index 227621b1734..7b4d7fb3949 100644 --- a/packages/grafana-prometheus/src/querybuilder/operationUtils.ts +++ b/packages/grafana-prometheus/src/querybuilder/operationUtils.ts @@ -121,7 +121,6 @@ export function getPromOperationDisplayName(funcName: string) { } export function getRangeVectorParamDef(withRateInterval = false): QueryBuilderOperationParamDef { - /* eslint-disable @grafana/i18n/no-untranslated-strings */ const options: Array> = [ { label: '$__interval', @@ -142,7 +141,6 @@ export function getRangeVectorParamDef(withRateInterval = false): QueryBuilderOp // tooltip: 'Always above 4x scrape interval', }); } - /* eslint-enable @grafana/i18n/no-untranslated-strings */ const param: QueryBuilderOperationParamDef = { name: 'Range', diff --git a/packages/grafana-runtime/src/utils/migrationHandler.test.ts b/packages/grafana-runtime/src/utils/migrationHandler.test.ts index 37fba989266..7e8fd8907e8 100644 --- a/packages/grafana-runtime/src/utils/migrationHandler.test.ts +++ b/packages/grafana-runtime/src/utils/migrationHandler.test.ts @@ -58,7 +58,7 @@ describe('query migration', () => { }); it('returns false for a datasource without backend migration', () => { - const ds = new MyDataSourceWithoutMigration({} as DataSourceInstanceSettings); // eslint-disable-line @typescript-eslint/no-explicit-any + const ds = new MyDataSourceWithoutMigration({} as DataSourceInstanceSettings); expect(isMigrationHandler(ds)).toBe(false); }); }); @@ -109,7 +109,7 @@ describe('query migration', () => { ds.hasBackendMigration = false; const request = { targets: [{ refId: 'A', datasource: { type: 'dummy' } }], - } as unknown as DataQueryRequest; // eslint-disable-line @typescript-eslint/no-explicit-any + } as unknown as DataQueryRequest; const result = await migrateRequest(ds, request); @@ -122,7 +122,7 @@ describe('query migration', () => { ds.shouldMigrate = jest.fn().mockReturnValue(false); const request = { targets: [{ refId: 'A', datasource: { type: 'dummy' } }], - } as unknown as DataQueryRequest; // eslint-disable-line @typescript-eslint/no-explicit-any + } as unknown as DataQueryRequest; const result = await migrateRequest(ds, request); @@ -138,7 +138,7 @@ describe('query migration', () => { { refId: 'A', datasource: { type: 'dummy' }, foo: 'bar' }, { refId: 'A', datasource: { type: 'dummy' }, bar: 'foo' }, ], - } as unknown as DataQueryRequest; // eslint-disable-line @typescript-eslint/no-explicit-any + } as unknown as DataQueryRequest; const migratedRequest = { targets: [ { refId: 'A', datasource: { type: 'dummy' }, foobar: 'foobar' }, diff --git a/packages/grafana-ui/rollup.config.ts b/packages/grafana-ui/rollup.config.ts index 16c81ca4af8..e3f92172099 100644 --- a/packages/grafana-ui/rollup.config.ts +++ b/packages/grafana-ui/rollup.config.ts @@ -9,7 +9,6 @@ const icons = rq('../../public/app/core/icons/cached.json'); const pkg = rq('./package.json'); const iconSrcPaths = icons.map((iconSubPath) => { - // eslint-disable-next-line @grafana/no-restricted-img-srcs return `../../public/img/icons/${iconSubPath}.svg`; }); diff --git a/packages/grafana-ui/src/components/Dropdown/Dropdown.tsx b/packages/grafana-ui/src/components/Dropdown/Dropdown.tsx index 4d2846870a6..c5d6f8e58dd 100644 --- a/packages/grafana-ui/src/components/Dropdown/Dropdown.tsx +++ b/packages/grafana-ui/src/components/Dropdown/Dropdown.tsx @@ -96,7 +96,7 @@ export const Dropdown = React.memo(({ children, overlay, placement, offset, onVi this is handling bubbled events from the inner overlay see https://github.com/jsx-eslint/eslint-plugin-jsx-a11y/blob/main/docs/rules/no-static-element-interactions.md#case-the-event-handler-is-only-being-used-to-capture-bubbled-events */} - {/* eslint-disable-next-line jsx-a11y/no-static-element-interactions, jsx-a11y/click-events-have-key-events */} + {/* eslint-disable-next-line jsx-a11y/no-static-element-interactions */}
> | any, prevPluginId: string, diff --git a/packages/grafana-ui/src/components/VizLegend/VizLegendList.tsx b/packages/grafana-ui/src/components/VizLegend/VizLegendList.tsx index 7bd8e345d94..ab610a7f384 100644 --- a/packages/grafana-ui/src/components/VizLegend/VizLegendList.tsx +++ b/packages/grafana-ui/src/components/VizLegend/VizLegendList.tsx @@ -27,7 +27,6 @@ export const VizLegendList = ({ const styles = useStyles2(getStyles); if (!itemRenderer) { - /* eslint-disable-next-line react/display-name */ itemRenderer = (item) => ( ({ } if (!itemRenderer) { - /* eslint-disable-next-line react/display-name */ itemRenderer = (item, index) => ( = 0 && matches.item(i) !== el) {} el = el.parentElement; } while (i < 0 && el); diff --git a/public/app/core/components/Page/EditableTitle.tsx b/public/app/core/components/Page/EditableTitle.tsx index 42050b1e88a..8d81f5b2360 100644 --- a/public/app/core/components/Page/EditableTitle.tsx +++ b/public/app/core/components/Page/EditableTitle.tsx @@ -85,7 +85,6 @@ export const EditableTitle = ({ value, onEdit }: Props) => { } }} // perfectly reasonable to autofocus here since we've made a conscious choice by clicking the edit button - // eslint-disable-next-line jsx-a11y/no-autofocus autoFocus onBlur={onCommitChange} onChange={(event) => setLocalValue(event.currentTarget.value)} diff --git a/public/app/core/components/TimeSeries/utils.ts b/public/app/core/components/TimeSeries/utils.ts index 1bf0c5a18c0..635c55d6b5c 100644 --- a/public/app/core/components/TimeSeries/utils.ts +++ b/public/app/core/components/TimeSeries/utils.ts @@ -468,7 +468,6 @@ export const preparePlotConfigBuilder: UPlotConfigPrepFn = ({ fauxData[0] = xData; fauxData[seriesIdx] = yData; - //eslint-disable-next-line return defaultBuilder( { ...u, diff --git a/public/app/core/services/echo/backends/analytics/BrowseConsoleBackend.ts b/public/app/core/services/echo/backends/analytics/BrowseConsoleBackend.ts index 922c9256408..b89dbcc2ec7 100644 --- a/public/app/core/services/echo/backends/analytics/BrowseConsoleBackend.ts +++ b/public/app/core/services/echo/backends/analytics/BrowseConsoleBackend.ts @@ -1,4 +1,3 @@ -/* eslint-disable no-console */ import { EchoBackend, EchoEventType, diff --git a/public/app/core/utils/timeRegions.test.ts b/public/app/core/utils/timeRegions.test.ts index a6aadb97db2..dde89a48ef0 100644 --- a/public/app/core/utils/timeRegions.test.ts +++ b/public/app/core/utils/timeRegions.test.ts @@ -297,7 +297,6 @@ describe('timeRegions', () => { let _ = null; describe('various scenarios (regions)', () => { - /* eslint-disable */ // prettier-ignore let tests: TestDef[] = [ ['from every day (time before) to every day (time after)', _, '10:27', _, '14:27', '27 10 * * *', '4h'], @@ -317,7 +316,6 @@ describe('timeRegions', () => { ['from fri (time after) to fri (time before)', 5, '14:27', 5, '10:27', '27 14 * * 5', '6d 20h'], ]; - /* eslint-enable */ tests.forEach(([name, fromDayOfWeek, from, toDayOfWeek, to, cronExpr, duration]) => { it(name, () => { @@ -331,7 +329,6 @@ describe('timeRegions', () => { }); describe('various scenarios (points)', () => { - /* eslint-disable */ // prettier-ignore let tests: TestDef[] = [ ['from every day (time)', _, '10:03', _, _, '3 10 * * *', ''], @@ -339,7 +336,6 @@ describe('timeRegions', () => { ['from tues (time)', 2, '10:03', _, _, '3 10 * * 2', ''], ['from tues (time) to tues (time)', 2, '10:03', _, '10:03', '3 10 * * 2', ''], ]; - /* eslint-enable */ tests.forEach(([name, fromDayOfWeek, from, toDayOfWeek, to, cronExpr, duration]) => { it(name, () => { diff --git a/public/app/features/admin/ldap/LdapSettingsPage.tsx b/public/app/features/admin/ldap/LdapSettingsPage.tsx index b100c9386fb..9c103a7312e 100644 --- a/public/app/features/admin/ldap/LdapSettingsPage.tsx +++ b/public/app/features/admin/ldap/LdapSettingsPage.tsx @@ -137,7 +137,7 @@ export const LdapSettingsPage = () => { setIsLoading(false); } init(); - }, [reset]); // eslint-disable-line react-hooks/exhaustive-deps + }, [reset]); /** * Display warning if the feature flag is disabled diff --git a/public/app/features/alerting/unified/components/alert-groups/AlertGroupAlertsTable.tsx b/public/app/features/alerting/unified/components/alert-groups/AlertGroupAlertsTable.tsx index ca9f0418a32..9b75080232f 100644 --- a/public/app/features/alerting/unified/components/alert-groups/AlertGroupAlertsTable.tsx +++ b/public/app/features/alerting/unified/components/alert-groups/AlertGroupAlertsTable.tsx @@ -29,7 +29,7 @@ export const AlertGroupAlertsTable = ({ alerts, alertManagerSourceName }: Props) { id: 'state', label: t('alerting.alert-group-alerts-table.columns.label.notification-state', 'Notification state'), - // eslint-disable-next-line react/display-name + renderCell: ({ data: alert }) => ( <> @@ -53,7 +53,7 @@ export const AlertGroupAlertsTable = ({ alerts, alertManagerSourceName }: Props) { id: 'labels', label: t('alerting.alert-group-alerts-table.columns.label.instance-labels', 'Instance labels'), - // eslint-disable-next-line react/display-name + renderCell: ({ data: { labels } }) => , size: 1, }, diff --git a/public/app/features/alerting/unified/components/rules/AlertInstancesTable.tsx b/public/app/features/alerting/unified/components/rules/AlertInstancesTable.tsx index 8c4e43936a3..8dd42257b8f 100644 --- a/public/app/features/alerting/unified/components/rules/AlertInstancesTable.tsx +++ b/public/app/features/alerting/unified/components/rules/AlertInstancesTable.tsx @@ -63,7 +63,7 @@ const columns: AlertTableColumnProps[] = [ { id: 'state', label: 'State', - // eslint-disable-next-line react/display-name + renderCell: ({ data: { alert: { state }, @@ -74,7 +74,7 @@ const columns: AlertTableColumnProps[] = [ { id: 'labels', label: 'Labels', - // eslint-disable-next-line react/display-name + renderCell: ({ data: { alert: { labels, commonLabels }, @@ -84,7 +84,7 @@ const columns: AlertTableColumnProps[] = [ { id: 'created', label: 'Created', - // eslint-disable-next-line react/display-name + renderCell: ({ data: { alert: { activeAt }, diff --git a/public/app/features/alerting/unified/components/rules/RulesTable.tsx b/public/app/features/alerting/unified/components/rules/RulesTable.tsx index e95aef910c9..eea9599b122 100644 --- a/public/app/features/alerting/unified/components/rules/RulesTable.tsx +++ b/public/app/features/alerting/unified/components/rules/RulesTable.tsx @@ -204,14 +204,14 @@ function useColumns( { id: 'name', label: t('alerting.use-columns.columns.label.name', 'Name'), - // eslint-disable-next-line react/display-name + renderCell: ({ data: rule }) => rule.name, size: showNextEvaluationColumn ? 4 : 5, }, { id: 'metadata', label: '', - // eslint-disable-next-line react/display-name + renderCell: ({ data: rule }) => { const { promRule, rulerRule } = rule; @@ -239,7 +239,7 @@ function useColumns( { id: 'health', label: t('alerting.use-columns.columns.label.health', 'Health'), - // eslint-disable-next-line react/display-name + renderCell: ({ data: { promRule, group } }) => (promRule ? : null), size: '75px', }, @@ -248,7 +248,7 @@ function useColumns( columns.push({ id: 'summary', label: t('alerting.use-columns.label.summary', 'Summary'), - // eslint-disable-next-line react/display-name + renderCell: ({ data: rule }) => { return ; }, @@ -284,7 +284,7 @@ function useColumns( columns.push({ id: 'group', label: t('alerting.use-columns.label.group', 'Group'), - // eslint-disable-next-line react/display-name + renderCell: ({ data: rule }) => { const { namespace, group } = rule; // ungrouped rules are rules that are in the "default" group name @@ -303,7 +303,7 @@ function useColumns( columns.push({ id: 'actions', label: t('alerting.use-columns.label.actions', 'Actions'), - // eslint-disable-next-line react/display-name + renderCell: ({ data: rule }) => , size: '215px', }); diff --git a/public/app/features/alerting/unified/rule-editor/CloneRuleEditor.test.tsx b/public/app/features/alerting/unified/rule-editor/CloneRuleEditor.test.tsx index 8bd3b28e933..10c5cd07c83 100644 --- a/public/app/features/alerting/unified/rule-editor/CloneRuleEditor.test.tsx +++ b/public/app/features/alerting/unified/rule-editor/CloneRuleEditor.test.tsx @@ -38,7 +38,6 @@ import { cloneRuleDefinition } from './clone.utils'; import { getDefaultFormValues } from './formDefaults'; jest.mock('../components/rule-editor/ExpressionEditor', () => ({ - // eslint-disable-next-line react/display-name ExpressionEditor: ({ value, onChange }: ExpressionEditorProps) => ( onChange(e.target.value)} /> ), diff --git a/public/app/features/alerting/unified/rule-editor/RuleEditorCloudOnlyAllowed.test.tsx b/public/app/features/alerting/unified/rule-editor/RuleEditorCloudOnlyAllowed.test.tsx index d21d660cc66..c814722bcc5 100644 --- a/public/app/features/alerting/unified/rule-editor/RuleEditorCloudOnlyAllowed.test.tsx +++ b/public/app/features/alerting/unified/rule-editor/RuleEditorCloudOnlyAllowed.test.tsx @@ -15,7 +15,6 @@ import { setupDataSources } from '../testSetup/datasources'; import { DataSourceType, GRAFANA_DATASOURCE_NAME, GRAFANA_RULES_SOURCE_NAME } from '../utils/datasource'; jest.mock('../components/rule-editor/ExpressionEditor', () => ({ - // eslint-disable-next-line react/display-name ExpressionEditor: ({ value, onChange }: ExpressionEditorProps) => ( onChange(e.target.value)} /> ), @@ -30,7 +29,6 @@ jest.mock('../api/ruler', () => ({ })); jest.mock('app/features/query/components/QueryEditorRow', () => ({ - // eslint-disable-next-line react/display-name QueryEditorRow: () =>

hi

, })); diff --git a/public/app/features/alerting/unified/rule-editor/RuleEditorCloudRules.test.tsx b/public/app/features/alerting/unified/rule-editor/RuleEditorCloudRules.test.tsx index 36da4810c9e..06d554fba47 100644 --- a/public/app/features/alerting/unified/rule-editor/RuleEditorCloudRules.test.tsx +++ b/public/app/features/alerting/unified/rule-editor/RuleEditorCloudRules.test.tsx @@ -15,7 +15,6 @@ import { captureRequests, serializeRequests } from '../mocks/server/events'; import { setupPluginsExtensionsHook } from '../testSetup/plugins'; jest.mock('../components/rule-editor/ExpressionEditor', () => ({ - // eslint-disable-next-line react/display-name ExpressionEditor: ({ value, onChange }: ExpressionEditorProps) => ( onChange(e.target.value)} /> ), diff --git a/public/app/features/alerting/unified/rule-editor/RuleEditorRecordingRule.test.tsx b/public/app/features/alerting/unified/rule-editor/RuleEditorRecordingRule.test.tsx index cd1f40deb43..9c8e8b4da4a 100644 --- a/public/app/features/alerting/unified/rule-editor/RuleEditorRecordingRule.test.tsx +++ b/public/app/features/alerting/unified/rule-editor/RuleEditorRecordingRule.test.tsx @@ -40,7 +40,6 @@ jest.mock('app/core/components/AppChrome/AppChromeUpdate', () => ({ })); jest.mock('app/features/query/components/QueryEditorRow', () => ({ - // eslint-disable-next-line react/display-name QueryEditorRow: () =>

hi

, })); diff --git a/public/app/features/alerting/unified/rule-list/filter/RulesFilter.v2.test.tsx b/public/app/features/alerting/unified/rule-list/filter/RulesFilter.v2.test.tsx index 18d68d0f670..043dabb4a1b 100644 --- a/public/app/features/alerting/unified/rule-list/filter/RulesFilter.v2.test.tsx +++ b/public/app/features/alerting/unified/rule-list/filter/RulesFilter.v2.test.tsx @@ -17,7 +17,7 @@ import RulesFilter from './RulesFilter'; // Grant permission before importing the component since permission check happens at module level grantUserPermissions([AccessControlAction.AlertingReceiversRead]); -// eslint-disable-next-line @typescript-eslint/no-var-requires + const RulesFilterV2 = require('./RulesFilter.v2').default; let mockFilterState: RulesFilterType = { diff --git a/public/app/features/correlations/CorrelationsPage.tsx b/public/app/features/correlations/CorrelationsPage.tsx index 34859378863..aefbe95c009 100644 --- a/public/app/features/correlations/CorrelationsPage.tsx +++ b/public/app/features/correlations/CorrelationsPage.tsx @@ -237,7 +237,6 @@ function ExpendedRow({ correlation: { source, ...correlation }, readOnly, onUpda useEffect( () => reportInteraction('grafana_correlations_details_expanded'), // we only want to fire this on first render - // eslint-disable-next-line react-hooks/exhaustive-deps [] ); diff --git a/public/app/features/dashboard-scene/pages/DashboardScenePage.test.tsx b/public/app/features/dashboard-scene/pages/DashboardScenePage.test.tsx index 9a6b5194abb..3fc601604fe 100644 --- a/public/app/features/dashboard-scene/pages/DashboardScenePage.test.tsx +++ b/public/app/features/dashboard-scene/pages/DashboardScenePage.test.tsx @@ -145,7 +145,6 @@ const loadDashboardMock = jest.fn(); setDashboardLoaderSrv({ loadDashboard: loadDashboardMock, // disabling type checks since this is a test util - // eslint-disable-next-line @typescript-eslint/consistent-type-assertions } as unknown as DashboardLoaderSrv); describe('DashboardScenePage', () => { diff --git a/public/app/features/dashboard-scene/panel-edit/PanelOptions.tsx b/public/app/features/dashboard-scene/panel-edit/PanelOptions.tsx index fd373104caf..0b74ce01408 100644 --- a/public/app/features/dashboard-scene/panel-edit/PanelOptions.tsx +++ b/public/app/features/dashboard-scene/panel-edit/PanelOptions.tsx @@ -67,7 +67,6 @@ export const PanelOptions = React.memo(({ panel, searchQuery, listMode, d panel.onFieldConfigChange(newConfig, true); } ), - // eslint-disable-next-line react-hooks/exhaustive-deps [data, searchQuery, panel, fieldConfig] ); diff --git a/public/app/features/dashboard-scene/settings/variables/components/DataSourceVariableForm.tsx b/public/app/features/dashboard-scene/settings/variables/components/DataSourceVariableForm.tsx index 6b763272d4c..38affbc8744 100644 --- a/public/app/features/dashboard-scene/settings/variables/components/DataSourceVariableForm.tsx +++ b/public/app/features/dashboard-scene/settings/variables/components/DataSourceVariableForm.tsx @@ -60,7 +60,6 @@ export function DataSourceVariableForm({ { return { - // eslint-disable-next-line context: { data }, showTopic: true || annotations?.length || config.topic?.length, showFilter: config.topic !== DataTopic.Annotations, diff --git a/public/app/features/dashboard/containers/DashboardPageProxy.test.tsx b/public/app/features/dashboard/containers/DashboardPageProxy.test.tsx index e26b1099d2d..766faf6b68c 100644 --- a/public/app/features/dashboard/containers/DashboardPageProxy.test.tsx +++ b/public/app/features/dashboard/containers/DashboardPageProxy.test.tsx @@ -91,7 +91,6 @@ jest.mock('react-virtualized-auto-sizer', () => { setDashboardLoaderSrv({ loadDashboard: jest.fn().mockResolvedValue(dashMock), // disabling type checks since this is a test util - // eslint-disable-next-line @typescript-eslint/consistent-type-assertions } as unknown as DashboardLoaderSrv); jest.mock('react-router-dom-v5-compat', () => ({ diff --git a/public/app/features/dashboard/services/DashboardLoaderSrv.ts b/public/app/features/dashboard/services/DashboardLoaderSrv.ts index ef3ec5fb279..b2a527c9b76 100644 --- a/public/app/features/dashboard/services/DashboardLoaderSrv.ts +++ b/public/app/features/dashboard/services/DashboardLoaderSrv.ts @@ -1,6 +1,6 @@ import $ from 'jquery'; import _, { isFunction } from 'lodash'; // eslint-disable-line lodash/import-scope -import moment from 'moment'; // eslint-disable-line no-restricted-imports +import moment from 'moment'; import { AppEvents, dateMath, UrlQueryMap, UrlQueryValue } from '@grafana/data'; import { getBackendSrv, isFetchError, locationService } from '@grafana/runtime'; diff --git a/public/app/features/explore/TraceView/components/CriticalPath/index.tsx b/public/app/features/explore/TraceView/components/CriticalPath/index.tsx index 6a485972c0e..3ba8736caf0 100644 --- a/public/app/features/explore/TraceView/components/CriticalPath/index.tsx +++ b/public/app/features/explore/TraceView/components/CriticalPath/index.tsx @@ -103,7 +103,6 @@ function criticalPathForTrace(trace: Trace) { const sanitizedSpanMap = sanitizeOverFlowingChildren(refinedSpanMap); criticalPath = computeCriticalPath(sanitizedSpanMap, rootSpanId, criticalPath); } catch (error) { - /* eslint-disable no-console */ console.log('error while computing critical path for a trace', error); } } diff --git a/public/app/features/explore/TraceView/components/ScrollManager.test.ts b/public/app/features/explore/TraceView/components/ScrollManager.test.ts index 3be8a64327e..b51706d20c1 100644 --- a/public/app/features/explore/TraceView/components/ScrollManager.test.ts +++ b/public/app/features/explore/TraceView/components/ScrollManager.test.ts @@ -74,15 +74,14 @@ describe('ScrollManager', () => { }); it('is a noop if an invalid rowPosition is returned by the accessors', () => { - // eslint-disable-next-line no-console const oldWarn = console.warn; - // eslint-disable-next-line no-console + console.warn = () => {}; manager._scrollPast(-2, 1); expect(jest.mocked(accessors.getRowPosition).mock.calls.length).toBe(1); expect(jest.mocked(accessors.getViewHeight).mock.calls.length).toBe(0); expect(jest.mocked(scrollTo).mock.calls.length).toBe(0); - // eslint-disable-next-line no-console + console.warn = oldWarn; }); diff --git a/public/app/features/explore/TraceView/components/ScrollManager.tsx b/public/app/features/explore/TraceView/components/ScrollManager.tsx index 2190062e190..202e68159c6 100644 --- a/public/app/features/explore/TraceView/components/ScrollManager.tsx +++ b/public/app/features/explore/TraceView/components/ScrollManager.tsx @@ -105,7 +105,6 @@ export default class ScrollManager { const isUp = direction < 0; const position = xrs.getRowPosition(rowIndex); if (!position) { - // eslint-disable-next-line no-console console.warn('Invalid row index'); return; } diff --git a/public/app/features/explore/TraceView/components/TracePageHeader/SpanGraph/render-into-canvas.tsx b/public/app/features/explore/TraceView/components/TracePageHeader/SpanGraph/render-into-canvas.tsx index fc23e53f517..9cb52dc1570 100644 --- a/public/app/features/explore/TraceView/components/TracePageHeader/SpanGraph/render-into-canvas.tsx +++ b/public/app/features/explore/TraceView/components/TracePageHeader/SpanGraph/render-into-canvas.tsx @@ -32,9 +32,9 @@ export default function renderIntoCanvas( const fillCache: Map = new Map(); const cHeight = items.length < MIN_TOTAL_HEIGHT ? MIN_TOTAL_HEIGHT : Math.min(items.length, MAX_TOTAL_HEIGHT); const cWidth = window.innerWidth * 2; - // eslint-disable-next-line no-param-reassign + canvas.width = cWidth; - // eslint-disable-next-line no-param-reassign + canvas.height = cHeight; const itemHeight = Math.min(MAX_ITEM_HEIGHT, Math.max(MIN_ITEM_HEIGHT, cHeight / items.length)); const itemYChange = cHeight / items.length; diff --git a/public/app/features/explore/TraceView/components/TraceTimelineViewer/ListView/Positions.tsx b/public/app/features/explore/TraceView/components/TraceTimelineViewer/ListView/Positions.tsx index 9614b8877fd..73a3c7b13cf 100644 --- a/public/app/features/explore/TraceView/components/TraceTimelineViewer/ListView/Positions.tsx +++ b/public/app/features/explore/TraceView/components/TraceTimelineViewer/ListView/Positions.tsx @@ -85,7 +85,6 @@ export default class Positions { this.ys[0] = 0; } while (i <= _max) { - // eslint-disable-next-line no-multi-assign const h = (this.heights[i] = heightGetter(i)); this.ys[i + 1] = this.ys[i] + h; i++; @@ -149,7 +148,6 @@ export default class Positions { } let i; while (imin < imax) { - // eslint-disable-next-line no-bitwise i = (imin + 0.5 * (imax - imin)) | 0; if (yValue > this.ys[i]) { if (yValue <= this.ys[i + 1]) { @@ -188,10 +186,9 @@ export default class Positions { getEstimatedHeight(): number { const known = this.ys[this.lastI] + this.heights[this.lastI]; if (this.lastI >= this.dataLen - 1) { - // eslint-disable-next-line no-bitwise return known | 0; } - // eslint-disable-next-line no-bitwise + return ((known / (this.lastI + 1)) * this.heights.length) | 0; } } diff --git a/public/app/features/explore/TraceView/components/TraceTimelineViewer/ListView/index.tsx b/public/app/features/explore/TraceView/components/TraceTimelineViewer/ListView/index.tsx index 7fcbe3553bd..7627ff62b83 100644 --- a/public/app/features/explore/TraceView/components/TraceTimelineViewer/ListView/index.tsx +++ b/public/app/features/explore/TraceView/components/TraceTimelineViewer/ListView/index.tsx @@ -387,7 +387,6 @@ export default class ListView extends React.Component { // use `.getAttribute(...)` instead of `.dataset` for jest / JSDOM const itemKey = node.getAttribute('data-item-key'); if (!itemKey) { - // eslint-disable-next-line no-console console.warn('itemKey not found'); continue; } @@ -401,7 +400,7 @@ export default class ListView extends React.Component { this._knownHeights.set(itemKey, observed); if (!isDirty) { isDirty = true; - // eslint-disable-next-line no-multi-assign + lowDirtyKey = highDirtyKey = itemKey; } else { highDirtyKey = itemKey; @@ -426,7 +425,7 @@ export default class ListView extends React.Component { const key = this.props.getKeyFromIndex(i); const known = this._knownHeights.get(key); // known !== known iff known is NaN - // eslint-disable-next-line no-self-compare + if (known != null && known === known) { return known; } diff --git a/public/app/features/explore/TraceView/components/TraceTimelineViewer/SpanDetail/KeyValuesTable.tsx b/public/app/features/explore/TraceView/components/TraceTimelineViewer/SpanDetail/KeyValuesTable.tsx index a6c79b2d2cf..26f8e7c3097 100644 --- a/public/app/features/explore/TraceView/components/TraceTimelineViewer/SpanDetail/KeyValuesTable.tsx +++ b/public/app/features/explore/TraceView/components/TraceTimelineViewer/SpanDetail/KeyValuesTable.tsx @@ -92,7 +92,6 @@ function parseIfComplexJson(value: unknown) { // otherwise just return as is try { return JSON.parse(value); - // eslint-disable-next-line no-empty } catch (_) {} } return value; diff --git a/public/app/features/explore/TraceView/components/Tween.test.ts b/public/app/features/explore/TraceView/components/Tween.test.ts index d68e4d24f03..c3890078921 100644 --- a/public/app/features/explore/TraceView/components/Tween.test.ts +++ b/public/app/features/explore/TraceView/components/Tween.test.ts @@ -122,7 +122,6 @@ describe('Tween', () => { const copy = { ...current }; try { current!.done = !current!.done; - // eslint-disable-next-line no-empty } catch (_) {} expect(current).toEqual(copy); }); diff --git a/public/app/features/explore/TraceView/components/model/link-patterns.tsx b/public/app/features/explore/TraceView/components/model/link-patterns.tsx index 2c73aae342e..c59727a205f 100644 --- a/public/app/features/explore/TraceView/components/model/link-patterns.tsx +++ b/public/app/features/explore/TraceView/components/model/link-patterns.tsx @@ -111,7 +111,6 @@ export function processLinkPattern(pattern: any): ProcessedLinkPattern | null { parameters: _uniq(url.parameters.concat(text.parameters)), }; } catch (error) { - // eslint-disable-next-line no-console console.error(`Ignoring invalid link pattern: ${error}`, pattern); return null; } diff --git a/public/app/features/explore/TraceView/components/model/transform-trace-data.tsx b/public/app/features/explore/TraceView/components/model/transform-trace-data.tsx index f85f99f8e0c..df271024eb4 100644 --- a/public/app/features/explore/TraceView/components/model/transform-trace-data.tsx +++ b/public/app/features/explore/TraceView/components/model/transform-trace-data.tsx @@ -86,7 +86,7 @@ export default function transformTraceData(data: TraceResponse | undefined): Tra const spanIdCounts = new Map(); const spanMap = new Map(); // filter out spans with empty start times - // eslint-disable-next-line no-param-reassign + data.spans = data.spans.filter((span) => Boolean(span.startTime)); // Sort process tags @@ -114,10 +114,8 @@ export default function transformTraceData(data: TraceResponse | undefined): Tra // make sure span IDs are unique const idCount = spanIdCounts.get(spanID); if (idCount != null) { - // eslint-disable-next-line no-console console.warn(`Dupe spanID, ${idCount + 1} x ${spanID}`, span, spanMap.get(spanID)); if (_isEqual(span, spanMap.get(spanID))) { - // eslint-disable-next-line no-console console.warn('\t two spans with same ID have `isEqual(...) === true`'); } spanIdCounts.set(spanID, idCount + 1); @@ -171,7 +169,6 @@ export default function transformTraceData(data: TraceResponse | undefined): Tra span.references.forEach((ref, index) => { const refSpan = spanMap.get(ref.spanID); if (refSpan) { - // eslint-disable-next-line no-param-reassign ref.span = refSpan; if (index > 0) { // Don't take into account the parent, just other references. diff --git a/public/app/features/explore/TraceView/components/types/TNil.tsx b/public/app/features/explore/TraceView/components/types/TNil.tsx index 2d642dbaebb..41665c6afa9 100644 --- a/public/app/features/explore/TraceView/components/types/TNil.tsx +++ b/public/app/features/explore/TraceView/components/types/TNil.tsx @@ -14,5 +14,4 @@ type TNil = null | undefined; -// eslint-disable-next-line no-undef export default TNil; diff --git a/public/app/features/explore/TraceView/components/types/TTraceTimeline.tsx b/public/app/features/explore/TraceView/components/types/TTraceTimeline.tsx index 38c6900b674..b979db2eb75 100644 --- a/public/app/features/explore/TraceView/components/types/TTraceTimeline.tsx +++ b/public/app/features/explore/TraceView/components/types/TTraceTimeline.tsx @@ -24,5 +24,4 @@ type TTraceTimeline = { traceID: string | TNil; }; -// eslint-disable-next-line no-undef export default TTraceTimeline; diff --git a/public/app/features/explore/TraceView/components/types/trace.ts b/public/app/features/explore/TraceView/components/types/trace.ts index 63216f3519b..9d1456a8fd4 100644 --- a/public/app/features/explore/TraceView/components/types/trace.ts +++ b/public/app/features/explore/TraceView/components/types/trace.ts @@ -30,7 +30,7 @@ export type TraceProcess = { export type TraceSpanReference = { refType: 'CHILD_OF' | 'FOLLOWS_FROM' | 'EXTERNAL'; - // eslint-disable-next-line no-use-before-define + span?: TraceSpan | null | undefined; spanID: string; traceID: string; diff --git a/public/app/features/explore/TraceView/components/utils/test/requestAnimationFrame.ts b/public/app/features/explore/TraceView/components/utils/test/requestAnimationFrame.ts index 376c68ea530..ce769ca16a1 100644 --- a/public/app/features/explore/TraceView/components/utils/test/requestAnimationFrame.ts +++ b/public/app/features/explore/TraceView/components/utils/test/requestAnimationFrame.ts @@ -26,15 +26,12 @@ export function polyfill(target: Window & typeof globalThis, msElapse = DEFAULT_ const _target = target || global; if (!_target.requestAnimationFrame) { if (msElapse === DEFAULT_ELAPSE) { - // eslint-disable-next-line no-param-reassign _target.requestAnimationFrame = requestAnimationFrame; } else { - // eslint-disable-next-line no-param-reassign, no-shadow _target.requestAnimationFrame = (callback) => setTimeout(callback, msElapse); } } if (!_target.cancelAnimationFrame) { - // eslint-disable-next-line no-param-reassign _target.cancelAnimationFrame = cancelAnimationFrame; } } diff --git a/public/app/features/explore/spec/helper/setup.tsx b/public/app/features/explore/spec/helper/setup.tsx index 647284ad25c..6fe8862fe51 100644 --- a/public/app/features/explore/spec/helper/setup.tsx +++ b/public/app/features/explore/spec/helper/setup.tsx @@ -6,7 +6,6 @@ import { fromPairs } from 'lodash'; import { stringify } from 'querystring'; import { ComponentType, ReactNode } from 'react'; import { Provider } from 'react-redux'; -// eslint-disable-next-line no-restricted-imports import { Route, Router } from 'react-router-dom'; import { of } from 'rxjs'; import { getGrafanaContextMock } from 'test/mocks/getGrafanaContextMock'; diff --git a/public/app/features/expressions/components/Threshold.tsx b/public/app/features/expressions/components/Threshold.tsx index 9d1b1982cc1..dbf8fb7ece4 100644 --- a/public/app/features/expressions/components/Threshold.tsx +++ b/public/app/features/expressions/components/Threshold.tsx @@ -151,7 +151,7 @@ export const Threshold = ({ labelWidth, onChange, refIds, query, onError, useHys The onMouseDown event precedes the onBlur event, unlike onchange. */} {/*Disabling the a11y rules here as the InlineSwitch handles keyboard interactions */} - {/* eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-static-element-interactions */} + {/* eslint-disable-next-line jsx-a11y/no-static-element-interactions */}
({ // Mock connected child components instead of rendering them jest.mock('./TeamSettings', () => { - //eslint-disable-next-line return () =>
Team settings
; }); jest.mock('./TeamGroupSync', () => { - //eslint-disable-next-line return () =>
Team group sync
; }); diff --git a/public/app/features/transformers/editors/EnumMappingRow.tsx b/public/app/features/transformers/editors/EnumMappingRow.tsx index 2e9041a830c..0368614403a 100644 --- a/public/app/features/transformers/editors/EnumMappingRow.tsx +++ b/public/app/features/transformers/editors/EnumMappingRow.tsx @@ -105,8 +105,6 @@ const EnumMappingRow = ({ {validationError && {validationError}} ) : ( - // TODO fix accessibility issue here - // eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-noninteractive-element-interactions {value && value !== '' ? value : t('transformers.enum-mapping-row.click-to-edit', 'Click to edit')} diff --git a/public/app/plugins/panel/barchart/distribute.ts b/public/app/plugins/panel/barchart/distribute.ts index 2eddf47fcce..90363e1cb03 100644 --- a/public/app/plugins/panel/barchart/distribute.ts +++ b/public/app/plugins/panel/barchart/distribute.ts @@ -14,7 +14,6 @@ export type Each = (idx: number, offPct: number, dimPct: number) => void; export function distribute(numItems: number, sizeFactor: number, justify: number, onlyIdx: number | null, each: Each) { let space = 1 - sizeFactor; - /* eslint-disable no-multi-spaces */ // prettier-ignore let gap = ( justify === SPACE_BETWEEN ? space / (numItems - 1) : @@ -32,7 +31,6 @@ export function distribute(numItems: number, sizeFactor: number, justify: number justify === SPACE_AROUND ? gap / 2 : justify === SPACE_EVENLY ? gap : 0 ); - /* eslint-enable */ let iwid = sizeFactor / numItems; let _iwid = roundDecimals(iwid, 6); diff --git a/public/app/plugins/panel/geomap/module.tsx b/public/app/plugins/panel/geomap/module.tsx index 7573f9317aa..471bf9c81be 100644 --- a/public/app/plugins/panel/geomap/module.tsx +++ b/public/app/plugins/panel/geomap/module.tsx @@ -83,7 +83,7 @@ export const plugin = new PanelPlugin(GeomapPanel) id: 'layers', path: '', name: '', - // eslint-disable-next-line react/display-name + editor: () => (
diff --git a/public/app/plugins/panel/geomap/style/markers.ts b/public/app/plugins/panel/geomap/style/markers.ts index fd8682866ca..f4d300ab5ee 100644 --- a/public/app/plugins/panel/geomap/style/markers.ts +++ b/public/app/plugins/panel/geomap/style/markers.ts @@ -297,7 +297,7 @@ async function prepareSVG(url: string, size?: number, backgroundOpacity?: number return `data:image/svg+xml,${svgURI}`; }) .catch((error) => { - console.error(error); // eslint-disable-line no-console + console.error(error); return ''; }); } diff --git a/public/app/plugins/panel/geomap/utils/layers.ts b/public/app/plugins/panel/geomap/utils/layers.ts index a6e9ecbbff0..0d817a046c9 100644 --- a/public/app/plugins/panel/geomap/utils/layers.ts +++ b/public/app/plugins/panel/geomap/utils/layers.ts @@ -83,7 +83,7 @@ export async function updateLayer(panel: GeomapPanel, uid: string, newOptions: M // initialize with new data applyLayerFilter(info.handler, newOptions, panel.props.data); } catch (err) { - console.warn('ERROR', err); // eslint-disable-line no-console + console.warn('ERROR', err); return false; } @@ -124,7 +124,7 @@ export async function initLayer( } const handler = await item.create(map, options, panel.props.eventBus, config.theme2); - const layer = handler.init(); // eslint-disable-line + const layer = handler.init(); if (options.opacity != null) { layer.setOpacity(options.opacity); } diff --git a/public/app/plugins/panel/xychart/XYChartPanel.tsx b/public/app/plugins/panel/xychart/XYChartPanel.tsx index e3e667730c2..f39869e2aee 100644 --- a/public/app/plugins/panel/xychart/XYChartPanel.tsx +++ b/public/app/plugins/panel/xychart/XYChartPanel.tsx @@ -33,7 +33,7 @@ export const XYChartPanel2 = (props: Props2) => { // regenerate series schema when mappings or data changes let series = useMemo( () => prepSeries(mapping, mappedSeries, props.data.series, props.fieldConfig), - // eslint-disable-next-line react-hooks/exhaustive-deps + [mapping, mappedSeries, props.data.series, props.fieldConfig] ); diff --git a/public/dashboards/scripted_templated.js b/public/dashboards/scripted_templated.js index 0b09fa50986..b5757374d0f 100644 --- a/public/dashboards/scripted_templated.js +++ b/public/dashboards/scripted_templated.js @@ -20,7 +20,7 @@ let dashboard; // All url parameters are available via the ARGS object -// eslint-disable-next-line no-redeclare + // let ARGS; // Initialize a skeleton with nothing but a rows array and service object diff --git a/public/test/helpers/TestProvider.tsx b/public/test/helpers/TestProvider.tsx index adedcfdaf60..2e7f21043dc 100644 --- a/public/test/helpers/TestProvider.tsx +++ b/public/test/helpers/TestProvider.tsx @@ -1,7 +1,6 @@ import { Store } from '@reduxjs/toolkit'; import * as React from 'react'; import { Provider } from 'react-redux'; -// eslint-disable-next-line no-restricted-imports import { Router } from 'react-router-dom'; import { CompatRouter } from 'react-router-dom-v5-compat'; import { getGrafanaContextMock } from 'test/mocks/getGrafanaContextMock'; diff --git a/public/test/mocks/getGrafanaContextMock.ts b/public/test/mocks/getGrafanaContextMock.ts index 64e704986b7..f003df1e070 100644 --- a/public/test/mocks/getGrafanaContextMock.ts +++ b/public/test/mocks/getGrafanaContextMock.ts @@ -10,11 +10,8 @@ export function getGrafanaContextMock(overrides: Partial = { return { chrome: new AppChromeService(), backend: backendSrv, - // eslint-disable-next-line location: {} as LocationService, - // eslint-disable-next-line config: { featureToggles: {} } as GrafanaBootConfig, - // eslint-disable-next-line keybindings: { clearAndInitGlobalBindings: jest.fn(), setupDashboardBindings: jest.fn(), diff --git a/public/test/mocks/i18nMessages.ts b/public/test/mocks/i18nMessages.ts index 10b630cb2c1..d30d1e421f4 100644 --- a/public/test/mocks/i18nMessages.ts +++ b/public/test/mocks/i18nMessages.ts @@ -2,4 +2,4 @@ // message cataloge isnt really used anyway, but we mock them out so anything that imports them // won't fail if they aren't generated when the tests run -/*eslint-disable*/ module.exports = { messages: {} }; +module.exports = { messages: {} }; diff --git a/public/test/test-utils.tsx b/public/test/test-utils.tsx index 5ed6982bc91..58f54396d14 100644 --- a/public/test/test-utils.tsx +++ b/public/test/test-utils.tsx @@ -5,7 +5,6 @@ import { createMemoryHistory, MemoryHistoryBuildOptions } from 'history'; import { Fragment, PropsWithChildren } from 'react'; import * as React from 'react'; import { Provider } from 'react-redux'; -// eslint-disable-next-line no-restricted-imports import { Router } from 'react-router-dom'; import { CompatRouter } from 'react-router-dom-v5-compat'; import { getGrafanaContextMock } from 'test/mocks/getGrafanaContextMock'; diff --git a/scripts/cli/themeTemplates/_variables.dark.scss.tmpl.ts b/scripts/cli/themeTemplates/_variables.dark.scss.tmpl.ts index 001f8fe20c6..ba3c12ac970 100644 --- a/scripts/cli/themeTemplates/_variables.dark.scss.tmpl.ts +++ b/scripts/cli/themeTemplates/_variables.dark.scss.tmpl.ts @@ -1,5 +1,3 @@ -/* eslint-disable max-len */ - import { GrafanaTheme2 } from '@grafana/data'; import { renderGeneratedFileBanner } from './generatedFileBanner'; diff --git a/scripts/cli/themeTemplates/_variables.light.scss.tmpl.ts b/scripts/cli/themeTemplates/_variables.light.scss.tmpl.ts index bbf0dc220cf..26235a0ffd2 100644 --- a/scripts/cli/themeTemplates/_variables.light.scss.tmpl.ts +++ b/scripts/cli/themeTemplates/_variables.light.scss.tmpl.ts @@ -1,5 +1,3 @@ -/* eslint-disable max-len */ - import { GrafanaTheme2 } from '@grafana/data'; import { renderGeneratedFileBanner } from './generatedFileBanner'; diff --git a/scripts/cli/themeTemplates/_variables.scss.tmpl.ts b/scripts/cli/themeTemplates/_variables.scss.tmpl.ts index c4c9255bb0c..980120007b6 100644 --- a/scripts/cli/themeTemplates/_variables.scss.tmpl.ts +++ b/scripts/cli/themeTemplates/_variables.scss.tmpl.ts @@ -1,5 +1,3 @@ -/* eslint-disable max-len */ - import { GrafanaTheme2 } from '@grafana/data'; import { renderGeneratedFileBanner } from './generatedFileBanner';