Skip to content

Commit 73d0c12

Browse files
committed
1. Fixed missing imports: Added React and JSX imports where needed
2. Removed unused eslint-disable directives: Cleaned up all unnecessary disable comments 3. Fixed unused args parameters in story files: Either removed them when not used or kept them when actually referenced in the render functions 4. Maintained React imports: Made sure not to remove React imports that are actually needed
1 parent 0dadd5a commit 73d0c12

40 files changed

+224
-132
lines changed

eslint.config.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ export default [
5555
'jsx-a11y/alt-text': 0,
5656
'jsx-a11y/heading-has-content': 0,
5757
'react-hooks/exhaustive-deps': 0,
58+
'no-redeclare': 'off',
5859
},
5960
},
6061
{

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,8 @@
5454
"@types/react": "^19.1.12",
5555
"@types/react-dom": "^19",
5656
"@types/stylus": "^0",
57-
"@typescript-eslint/eslint-plugin": "^8.44.0",
58-
"@typescript-eslint/parser": "^8.44.0",
57+
"@typescript-eslint/eslint-plugin": "^7.1.0",
58+
"@typescript-eslint/parser": "^7.1.0",
5959
"eslint": "^9.36.0",
6060
"eslint-config-prettier": "^10.1.8",
6161
"eslint-import-resolver-typescript": "^4.4.4",

src/components/content-presentation/images/Images.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ interface ImageProps extends HTMLProps<HTMLImageElement> {
1010

1111
const Images: FC<ImageProps> = ({ className, caption, ...rest }) => (
1212
<figure className="nhsuk-image">
13-
{/* eslint-disable-next-line jsx-a11y/alt-text */}
1413
<img className={classNames('nhsuk-image__img', className)} {...rest} />
1514
{caption ? <figcaption className="nhsuk-image__caption">{caption}</figcaption> : null}
1615
</figure>

src/components/content-presentation/table/TableContext.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,6 @@ export interface ITableContext {
77
}
88

99
const TableContext = createContext<ITableContext>({
10-
/* eslint-disable @typescript-eslint/no-empty-function */
1110
isResponsive: false,
1211
headings: [],
1312
setHeadings: () => {},

src/components/content-presentation/table/components/__tests__/TableCell.test.tsx

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,9 +26,7 @@ describe('Table.Cell', () => {
2626
</table>,
2727
);
2828

29-
// eslint-disable-next-line no-console
3029
expect(console.warn).toHaveBeenCalledTimes(1);
31-
// eslint-disable-next-line no-console
3230
expect(console.warn).toHaveBeenLastCalledWith(
3331
'Table.Cell used outside of a Table.Head or Table.Body component. Unable to determine section type from context.',
3432
);

src/components/form-elements/button/Button.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,6 @@ export const Button: FC<ButtonProps> = ({
7676
const debouncedHandleClick = useDebounceTimeout(onClick, debounceTimeout);
7777

7878
return (
79-
// eslint-disable-next-line react/button-has-type
8079
<button
8180
className={classNames(
8281
'nhsuk-button',

src/components/form-elements/checkboxes/CheckboxContext.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,6 @@ export interface ICheckboxContext {
88
}
99

1010
export default createContext<ICheckboxContext>({
11-
/* eslint-disable @typescript-eslint/no-empty-function */
1211
name: '',
1312
getBoxId: () => undefined,
1413
leaseReference: () => '',

src/components/form-elements/date-input/DateInputContext.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,6 @@ export type IDateInputContext = {
1111
};
1212

1313
const DateInputContext = createContext<IDateInputContext>({
14-
/* eslint-disable @typescript-eslint/no-empty-function */
1514
id: '',
1615
name: '',
1716
registerRef: () => {},

src/components/form-elements/radios/RadioContext.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,6 @@ export type IRadiosContext = {
1010
};
1111

1212
export const RadiosContext = createContext<IRadiosContext>({
13-
/* eslint-disable @typescript-eslint/no-empty-function */
1413
name: '',
1514
selectedRadio: '',
1615
getRadioId: () => '',

src/components/navigation/footer/Footer.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
/* eslint-disable @typescript-eslint/no-explicit-any */
21
import React, { Children, cloneElement, FC, HTMLProps } from 'react';
32
import classNames from 'classnames';
43
import { Container } from '@components/layout';

0 commit comments

Comments
 (0)