Compare commits

...

1 Commits

Author SHA1 Message Date
Tom Ratcliffe
ba371d6cac --wip-- 2025-09-04 11:38:46 +01:00
78 changed files with 389 additions and 141 deletions

View File

@@ -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];
}

View File

@@ -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 ?? {};
});

View File

@@ -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

View File

@@ -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,

View File

@@ -1,4 +1,3 @@
/* eslint-disable id-blacklist, no-restricted-imports */
import moment, { Moment } from 'moment-timezone';
import { formatDate } from '@grafana/i18n';

View File

@@ -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;
}

View File

@@ -1,4 +1,3 @@
/* eslint-disable id-blacklist, no-restricted-imports */
import { lowerCase } from 'lodash';
import moment from 'moment-timezone';

View File

@@ -46,9 +46,9 @@ describe('PanelPlugin', () => {
path: 'custom',
name: 'Custom',
description: 'Custom field config property description',
// eslint-disable-next-line react/display-name
editor: () => <div>Editor</div>,
// eslint-disable-next-line react/display-name
override: () => <div>Editor</div>,
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: () => <div>Editor</div>,
settings: {},
});
@@ -111,7 +111,7 @@ describe('PanelPlugin', () => {
path: 'customOption',
name: 'Option editor',
description: 'Option editor description',
// eslint-disable-next-line react/display-name
editor: () => <div>Editor</div>,
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: () => <div>Editor</div>,
// eslint-disable-next-line react/display-name
override: () => <div>Override editor</div>,
process: identityOverrideProcessor,
shouldApply: () => true,

View File

@@ -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);
});

View File

@@ -122,7 +122,7 @@ function isCustomTransformation(t: DataTransformerConfig | CustomTransformOperat
}
function deepIterate<T extends object>(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));

View File

@@ -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;

View File

@@ -34,9 +34,9 @@ export const scopeFilterOperatorMap: Record<string, ScopeFilterOperator> = {
'!=|': 'not-one-of',
};
// eslint-disable-next-line @typescript-eslint/consistent-type-assertions
export const reverseScopeFilterOperatorMap: Record<ScopeFilterOperator, string> = Object.fromEntries(
Object.entries(scopeFilterOperatorMap).map(([symbol, operator]) => [operator, symbol])
// eslint-disable-next-line @typescript-eslint/consistent-type-assertions
) as Record<ScopeFilterOperator, string>;
export interface ScopeSpecFilter {

View File

@@ -1,4 +1,3 @@
/* eslint-disable @grafana/no-restricted-img-srcs */
import { RuleTester } from 'eslint';
import noRestrictedImgSrcs from '../rules/no-restricted-img-srcs.cjs';

View File

@@ -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;

View File

@@ -1,4 +1,3 @@
/* eslint-disable no-restricted-imports */
import i18n from 'i18next';
import { initReactI18next, setDefaults, setI18n } from 'react-i18next';

View File

@@ -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);

View File

@@ -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];
}

View File

