Chore: Add no-duplicate-case eslint rule and fix violations (#97537)

* Add `no-duplicate-case` rule

* Fix basic duplicated cases

* Fix duplicated translations case

* Fix alerting case
This commit is contained in:
Tom Ratcliffe
2024-12-11 17:33:31 +00:00
committed by GitHub
parent c5e8e71ee3
commit 084aad0b84
6 changed files with 2 additions and 10 deletions

View File

@@ -85,6 +85,7 @@ module.exports = [
}, },
rules: { rules: {
'no-duplicate-case': 'error',
'@grafana/no-border-radius-literal': 'error', '@grafana/no-border-radius-literal': 'error',
'@grafana/no-unreduced-motion': 'error', '@grafana/no-unreduced-motion': 'error',
'react/prop-types': 'off', 'react/prop-types': 'off',

View File

@@ -153,8 +153,6 @@ export function getNavTitle(navId: string | undefined) {
return t('nav.slo.title', 'SLO'); return t('nav.slo.title', 'SLO');
case 'plugin-page-k6-app': case 'plugin-page-k6-app':
return t('nav.k6.title', 'Performance'); return t('nav.k6.title', 'Performance');
case 'monitoring':
return t('nav.observability.title', 'Observability');
case 'plugin-page-grafana-k8s-app': case 'plugin-page-grafana-k8s-app':
return t('nav.kubernetes.title', 'Kubernetes'); return t('nav.kubernetes.title', 'Kubernetes');
case 'plugin-page-grafana-dbo11y-app': case 'plugin-page-grafana-dbo11y-app':

View File

@@ -44,7 +44,7 @@ function useExpressionsCache() {
// We want to use the same value for Reduce, Resample and Threshold // We want to use the same value for Reduce, Resample and Threshold
case ExpressionQueryType.reduce: case ExpressionQueryType.reduce:
case ExpressionQueryType.resample: case ExpressionQueryType.resample:
case ExpressionQueryType.resample: case ExpressionQueryType.threshold:
expressionCache.current.reduce = value; expressionCache.current.reduce = value;
expressionCache.current.resample = value; expressionCache.current.resample = value;
expressionCache.current.threshold = value; expressionCache.current.threshold = value;

View File

@@ -82,7 +82,6 @@ function parseKeyValuePairs(raw: string): Record<string, string> {
case `'`: case `'`:
// whitespace // whitespace
case ` `: case ` `:
case `\n`:
case `\t`: case `\t`:
case `\r`: case `\r`:
case `\n`: case `\n`:

View File

@@ -2203,9 +2203,6 @@
"new-folder": { "new-folder": {
"title": "New folder" "title": "New folder"
}, },
"observability": {
"title": "Observability"
},
"oncall": { "oncall": {
"title": "OnCall" "title": "OnCall"
}, },

View File

@@ -2203,9 +2203,6 @@
"new-folder": { "new-folder": {
"title": "Ńęŵ ƒőľđęř" "title": "Ńęŵ ƒőľđęř"
}, },
"observability": {
"title": "Øþşęřväþįľįŧy"
},
"oncall": { "oncall": {
"title": "ØʼnCäľľ" "title": "ØʼnCäľľ"
}, },