Chore: Update eslint configs to ignore /spec/ files when necessary (#104377)

This commit is contained in:
Tom Ratcliffe
2025-04-23 10:24:26 +01:00
committed by GitHub
parent 9a7cb96eb0
commit f9fb6f3b88
5 changed files with 11 additions and 11 deletions
+8 -2
View File
@@ -96,8 +96,14 @@ module.exports = [
},
},
{
files: ['**/*.{ts,tsx}'],
ignores: ['**/*.{test,spec}.{ts,tsx}', '**/__mocks__/**', '**/public/test/**', '**/mocks.{ts,tsx}'],
files: ['**/*.{js,jsx,ts,tsx}'],
ignores: [
'**/*.{test,spec}.{ts,tsx}',
'**/__mocks__/**',
'**/public/test/**',
'**/mocks.{ts,tsx}',
'**/spec/**/*.{ts,tsx}',
],
rules: {
'@typescript-eslint/consistent-type-assertions': ['error', { assertionStyle: 'never' }],
},
+1 -2
View File
@@ -1723,8 +1723,7 @@ exports[`better eslint`] = {
[0, 0, 0, "Do not re-export imported variable (\`./external.utils\`)", "0"]
],
"public/app/features/explore/spec/helper/setup.tsx:5381": [
[0, 0, 0, "Do not use any type assertions.", "0"],
[0, 0, 0, "Unexpected any. Specify a different type.", "1"]
[0, 0, 0, "Unexpected any. Specify a different type.", "0"]
],
"public/app/features/explore/state/time.test.ts:5381": [
[0, 0, 0, "Unexpected any. Specify a different type.", "0"]
+1
View File
@@ -284,6 +284,7 @@ module.exports = [
'**/*.{test,spec}.{ts,tsx}',
'**/__mocks__/',
'public/test',
'**/spec/**/*.{ts,tsx}',
],
rules: {
'@grafana/no-untranslated-strings': 'error',
@@ -34,7 +34,6 @@ import {
import { DataSourceRef } from '@grafana/schema';
import { AppChrome } from 'app/core/components/AppChrome/AppChrome';
import { GrafanaContext } from 'app/core/context/GrafanaContext';
import { t } from 'app/core/internationalization';
import { GrafanaRoute } from 'app/core/navigation/GrafanaRoute';
import { Echo } from 'app/core/services/echo/Echo';
import { setLastUsedDatasourceUID } from 'app/core/utils/explore';
@@ -291,11 +290,9 @@ export function makeDatasourceSetup({
components: {
QueryEditor(props: QueryEditorProps<LokiDatasource, LokiQuery>) {
return (
// don't need translations, this is a test helper
// eslint-disable-next-line @grafana/no-untranslated-strings
<div>
<input
aria-label={t('explore.make-datasource-setup.aria-label-query', 'query')}
aria-label="query"
defaultValue={props.query.expr}
onChange={(event) => {
props.onChange({ ...props.query, expr: event.target.value });
-3
View File
@@ -4739,9 +4739,6 @@
"logs-volumne-panel-list": {
"body-no-logs-volume-available": "No volume information available for the current queries and time range."
},
"make-datasource-setup": {
"aria-label-query": "query"
},
"next": "Next",
"next-prev-result": {
"aria-label-next": "Next result button",