@@ -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) => ({

View File

@@ -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<SelectableValue<string>> = [
{
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',

View File

@@ -58,7 +58,7 @@ describe('query migration', () => {
});
it('returns false for a datasource without backend migration', () => {
const ds = new MyDataSourceWithoutMigration({} as DataSourceInstanceSettings<DataSourceJsonData>); // eslint-disable-line @typescript-eslint/no-explicit-any
const ds = new MyDataSourceWithoutMigration({} as DataSourceInstanceSettings<DataSourceJsonData>);
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<MyQuery>; // eslint-disable-line @typescript-eslint/no-explicit-any
} as unknown as DataQueryRequest<MyQuery>;
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<MyQuery>; // eslint-disable-line @typescript-eslint/no-explicit-any
} as unknown as DataQueryRequest<MyQuery>;
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<MyQuery>; // eslint-disable-line @typescript-eslint/no-explicit-any
} as unknown as DataQueryRequest<MyQuery>;
const migratedRequest = {
targets: [
{ refId: 'A', datasource: { type: 'dummy' }, foobar: 'foobar' },

View File

@@ -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`;
});

View File

@@ -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 */}
<div ref={refs.setFloating} style={floatingStyles} onClick={onOverlayClicked} onKeyDown={handleKeys}>
<CSSTransition
nodeRef={transitionRef}

View File

@@ -25,7 +25,6 @@ export interface SingleStatBaseOptions extends OptionsWithTextFormatting {
const optionsToKeep = ['reduceOptions', 'orientation'];
// eslint-disable-next-line @typescript-eslint/no-explicit-any
export function sharedSingleStatPanelChangedHandler(
panel: PanelModel<Partial<SingleStatBaseOptions>> | any,
prevPluginId: string,

View File

@@ -27,7 +27,6 @@ export const VizLegendList = <T extends unknown>({
const styles = useStyles2(getStyles);
if (!itemRenderer) {
/* eslint-disable-next-line react/display-name */
itemRenderer = (item) => (
<VizLegendListItem
item={item}

View File

@@ -72,7 +72,6 @@ export const VizLegendTable = <T extends unknown>({
}
if (!itemRenderer) {
/* eslint-disable-next-line react/display-name */
itemRenderer = (item, index) => (
<LegendTableItem
key={`${item.label}-${index}`}

View File

@@ -4,10 +4,10 @@ if (typeof window !== 'undefined' && 'Element' in window && !Element.prototype.c
const matches = (this.document || this.ownerDocument).querySelectorAll(s);
let el = this;
let i;
// eslint-disable-next-line
do {
i = matches.length;
// eslint-disable-next-line
while (--i >= 0 && matches.item(i) !== el) {}
el = el.parentElement;
} while (i < 0 && el);

View File

@@ -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)}

View File

@@ -468,7 +468,6 @@ export const preparePlotConfigBuilder: UPlotConfigPrepFn = ({
fauxData[0] = xData;
fauxData[seriesIdx] = yData;
//eslint-disable-next-line
return defaultBuilder(
{
...u,

View File

@@ -1,4 +1,3 @@
/* eslint-disable no-console */
import {
EchoBackend,
EchoEventType,

View File

@@ -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, () => {

View File

@@ -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

View File

@@ -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 }) => (
<>
<AmAlertStateTag state={alert.status.state} />
@@ -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 } }) => <AlertLabels labels={labels} size="sm" />,
size: 1,
},

View File

@@ -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 },

View File

@@ -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 ? <RuleHealth rule={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 <Tokenize input={rule.annotations[Annotation.summary] ?? ''} />;
},
@@ -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 }) => <RuleActionsCell rule={rule} isLoadingRuler={isRulerLoading} />,
size: '215px',
});

View File

@@ -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) => (
<input value={value} data-testid="expr" onChange={(e) => onChange(e.target.value)} />
),

View File

@@ -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) => (
<input value={value} data-testid="expr" onChange={(e) => 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: () => <p>hi</p>,
}));

View File

@@ -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) => (
<input value={value} data-testid="expr" onChange={(e) => onChange(e.target.value)} />
),

View File

@@ -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: () => <p>hi</p>,
}));

View File

@@ -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 = {

View File

@@ -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
[]
);

View File

@@ -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', () => {

View File

@@ -67,7 +67,6 @@ export const PanelOptions = React.memo<Props>(({ panel, searchQuery, listMode, d
panel.onFieldConfigChange(newConfig, true);
}
),
// eslint-disable-next-line react-hooks/exhaustive-deps
[data, searchQuery, panel, fieldConfig]
);

View File

@@ -60,7 +60,6 @@ export function DataSourceVariableForm({
<VariableTextField
defaultValue={regex}
name={t('dashboard-scene.data-source-variable-form.name-instance-name-filter', 'Instance name filter')}
// eslint-disable-next-line @grafana/i18n/no-untranslated-strings
placeholder="/.*-(.*)-.*/"
onBlur={onRegExBlur}
description={

View File

@@ -21,7 +21,6 @@ export const TransformationFilter = ({ index, annotations, config, onChange, dat
const opts = useMemo(() => {
return {
// eslint-disable-next-line
context: { data },
showTopic: true || annotations?.length || config.topic?.length,
showFilter: config.topic !== DataTopic.Annotations,

View File

@@ -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', () => ({

View File

@@ -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';

View File

@@ -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);
}
}

View File

@@ -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;
});

View File

@@ -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;
}

View File

@@ -32,9 +32,9 @@ export default function renderIntoCanvas(
const fillCache: Map<string, string | TNil> = 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;

View File

@@ -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;
}
}

View File

@@ -387,7 +387,6 @@ export default class ListView extends React.Component<TListViewProps> {
// 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<TListViewProps> {
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<TListViewProps> {
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;
}

View File

@@ -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;

View File

@@ -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);
});

View File

@@ -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;
}

View File

@@ -86,7 +86,7 @@ export default function transformTraceData(data: TraceResponse | undefined): Tra
const spanIdCounts = new Map();
const spanMap = new Map<string, TraceSpan>();
// 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.

View File

@@ -14,5 +14,4 @@
type TNil = null | undefined;
// eslint-disable-next-line no-undef
export default TNil;

View File

@@ -24,5 +24,4 @@ type TTraceTimeline = {
traceID: string | TNil;
};
// eslint-disable-next-line no-undef
export default TTraceTimeline;

View File

@@ -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;

View File

@@ -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;
}
}

View File

@@ -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';

View File

@@ -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 */}
<div onMouseDown={onHysteresisCheckDown}>
<InlineSwitch
showLabel={true}

View File

@@ -66,7 +66,6 @@ export const LocationModeEditor = ({
}
});
}
// eslint-disable-next-line react-hooks/exhaustive-deps
}, [item.settings]);
const styles = useStyles2(getStyles);

View File

@@ -46,12 +46,10 @@ jest.mock('@grafana/runtime', () => ({
// Mock connected child components instead of rendering them
jest.mock('./TeamSettings', () => {
//eslint-disable-next-line
return () => <div>Team settings</div>;
});
jest.mock('./TeamGroupSync', () => {
//eslint-disable-next-line
return () => <div>Team group sync</div>;
});

View File

@@ -105,8 +105,6 @@ const EnumMappingRow = ({
{validationError && <FieldValidationMessage>{validationError}</FieldValidationMessage>}
</td>
) : (
// TODO fix accessibility issue here
// eslint-disable-next-line jsx-a11y/click-events-have-key-events, jsx-a11y/no-noninteractive-element-interactions
<td onClick={onEnumValueClick} className={styles.clickableTableCell}>
{value && value !== '' ? value : t('transformers.enum-mapping-row.click-to-edit', 'Click to edit')}
</td>

View File

@@ -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);

View File

@@ -83,7 +83,7 @@ export const plugin = new PanelPlugin<Options>(GeomapPanel)
id: 'layers',
path: '',
name: '',
// eslint-disable-next-line react/display-name
editor: () => (
<div>
<Trans i18nKey="geomap.plugin.basemap-layer-configured-server-admin">

View File

@@ -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 '';
});
}

View File

@@ -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);
}

View File

@@ -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]
);

View File

@@ -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

View File

@@ -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';

View File

@@ -10,11 +10,8 @@ export function getGrafanaContextMock(overrides: Partial<GrafanaContextType> = {
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(),

View File

@@ -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: {} };

View File

@@ -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';

View File

@@ -1,5 +1,3 @@
/* eslint-disable max-len */
import { GrafanaTheme2 } from '@grafana/data';
import { renderGeneratedFileBanner } from './generatedFileBanner';

View File

@@ -1,5 +1,3 @@
/* eslint-disable max-len */
import { GrafanaTheme2 } from '@grafana/data';
import { renderGeneratedFileBanner } from './generatedFileBanner';

View File

@@ -1,5 +1,3 @@
/* eslint-disable max-len */
import { GrafanaTheme2 } from '@grafana/data';
import { renderGeneratedFileBanner } from './generatedFileBanner';