Skip to content

Commit cead093

Browse files
committed
Fixed 96 lint errors found in pipeline during yarn lint:ci
1 parent 0dadd5a commit cead093

Some content is hidden

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

51 files changed

+103
-116
lines changed

.eslintignore

Lines changed: 0 additions & 4 deletions
This file was deleted.

eslint.config.js

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,14 @@ import storybook from 'eslint-plugin-storybook';
99
import globals from 'globals';
1010

1111
export default [
12+
{
13+
ignores: [
14+
'jest.config.js',
15+
'.eslintrc.js',
16+
'rollup.config.mjs',
17+
'dist/'
18+
]
19+
},
1220
js.configs.recommended,
1321
{
1422
files: ['src/**/*.{js,ts,tsx}', 'stories/**/*.{js,ts,tsx}'],

src/components/content-presentation/details/Details.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,14 @@ interface DetailsProps extends HTMLProps<HTMLDetailsElement> {
55
expander?: boolean;
66
}
77

8-
interface Details extends FC<DetailsProps> {
8+
interface DetailsComponent extends FC<DetailsProps> {
99
Summary: FC<HTMLProps<HTMLDivElement>>;
1010
Text: FC<HTMLProps<HTMLDivElement>>;
1111
ExpanderGroup: FC<HTMLProps<HTMLDivElement>>;
1212
}
1313

1414
// TODO: Check if standard NHS.UK polyfill "details.polyfill.js" is required
15-
const Details: Details = ({ className, expander, ...rest }) => (
15+
const Details: DetailsComponent = ({ className, expander, ...rest }) => (
1616
<details
1717
className={classNames('nhsuk-details', { 'nhsuk-expander': expander }, className)}
1818
{...rest}

src/components/content-presentation/do-and-dont-list/DoAndDontList.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,13 @@ interface DoAndDontListProps extends HTMLProps<HTMLDivElement> {
1212
headingLevel?: HeadingLevelType;
1313
}
1414

15-
interface DoAndDontList extends FC<DoAndDontListProps> {
15+
interface DoAndDontListComponent extends FC<DoAndDontListProps> {
1616
Item: FC<DoAndDontItemProps>;
1717
}
1818

1919
const DoAndDontListContext = createContext<ListType>('do');
2020

21-
const DoAndDontList: DoAndDontList = ({
21+
const DoAndDontList: DoAndDontListComponent = ({
2222
className,
2323
listType,
2424
children,

src/components/content-presentation/hero/Hero.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,12 +49,12 @@ interface HeroProps extends HTMLProps<HTMLDivElement> {
4949
imageSrc?: string;
5050
}
5151

52-
interface Hero extends FC<HeroProps> {
52+
interface HeroComponent extends FC<HeroProps> {
5353
Heading: FC<HeroHeadingProps>;
5454
Text: FC<HTMLProps<HTMLParagraphElement>>;
5555
}
5656

57-
const Hero: Hero = ({ className, children, imageSrc, ...rest }) => (
57+
const Hero: HeroComponent = ({ className, children, imageSrc, ...rest }) => (
5858
<section
5959
className={classNames(
6060
'nhsuk-hero',

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/summary-list/SummaryList.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,14 +21,14 @@ interface SummaryListProps extends HTMLProps<HTMLDListElement> {
2121
noBorder?: boolean;
2222
}
2323

24-
interface SummaryList extends FC<SummaryListProps> {
24+
interface SummaryListComponent extends FC<SummaryListProps> {
2525
Row: FC<HTMLProps<HTMLDivElement>>;
2626
Key: FC<HTMLProps<HTMLDListElement>>;
2727
Value: FC<HTMLProps<HTMLDListElement>>;
2828
Actions: FC<HTMLProps<HTMLDListElement>>;
2929
}
3030

31-
const SummaryList: SummaryList = ({ className, noBorder, ...rest }) => (
31+
const SummaryList: SummaryListComponent = ({ className, noBorder, ...rest }) => (
3232
<dl
3333
className={classNames(
3434
'nhsuk-summary-list',

src/components/content-presentation/table/Table.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ interface TableProps extends HTMLProps<HTMLTableElement> {
1515
captionProps?: ComponentProps<typeof TableCaption>;
1616
}
1717

18-
interface Table extends FC<TableProps> {
18+
interface TableComponent extends FC<TableProps> {
1919
Body: FC<HTMLProps<HTMLTableSectionElement>>;
2020
Cell: FC<TableCellProps>;
2121
Container: FC<HTMLProps<HTMLDivElement>>;
@@ -24,7 +24,7 @@ interface Table extends FC<TableProps> {
2424
Row: FC<HTMLProps<HTMLTableRowElement>>;
2525
}
2626

27-
const Table = ({
27+
const Table: TableComponent = ({
2828
caption,
2929
captionProps,
3030
children,

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
);

0 commit comments

Comments
 (0)