Skip to content

Commit 2029ffe

Browse files
committed
Linting fixes
1 parent dbca7e9 commit 2029ffe

File tree

74 files changed

+346
-203
lines changed

Some content is hidden

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

74 files changed

+346
-203
lines changed

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22

33
NHS.UK Frontend ported to React
44

5-
[![GitHub Actions CI Status](https://github.com/NHSDigital/nhsuk-react-components/workflows/CI/badge.svg)](https://github.com/NHSDigital/nhsuk-react-components/actions?query=workflow%3A%22CI+Build%22+branch%3Amain) [![JavaScript Style Guide](https://img.shields.io/badge/code_style-airbnb-brightgreen.svg)](https://github.com/airbnb/javascript) [![Bundle Size](https://img.shields.io/bundlephobia/minzip/nhsuk-react-components.svg)](https://bundlephobia.com/result?p=nhsuk-react-components)
5+
[![GitHub Actions CI Status](https://github.com/NHSDigital/nhsuk-react-components/workflows/CI/badge.svg)](https://github.com/NHSDigital/nhsuk-react-components/actions?query=workflow%3A%22CI+Build%22+branch%3Amain) [![Bundle Size](https://img.shields.io/bundlephobia/minzip/nhsuk-react-components.svg)](https://bundlephobia.com/result?p=nhsuk-react-components)
66

77
## Coming from 0.x?
88

src/components/action-link/__tests__/ActionLink.test.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import React from 'react';
2-
import ActionLink from '../ActionLink';
32
import { shallow } from 'enzyme';
3+
import ActionLink from '../ActionLink';
44

55
describe('ActionLink', () => {
66
it('matches snapshot', () => {

src/components/back-link/BackLink.tsx

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,12 @@ import classNames from 'classnames';
33
import { ChevronLeft } from '../icons';
44
import type { AsElementLink } from '../../util/types/LinkTypes';
55

6-
const BackLink: React.FC<AsElementLink<HTMLAnchorElement>> = ({
7-
children,
8-
className,
6+
const BackLink: React.FC<AsElementLink<HTMLAnchorElement>> = ({
7+
children,
8+
className,
99
asElement: Component = 'a',
10-
...rest }) => (
10+
...rest
11+
}) => (
1112
<div className="nhsuk-back-link">
1213
<Component className={classNames('nhsuk-back-link__link', className)} {...rest}>
1314
<ChevronLeft />

src/components/back-link/__tests__/BackLink.test.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import React from 'react';
2-
import BackLink from '..';
32
import { shallow } from 'enzyme';
3+
import BackLink from '..';
44

55
describe('BackLink', () => {
66
it('matches snapshot', () => {

src/components/breadcrumb/Breadcrumb.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,9 @@ import type { AsElementLink } from '../../util/types/LinkTypes';
55

66
type Item = React.FC<AsElementLink<HTMLAnchorElement>>;
77

8-
const Item: Item = ({ className, children, asElement: Component = 'a', ...rest }) => (
8+
const Item: Item = ({
9+
className, children, asElement: Component = 'a', ...rest
10+
}) => (
911
<li className="nhsuk-breadcrumb__item">
1012
<Component className={classNames('nhsuk-breadcrumb__link', className)} {...rest}>
1113
{children}

src/components/breadcrumb/__tests__/Breadcrumb.test.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import Breadcrumb from '..';
44

55
describe('Breadcrumb', () => {
66
it('base element matches snapshot', () => {
7-
const component = shallow(<Breadcrumb></Breadcrumb>);
7+
const component = shallow(<Breadcrumb />);
88
expect(component).toMatchSnapshot('BaseBreadcrumbs');
99
component.unmount();
1010
});
@@ -35,7 +35,7 @@ describe('Breadcrumb', () => {
3535
.children();
3636

3737
expect(breadcrumbList.length).toBe(2);
38-
breadcrumbList.toArray().forEach(child => {
38+
breadcrumbList.toArray().forEach((child) => {
3939
expect(child.attribs.class).toBe('nhsuk-breadcrumb__item');
4040
});
4141

src/components/card/Card.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,9 @@ interface ICard extends React.FC<CardProps> {
2424
GroupItem: typeof CardGroupItem;
2525
}
2626

27-
const Card: ICard = ({ className, clickable, children, feature, ...rest }) => (
27+
const Card: ICard = ({
28+
className, clickable, children, feature, ...rest
29+
}) => (
2830
<div
2931
className={classNames(
3032
'nhsuk-card',

src/components/card/__tests__/Card.test.tsx

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,13 @@ describe('Card', () => {
1111
<Card.Content>
1212
<Card.Heading>If you need help now but it&apos;s not an emergency</Card.Heading>
1313
<Card.Description>
14-
Go to <a href="#">111.nhs.uk</a> or <a href="#">call 111</a>
14+
Go to
15+
{' '}
16+
<a href="#">111.nhs.uk</a>
17+
{' '}
18+
or
19+
{' '}
20+
<a href="#">call 111</a>
1521
</Card.Description>
1622
</Card.Content>
1723
</Card>,

src/components/card/components/CardLink.tsx

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@ import React from 'react';
22
import classNames from 'classnames';
33
import type { AsElementLink } from '../../../util/types/LinkTypes';
44

5-
65
const CardLink: React.FC<AsElementLink<HTMLAnchorElement>> = ({
76
className,
87
asElement: Component = 'a',

src/components/care-card/CareCard.tsx

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,9 @@ interface CareCard extends React.FC<CareCardProps> {
7070
Heading: React.FC<CareCardHeadingProps>;
7171
}
7272

73-
const CareCard: CareCard = ({ className, type, children, ...rest }) => (
73+
const CareCard: CareCard = ({
74+
className, type, children, ...rest
75+
}) => (
7476
<div className={classNames('nhsuk-care-card', `nhsuk-care-card--${type}`, className)} {...rest}>
7577
<CareCardContext.Provider value={type}>{children}</CareCardContext.Provider>
7678
</div>

0 commit comments

Comments
 (0)