Skip to content

Commit 175de41

Browse files
Linter - bugfixes - part two (#82)
1 parent 716ef83 commit 175de41

20 files changed

+58
-40
lines changed

eslint.config.js

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ import jestDom from "eslint-plugin-jest-dom";
88
import jsxA11y from "eslint-plugin-jsx-a11y";
99
import reactPlugin from "eslint-plugin-react";
1010
import reactHooks from "eslint-plugin-react-hooks";
11-
import reactRefresh from "eslint-plugin-react-refresh";
1211

1312
const flat = typescriptEslint.config(
1413
eslint.configs.recommended,
@@ -243,9 +242,6 @@ const flatReact = [
243242
"react-hooks/rules-of-hooks": "error",
244243
},
245244
},
246-
{
247-
...reactRefresh.configs.recommended,
248-
},
249245
{
250246
// https://github.com/vitest-dev/eslint-plugin-vitest
251247
files: ["**/*.{test,spec}.{ts,tsx}"],

package-lock.json

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

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,6 @@
6464
"eslint-plugin-prettier": "^5.2.3",
6565
"eslint-plugin-react": "^7.37.4",
6666
"eslint-plugin-react-hooks": "^5.2.0",
67-
"eslint-plugin-react-refresh": "^0.4.19",
6867
"globals": "^16.0.0",
6968
"prettier": "^3.5.3",
7069
"sass-embedded": "^1.86.0",

src/components/ControlPlane/MCPHealthPopoverButton.tsx

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,8 +21,10 @@ export default function MCPHealthPopoverButton({
2121

2222
const { t } = useTranslation();
2323

24+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
2425
const handleOpenerClick = (e: any) => {
2526
if (popoverRef.current) {
27+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
2628
const ref = popoverRef.current as any;
2729
ref.opener = e.target;
2830
setOpen((prev) => !prev);
@@ -34,6 +36,7 @@ export default function MCPHealthPopoverButton({
3436
Header: t('MCPHealthPopoverButton.statusHeader'),
3537
accessor: 'status',
3638
width: 50,
39+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
3740
Cell: (instance: any) => {
3841
const isReady = instance.cell.value === 'True';
3942
return (
@@ -59,6 +62,7 @@ export default function MCPHealthPopoverButton({
5962
{
6063
Header: t('MCPHealthPopoverButton.transitionHeader'),
6164
accessor: 'lastTransitionTime',
65+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
6266
Cell: (instance: any) => {
6367
return <ReactTimeAgo date={new Date(instance.cell.value)} />;
6468
},

src/components/ControlPlanes/ConnectButton.tsx

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,8 +24,10 @@ export default function ConnectButton(props: Props) {
2424
const navigate = useLuigiNavigate();
2525
const popoverRef = useRef(null);
2626
const [open, setOpen] = useState(false);
27+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
2728
const handleOpenerClick = (e: any) => {
2829
if (popoverRef.current) {
30+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
2931
const ref = popoverRef.current as any;
3032
ref.opener = e.target;
3133
setOpen((prev) => !prev);
@@ -40,8 +42,10 @@ export default function ConnectButton(props: Props) {
4042
if (res.isLoading) {
4143
return <></>;
4244
}
45+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
4346
const kubeconfig = yaml.load(res.data as string) as any;
4447

48+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
4549
const contexts = kubeconfig.contexts as any[];
4650
const currentContext = kubeconfig['current-context'];
4751
if (!currentContext) {
@@ -89,6 +93,7 @@ export default function ConnectButton(props: Props) {
8993
}
9094
}}
9195
>
96+
{/* eslint-disable-next-line @typescript-eslint/no-explicit-any */}
9297
{contexts.map((context: any) => (
9398
<MenuItem
9499
key={context.name}

src/components/ControlPlanes/CopyKubeconfigButton.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,10 @@ export default function CopyKubeconfigButton() {
1212
const { show } = useToast();
1313
const { t } = useTranslation();
1414

15+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
1516
const handleOpenerClick = (e: any) => {
1617
if (popoverRef.current) {
18+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
1719
const ref = popoverRef.current as any;
1820
ref.opener = e.target;
1921
setOpen((prev) => !prev);
@@ -65,6 +67,7 @@ export default function CopyKubeconfigButton() {
6567
);
6668
}
6769

70+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
6871
export function DownloadKubeconfig(config: any, displayName: string) {
6972
const filename = 'kubeconfig-' + displayName + '.yaml';
7073

@@ -84,7 +87,6 @@ export function DownloadKubeconfig(config: any, displayName: string) {
8487
document.body.removeChild(link);
8588
window.URL.revokeObjectURL(url);
8689
} catch (error) {
87-
debugger;
8890
console.error(error);
8991
}
9092
// dynaLeaveAction(id);

src/components/Core/DarkModeSystemSwitcher.tsx

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -2,29 +2,29 @@ import { useEffect } from 'react';
22
import { setTheme } from '@ui5/webcomponents-base/dist/config/Theme.js';
33

44
export function DarkModeSystemSwitcher() {
5-
if (window.matchMedia) {
6-
useEffect(() => {
7-
window
8-
.matchMedia('(prefers-color-scheme: dark)')
9-
.addEventListener('change', (e) =>
10-
setTheme(e.matches ? 'sap_horizon_dark' : 'sap_horizon'),
11-
);
5+
useEffect(() => {
6+
if (!window.matchMedia) {
7+
console.warn(
8+
'Dark mode system switcher is not supported in this browser',
9+
);
10+
return;
11+
}
1212

13-
const initialMode = window.matchMedia('(prefers-color-scheme: dark)')
14-
.matches
15-
? 'sap_horizon_dark'
16-
: 'sap_horizon';
17-
setTheme(initialMode);
13+
const mediaQuery = window.matchMedia('(prefers-color-scheme: dark)');
1814

19-
return () => {
20-
window
21-
.matchMedia('(prefers-color-scheme: dark)')
22-
.removeEventListener('change', () => {});
23-
};
24-
}, []);
25-
} else {
26-
console.warn('Dark mode system switcher is not supported in this browser');
27-
}
15+
const handleChange = (e: MediaQueryListEvent) => {
16+
setTheme(e.matches ? 'sap_horizon_dark' : 'sap_horizon');
17+
};
2818

29-
return <></>;
19+
mediaQuery.addEventListener('change', handleChange);
20+
21+
const initialMode = mediaQuery.matches ? 'sap_horizon_dark' : 'sap_horizon';
22+
setTheme(initialMode);
23+
24+
return () => {
25+
mediaQuery.removeEventListener('change', handleChange);
26+
};
27+
}, []);
28+
29+
return null; // albo <></>
3030
}

src/components/Core/IntelligentBreadcrumbs.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ const PREFIX = '/mcp';
1414
function navigateFromBreadcrumbs(
1515
navigate: (to: string, options?: NavigateOptions) => void,
1616
) {
17+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
1718
return (event: Ui5CustomEvent<BreadcrumbsDomRef, any>) => {
1819
event.preventDefault();
1920
// @ts-ignore

src/components/Dialogs/CreateProjectDialog.test.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@ import { validationSchemaProjectWorkspace } from '../../lib/api/validations/sche
1212
import { CreateDialogProps } from './CreateWorkspaceDialogContainer.tsx';
1313

1414
export const CreateProjectWorkspaceDialogWrapper: React.FC<{
15-
spyFormBody?: (data: any) => {};
15+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
16+
spyFormBody?: (data: any) => object;
1617
}> = ({ spyFormBody }) => {
1718
const [isOpen, setIsOpen] = useState(true);
1819

src/components/Dialogs/DeleteConfirmationDialog.tsx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,7 @@ export function DeleteConfirmationDialog({
4343
};
4444
}, [isOpen]);
4545

46+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
4647
const onConfirmationInputChange = (event: any) => {
4748
if (event.target.value === resourceName) {
4849
setConfirmed(true);

0 commit comments

Comments
 (0)