From 16668b993fda9688992d507e1fffb09e62183846 Mon Sep 17 00:00:00 2001 From: Tom Ratcliffe Date: Wed, 14 May 2025 19:30:52 +0100 Subject: [PATCH] Alerting: Enable alerting eslint overrides for package (#104678) --- eslint.config.js | 4 ++-- packages/grafana-alerting/src/grafana/api/v0alpha1/types.ts | 2 +- .../src/grafana/contactPoints/hooks/useContactPoints.tsx | 4 ++-- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/eslint.config.js b/eslint.config.js index bae736ad3d4..f0a2ecd0407 100644 --- a/eslint.config.js +++ b/eslint.config.js @@ -269,7 +269,7 @@ module.exports = [ react: reactPlugin, '@grafana': grafanaPlugin, }, - files: ['public/app/features/alerting/**/*.{ts,tsx,js,jsx}'], + files: ['public/app/features/alerting/**/*.{ts,tsx,js,jsx}', 'packages/grafana-alerting/**/*.{ts,tsx,js,jsx}'], rules: { 'sort-imports': ['error', { ignoreDeclarationSort: true }], 'dot-notation': 'error', @@ -310,7 +310,7 @@ module.exports = [ files: [ 'public/app/features/alerting/**/__tests__/**/*.[jt]s?(x)', 'public/app/features/alerting/**/?(*.)+(spec|test).[jt]s?(x)', - 'packages/grafana-ui/**/*.{spec,test}.{ts,tsx}', + 'packages/{grafana-ui,grafana-alerting}/**/*.{spec,test}.{ts,tsx}', ], rules: { ...testingLibraryPlugin.configs['flat/react'].rules, diff --git a/packages/grafana-alerting/src/grafana/api/v0alpha1/types.ts b/packages/grafana-alerting/src/grafana/api/v0alpha1/types.ts index c7947b9151c..c69f9312fec 100644 --- a/packages/grafana-alerting/src/grafana/api/v0alpha1/types.ts +++ b/packages/grafana-alerting/src/grafana/api/v0alpha1/types.ts @@ -3,7 +3,7 @@ */ import { MergeDeep, MergeExclusive, OverrideProperties } from 'type-fest'; -import type { Receiver, Integration as ReceiverIntegration, ListReceiverApiResponse } from './api.gen'; +import type { ListReceiverApiResponse, Receiver, Integration as ReceiverIntegration } from './api.gen'; type GenericIntegration = OverrideProperties< ReceiverIntegration, diff --git a/packages/grafana-alerting/src/grafana/contactPoints/hooks/useContactPoints.tsx b/packages/grafana-alerting/src/grafana/contactPoints/hooks/useContactPoints.tsx index 8c574c3be25..43aa3d7bbe4 100644 --- a/packages/grafana-alerting/src/grafana/contactPoints/hooks/useContactPoints.tsx +++ b/packages/grafana-alerting/src/grafana/contactPoints/hooks/useContactPoints.tsx @@ -1,6 +1,6 @@ -import { fetchBaseQuery, TypedUseQueryHookResult } from '@reduxjs/toolkit/query/react'; +import { TypedUseQueryHookResult, fetchBaseQuery } from '@reduxjs/toolkit/query/react'; -import { alertingAPI, type ListReceiverApiArg } from '../../api/v0alpha1/api.gen'; +import { type ListReceiverApiArg, alertingAPI } from '../../api/v0alpha1/api.gen'; import type { EnhancedListReceiverApiResponse } from '../../api/v0alpha1/types'; // this is a workaround for the fact that the generated types are not narrow enough