Skip to content

Commit d6e0f7e

Browse files
Fix ESLint issues
1 parent 368d048 commit d6e0f7e

File tree

13 files changed

+7
-16
lines changed

13 files changed

+7
-16
lines changed

.storybook/manager.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ const sentenceCase = (string) => {
99

1010
addons.setConfig({
1111
sidebar: {
12-
renderLabel: ({ name, type }) => sentenceCase(name),
12+
renderLabel: ({ name }) => sentenceCase(name),
1313
},
1414
theme: nhsTheme,
1515
});

.storybook/preview.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,4 +19,5 @@ const preview: Preview = {
1919
},
2020
},
2121
};
22+
2223
export default preview;

.storybook/theme.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import { create } from '@storybook/theming/create';
2-
const version = require('../package.json').version;
2+
import packageJson from '../package.json' with { type: 'json' };
33

44
export default create({
55
base: 'light',
@@ -31,6 +31,6 @@ export default create({
3131
inputTextColor: '#212b32',
3232
inputBorderRadius: 4,
3333

34-
brandTitle: `NHS.UK React Components (v${version})`,
34+
brandTitle: `NHS.UK React Components (v${packageJson.version})`,
3535
brandUrl: 'https://github.com/NHSDigital/nhsuk-react-components',
3636
});

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

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

1010
export const TableContext = createContext<ITableContext>({
11-
/* eslint-disable @typescript-eslint/no-empty-function */
1211
firstCellIsHeader: false,
1312
headings: [],
1413
responsive: false,

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

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

33-
// eslint-disable-next-line no-console
3433
expect(console.warn).toHaveBeenCalledTimes(1);
35-
// eslint-disable-next-line no-console
3634
expect(console.warn).toHaveBeenLastCalledWith(
3735
'Table.Cell used outside of a Table.Head or Table.Body component. Unable to determine section type from context.',
3836
);

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

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

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

src/components/form-elements/date-input/DateInput.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -95,7 +95,6 @@ const DateInputComponent = forwardRef<HTMLDivElement, DateInputProps>(
9595
inputType="dateinput"
9696
{...rest}
9797
>
98-
{/* eslint-disable-next-line @typescript-eslint/no-unused-vars */}
9998
{({ className, name, id, error, ...restRenderProps }) => {
10099
const contextValue: IDateInputContext = {
101100
id,

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

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

1212
export const DateInputContext = createContext<IDateInputContext>({
13-
/* eslint-disable @typescript-eslint/no-empty-function */
1413
id: '',
1514
name: '',
1615
handleChange: () => {},

src/components/form-elements/radios/RadiosContext.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/card/components/CardGroupItem.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
import classNames from 'classnames';
2-
import React from 'react';
3-
import { Col } from '#components/layout';
2+
import React, { type FC } from 'react';
3+
import { Col, type ColProps } from '#components/layout';
44

5-
export const CardGroupItem: typeof Col = ({ className, ...rest }) => (
5+
export const CardGroupItem: FC<ColProps> = ({ className, ...rest }) => (
66
<Col className={classNames('nhsuk-card-group__item', className)} {...rest} />
77
);
88

0 commit comments

Comments
 (0)