From 582d1e4f0d68dc083e8d1fdc850f2a057df6502e Mon Sep 17 00:00:00 2001 From: Tom Ratcliffe Date: Thu, 11 Sep 2025 12:55:54 +0100 Subject: [PATCH] Chore: Remove some unnecessary suppressions (#110942) --- eslint-suppressions.json | 33 ------------------- eslint.config.js | 8 +++-- .../grafana-data/test/helpers/pluginMocks.ts | 1 + 3 files changed, 7 insertions(+), 35 deletions(-) diff --git a/eslint-suppressions.json b/eslint-suppressions.json index 3a0c20851cd..8d4775e9a30 100644 --- a/eslint-suppressions.json +++ b/eslint-suppressions.json @@ -1,14 +1,4 @@ { - "apps/dashboard/tshack/v0alpha1_spec_gen.ts": { - "@typescript-eslint/no-explicit-any": { - "count": 1 - } - }, - "apps/dashboard/tshack/v1alpha1_spec_gen.ts": { - "@typescript-eslint/no-explicit-any": { - "count": 1 - } - }, "e2e/cypress/support/commands.js": { "no-restricted-syntax": { "count": 1 @@ -372,11 +362,6 @@ "count": 9 } }, - "packages/grafana-data/test/helpers/pluginMocks.ts": { - "@typescript-eslint/consistent-type-assertions": { - "count": 1 - } - }, "packages/grafana-e2e-selectors/src/resolver.ts": { "@typescript-eslint/consistent-type-assertions": { "count": 1 @@ -2338,11 +2323,6 @@ "count": 10 } }, - "public/app/features/dashboard-scene/v2schema/test-helpers.ts": { - "@typescript-eslint/consistent-type-assertions": { - "count": 3 - } - }, "public/app/features/dashboard/api/ResponseTransformers.ts": { "@typescript-eslint/consistent-type-assertions": { "count": 4 @@ -3310,9 +3290,6 @@ } }, "public/app/features/query/state/DashboardQueryRunner/testHelpers.ts": { - "@typescript-eslint/consistent-type-assertions": { - "count": 1 - }, "@typescript-eslint/no-explicit-any": { "count": 2 } @@ -3413,11 +3390,6 @@ "count": 1 } }, - "public/app/features/templating/template_srv.mock.ts": { - "@typescript-eslint/consistent-type-assertions": { - "count": 4 - } - }, "public/app/features/templating/template_srv.ts": { "@typescript-eslint/consistent-type-assertions": { "count": 3 @@ -4046,11 +4018,6 @@ "count": 1 } }, - "public/app/plugins/datasource/elasticsearch/test-helpers/render.tsx": { - "@typescript-eslint/consistent-type-assertions": { - "count": 1 - } - }, "public/app/plugins/datasource/grafana-postgresql-datasource/configuration/ConfigurationEditor.tsx": { "no-restricted-syntax": { "count": 12 diff --git a/eslint.config.js b/eslint.config.js index cc40a31dce4..508d40808a4 100644 --- a/eslint.config.js +++ b/eslint.config.js @@ -27,9 +27,13 @@ const commonTestIgnores = [ '**/mocks/**/*.{ts,tsx}', '**/public/test/**', '**/mocks.{ts,tsx}', - '**/spec/**/*.{ts,tsx}', + '**/*.mock.{ts,tsx}', + '**/{test-helpers,testHelpers}.{ts,tsx}', + '**/{spec,test-helpers}/**/*.{ts,tsx}', ]; +const generatedFiles = ['**/*.gen.ts', '**/*_gen.ts']; + const enterpriseIgnores = ['public/app/extensions/**/*', 'e2e/extensions/**/*']; // [FIXME] add comment about this applying everywhere @@ -92,7 +96,7 @@ module.exports = [ '.github', '.yarn', '**/.*', // dotfiles aren't ignored by default in FlatConfig - '**/*.gen.ts', + ...generatedFiles, '**/build/', '**/compiled/', '**/dist/', diff --git a/packages/grafana-data/test/helpers/pluginMocks.ts b/packages/grafana-data/test/helpers/pluginMocks.ts index 66139a02e2a..30b6299b2fb 100644 --- a/packages/grafana-data/test/helpers/pluginMocks.ts +++ b/packages/grafana-data/test/helpers/pluginMocks.ts @@ -92,5 +92,6 @@ export function getMockPlugin(overrides?: Partial): PluginMeta { module: 'path/to/module', }; + // eslint-disable-next-line @typescript-eslint/consistent-type-assertions return defaultsDeep(overrides || {}, defaults) as PluginMeta; }