Alerting: Ignore `mocks` files from betterer checks (#103613)

pull/103772/head
Tom Ratcliffe 3 months ago committed by GitHub
parent 53126eb307
commit ddf3e62b8d
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
  1. 2
      .betterer.eslint.config.js
  2. 8
      .betterer.results
  3. 4
      public/app/features/alerting/unified/mocks.ts

@ -97,7 +97,7 @@ module.exports = [
}, },
{ {
files: ['**/*.{ts,tsx}'], files: ['**/*.{ts,tsx}'],
ignores: ['**/*.{test,spec}.{ts,tsx}', '**/__mocks__/**', '**/public/test/**'], ignores: ['**/*.{test,spec}.{ts,tsx}', '**/__mocks__/**', '**/public/test/**', '**/mocks.{ts,tsx}'],
rules: { rules: {
'@typescript-eslint/consistent-type-assertions': ['error', { assertionStyle: 'never' }], '@typescript-eslint/consistent-type-assertions': ['error', { assertionStyle: 'never' }],
}, },

@ -1440,14 +1440,6 @@ exports[`better eslint`] = {
[0, 0, 0, "Do not use any type assertions.", "0"], [0, 0, 0, "Do not use any type assertions.", "0"],
[0, 0, 0, "No untranslated strings. Wrap text with <Trans />", "1"] [0, 0, 0, "No untranslated strings. Wrap text with <Trans />", "1"]
], ],
"public/app/features/alerting/unified/mocks.ts:5381": [
[0, 0, 0, "Do not use any type assertions.", "0"],
[0, 0, 0, "Do not use any type assertions.", "1"],
[0, 0, 0, "Do not use any type assertions.", "2"],
[0, 0, 0, "Do not use any type assertions.", "3"],
[0, 0, 0, "Do not use any type assertions.", "4"],
[0, 0, 0, "Unexpected any. Specify a different type.", "5"]
],
"public/app/features/alerting/unified/rule-list/components/AlertRuleListItem.tsx:5381": [ "public/app/features/alerting/unified/rule-list/components/AlertRuleListItem.tsx:5381": [
[0, 0, 0, "No untranslated strings in text props. Wrap text with <Trans /> or use t()", "0"] [0, 0, 0, "No untranslated strings in text props. Wrap text with <Trans /> or use t()", "0"]
], ],

@ -10,7 +10,7 @@ import {
ReducerID, ReducerID,
} from '@grafana/data'; } from '@grafana/data';
import { config } from '@grafana/runtime'; import { config } from '@grafana/runtime';
import { defaultDashboard } from '@grafana/schema'; import { DataQuery, defaultDashboard } from '@grafana/schema';
import { contextSrv } from 'app/core/services/context_srv'; import { contextSrv } from 'app/core/services/context_srv';
import { MOCK_GRAFANA_ALERT_RULE_TITLE } from 'app/features/alerting/unified/mocks/server/handlers/grafanaRuler'; import { MOCK_GRAFANA_ALERT_RULE_TITLE } from 'app/features/alerting/unified/mocks/server/handlers/grafanaRuler';
import { ExpressionQuery, ExpressionQueryType, ReducerMode } from 'app/features/expressions/types'; import { ExpressionQuery, ExpressionQueryType, ReducerMode } from 'app/features/expressions/types';
@ -125,7 +125,7 @@ export const mockRulerGrafanaRule = (
datasourceUid: '123', datasourceUid: '123',
refId: 'A', refId: 'A',
queryType: 'huh', queryType: 'huh',
model: {} as any, model: {} as unknown as DataQuery,
}, },
], ],
...partialDef, ...partialDef,

Loading…
Cancel
Save