Skip to content

Commit 4d3c412

Browse files
committed
ESLint: Enable recommended jsx-a11y rules and fix issues
This enables recommended rules for jsx-a11y accessibility package and fixes issues in the code.
1 parent 2bc5fec commit 4d3c412

2 files changed

Lines changed: 8 additions & 20 deletions

File tree

eslint.config.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ module.exports = defineConfig([
5858
'react-hooks': pluginReactHooks,
5959
'react-redux': pluginReactRedux,
6060
import: pluginImport,
61-
jsxA11y: pluginJsxA11y,
61+
'jsx-a11y': pluginJsxA11y,
6262
prettier: pluginPrettier,
6363
},
6464
rules: {
@@ -67,6 +67,7 @@ module.exports = defineConfig([
6767
...pluginReact.configs.flat.recommended.rules,
6868
...pluginReactHooks.configs.recommended.rules,
6969
...pluginReactRedux.configs.recommended.rules,
70+
...pluginJsxA11y.configs.recommended.rules,
7071
...fecConfig.rules,
7172
'import/order': ['error', {
7273
groups: ['builtin', 'external', 'internal', 'sibling', 'parent', 'index'],
@@ -132,7 +133,6 @@ module.exports = defineConfig([
132133
varsIgnorePattern: '^_',
133134
},
134135
],
135-
'jsx-a11y/no-autofocus': 'off',
136136
'react-hooks/set-state-in-effect': 'warn', // TODO address issues and enable the rule
137137
'prettier/prettier': ['error', {
138138
semi: true,

src/Components/ImagesTable/ImagesTable.tsx

Lines changed: 6 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -710,7 +710,7 @@ const defaultActions = (
710710
) => {
711711
const name = `request-${compose.id}.json`;
712712

713-
const handleDownload = (e: React.MouseEvent<HTMLAnchorElement>) => {
713+
const handleDownload = (e: React.MouseEvent) => {
714714
e.preventDefault();
715715

716716
const data = JSON.stringify(compose.request, null, 2);
@@ -740,11 +740,8 @@ const defaultActions = (
740740

741741
const actions = [
742742
{
743-
title: (
744-
<a className='ib-subdued-link' href='#' onClick={handleDownload}>
745-
Download compose request (.json)
746-
</a>
747-
),
743+
title: 'Download compose request (.json)',
744+
onClick: handleDownload,
748745
},
749746
];
750747

@@ -753,23 +750,14 @@ const defaultActions = (
753750
const fileBrowserHref =
754751
'/files#/?path=' + encodeURIComponent(parsedPath.dir);
755752

756-
const handleOpenInFileBrowser = (
757-
e: React.MouseEvent<HTMLAnchorElement>,
758-
) => {
753+
const handleOpenInFileBrowser = (e: React.MouseEvent) => {
759754
e.preventDefault();
760755
cockpit.jump(fileBrowserHref, cockpit.transport.host);
761756
};
762757

763758
actions.push({
764-
title: (
765-
<a
766-
className='ib-subdued-link'
767-
href='#'
768-
onClick={handleOpenInFileBrowser}
769-
>
770-
Open in file browser
771-
</a>
772-
),
759+
title: 'Open in file browser',
760+
onClick: handleOpenInFileBrowser,
773761
});
774762
}
775763

0 commit comments

Comments
 (0)