Skip to content

Commit a125b21

Browse files
authored
Merge pull request #146 from SUSE/revert-128-fix/warnings-and-linter-corrections
Revert "Clean up all ESLint warnings and harden lint git hook gate"
2 parents 0758672 + e437bae commit a125b21

97 files changed

Lines changed: 1695 additions & 3984 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

package-lock.json

Lines changed: 0 additions & 232 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pkg/aif-ui/.eslintrc.js

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,8 @@ module.exports = {
55
node: true
66
},
77
globals: {
8-
NodeJS: true,
9-
Timer: true,
10-
RequestInit: true
8+
NodeJS: true,
9+
Timer: true
1110
},
1211
parser: 'vue-eslint-parser',
1312
parserOptions: {
@@ -71,7 +70,7 @@ module.exports = {
7170
'no-eq-null': 'off',
7271
'no-eval': 'warn',
7372
'no-undef': 'warn',
74-
'no-unused-vars': 'off',
73+
'no-unused-vars': 'warn',
7574
'no-whitespace-before-property': 'off',
7675
'object-curly-spacing': 'off',
7776
'object-shorthand': 'off',
@@ -93,7 +92,7 @@ module.exports = {
9392
'vue/v-slot-style': 'off',
9493
'vue/component-tags-order': 'off',
9594
'vue/no-mutating-props': 'off',
96-
'@typescript-eslint/no-unused-vars': ['warn', { varsIgnorePattern: '^_', argsIgnorePattern: '^_', ignoreRestSiblings: true }],
95+
'@typescript-eslint/no-unused-vars': 'off',
9796
'@typescript-eslint/no-var-requires': 'off',
9897
'@typescript-eslint/no-this-alias': 'off',
9998
'array-callback-return': 'off',

pkg/aif-ui/components/OperatorErrorBanner.vue

Lines changed: 5 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,8 @@ import { PRODUCT, PAGE_TYPES } from '../config/suseai';
66
defineProps<{ operatorError: string }>();
77
defineEmits<{ retry: [] }>();
88
9-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
10-
const vm = getCurrentInstance()?.proxy as any; // Vue component proxy has $route but no type declaration in this context
11-
const cluster = (vm?.$route?.params?.cluster as string) || '_';
9+
const vm = getCurrentInstance()!.proxy as any;
10+
const cluster = (vm.$route?.params?.cluster as string) || '_';
1211
1312
const settingsRoute = {
1413
name: `c-cluster-${ PRODUCT }-${ PAGE_TYPES.SETTINGS }`,
@@ -18,28 +17,17 @@ const settingsRoute = {
1817
</script>
1918

2019
<template>
21-
<Banner
22-
color="error"
23-
class="mb-20"
24-
>
20+
<Banner color="error" class="mb-20">
2521
<div class="operator-error-body">
2622
<div class="operator-error-text">
2723
<div>{{ operatorError }}</div>
2824
<div>
2925
Update <strong>Operator Namespace</strong> under
3026
<em>Settings → Advanced → Operator Connection</em>.
31-
<RouterLink :to="settingsRoute">
32-
Go to Settings →
33-
</RouterLink>
27+
<RouterLink :to="settingsRoute">Go to Settings →</RouterLink>
3428
</div>
3529
</div>
36-
<button
37-
class="btn-retry"
38-
type="button"
39-
@click="$emit('retry')"
40-
>
41-
Retry Connection
42-
</button>
30+
<button class="btn-retry" type="button" @click="$emit('retry')">Retry Connection</button>
4331
</div>
4432
</Banner>
4533
</template>

pkg/aif-ui/composables/useT.ts

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,7 @@ import { getCurrentInstance } from 'vue';
88
* `getCurrentInstance()` resolves to the calling component.
99
*/
1010
export function useT() {
11-
// eslint-disable-next-line @typescript-eslint/no-explicit-any
12-
const store = (getCurrentInstance()?.proxy as any)?.$store; // Vue component proxy has $store but no type declaration in this context
11+
const store = (getCurrentInstance()!.proxy as any)?.$store;
1312

1413
return (key: string, fallback: string): string => store?.getters['i18n/t']?.(key) || fallback;
1514
}

pkg/aif-ui/config/doc-links.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -312,7 +312,7 @@ export function getDocLink(id: string): DocLink | null {
312312
* Get all categories with link counts
313313
*/
314314
export function getCategoriesWithCounts(): Array<{ category: DocCategory; count: number; name: string }> {
315-
const counts: Record<DocCategory, number> = {} as Record<DocCategory, number>;
315+
const counts: Record<DocCategory, number> = {} as any;
316316

317317
Object.values(DOCUMENTATION_LINKS).forEach(link => {
318318
counts[link.category] = (counts[link.category] || 0) + 1;

pkg/aif-ui/config/i18n.ts

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22
* Internationalization configuration for SUSE AI Extension
33
* Following Rancher UI patterns for consistent i18n implementation
44
*/
5-
import logger from '../utils/logger';
65

76
export interface TranslationKey {
87
[key: string]: string | TranslationKey;
@@ -225,11 +224,11 @@ export const translations: Translations = {
225224
* Get translated string by key
226225
* Supports nested keys with dot notation (e.g., 'suseai.apps.title')
227226
*/
228-
export function t(key: string, params?: Record<string, unknown>, locale: string = DEFAULT_LOCALE): string {
227+
export function t(key: string, params?: Record<string, any>, locale: string = DEFAULT_LOCALE): string {
229228
const translation = getNestedValue(translations[locale] || translations[DEFAULT_LOCALE], key);
230229

231230
if (typeof translation !== 'string') {
232-
logger.warn(`Translation key not found: ${key}`);
231+
console.warn(`Translation key not found: ${key}`);
233232
return key;
234233
}
235234

@@ -246,12 +245,9 @@ export function t(key: string, params?: Record<string, unknown>, locale: string
246245
/**
247246
* Get nested value from object using dot notation
248247
*/
249-
function getNestedValue(obj: unknown, path: string): unknown {
250-
return path.split('.').reduce((current: unknown, key: string) => {
251-
if (current && typeof current === 'object') {
252-
return (current as Record<string, unknown>)[key];
253-
}
254-
return undefined;
248+
function getNestedValue(obj: any, path: string): any {
249+
return path.split('.').reduce((current, key) => {
250+
return current && current[key] !== undefined ? current[key] : undefined;
255251
}, obj);
256252
}
257253

@@ -274,5 +270,5 @@ export function getAvailableLocales(): readonly string[] {
274270
* Validate locale
275271
*/
276272
export function isValidLocale(locale: string): boolean {
277-
return (AVAILABLE_LOCALES as readonly string[]).includes(locale);
273+
return AVAILABLE_LOCALES.includes(locale as any);
278274
}

0 commit comments

Comments
 (0)