Skip to content

Commit 46e431a

Browse files
TCA-647 #comment This commit fixes all the auto-fixable lint errors that were introduced when we removed prettier. #time 3h
1 parent 03c640d commit 46e431a

File tree

200 files changed

+1199
-1086
lines changed

Some content is hidden

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

200 files changed

+1199
-1086
lines changed

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,7 @@
123123
"eslint-plugin-cypress": "^2.12.1",
124124
"eslint-plugin-import": "^2.25.3",
125125
"eslint-plugin-jsx-a11y": "^6.5.1",
126+
"eslint-plugin-ordered-imports": "^0.6.0",
126127
"eslint-plugin-react": "^7.28.0",
127128
"eslint-plugin-react-hooks": "^4.3.0",
128129
"file-loader": "^6.2.0",

src-ts/.eslintrc.js

Lines changed: 46 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,8 @@ module.exports = {
77
extends: [
88
'plugin:react/recommended',
99
'airbnb',
10-
'plugin:@typescript-eslint/recommended'
10+
'plugin:@typescript-eslint/recommended',
11+
'plugin:ordered-imports/recommended'
1112
],
1213
parser: '@typescript-eslint/parser',
1314
parserOptions: {
@@ -21,6 +22,7 @@ module.exports = {
2122
plugins: [
2223
'react',
2324
'@typescript-eslint',
25+
'ordered-imports',
2426
'react-hooks',
2527
],
2628
settings: {
@@ -99,6 +101,49 @@ module.exports = {
99101
'error',
100102
'before'
101103
],
104+
"ordered-imports/ordered-imports": [
105+
"error",
106+
{
107+
"symbols-first": true,
108+
"declaration-ordering": [
109+
"type", {
110+
ordering: [
111+
"namespace",
112+
"destructured",
113+
"default",
114+
"side-effect",
115+
],
116+
secondaryOrdering: [
117+
"name",
118+
"lowercase-last"
119+
],
120+
}
121+
],
122+
"specifier-ordering": "case-insensitive",
123+
"group-ordering": [
124+
{
125+
name: "project root",
126+
match: "^@",
127+
order: 20
128+
},
129+
{
130+
name: "parent directories",
131+
match: "^\\.\\.",
132+
order: 30
133+
},
134+
{
135+
name: "current directory",
136+
match: "^\\.",
137+
order: 40
138+
},
139+
{
140+
name: "third-party",
141+
match: ".*",
142+
order: 10
143+
},
144+
],
145+
},
146+
],
102147
'padded-blocks': 'off',
103148
"padding-line-between-statements": [
104149
'error',

src-ts/header/Header.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
import { FC } from 'react'
22

3-
import styles from './Header.module.scss'
43
import { Logo } from './logo'
54
import { ToolSelectors } from './tool-selectors'
65
import { UtilitySelectors } from './utility-selectors'
6+
import styles from './Header.module.scss'
77

88
const Header: FC<{}> = () => (
99
<div className={styles['header-wrap']}>

src-ts/header/tool-selectors/ToolSelectors.tsx

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,9 @@ interface ToolSelectorsProps {
77
isWide: boolean
88
}
99

10-
const ToolSelectors: FC<ToolSelectorsProps> = (props: ToolSelectorsProps) => props.isWide ? <ToolSelectorsWide /> : <ToolSelectorsNarrow />
10+
const ToolSelectors: FC<ToolSelectorsProps>
11+
= (props: ToolSelectorsProps) => (props.isWide
12+
? <ToolSelectorsWide />
13+
: <ToolSelectorsNarrow />)
1114

1215
export default ToolSelectors

src-ts/header/tool-selectors/tool-selectors-narrow/ToolSelectorsNarrow.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import classNames from 'classnames'
21
import { Dispatch, FC, SetStateAction, useContext, useState } from 'react'
2+
import classNames from 'classnames'
33

44
import { IconOutline, routeContext, RouteContextData } from '../../../lib'
55

src-ts/header/tool-selectors/tool-selectors-narrow/tool-selector-narrow/ToolSelectorNarrow.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import classNames from 'classnames'
21
import { FC, useContext } from 'react'
32
import { Link, useLocation } from 'react-router-dom'
3+
import classNames from 'classnames'
44

55
import { IconOutline, PlatformRoute, routeContext, RouteContextData, routeIsActiveTool } from '../../../../lib'
66

src-ts/header/tool-selectors/tool-selectors-wide/tool-selector-wide/ToolSelectorWide.tsx

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import classNames from 'classnames'
21
import { FC, useContext } from 'react'
32
import { Link, useLocation } from 'react-router-dom'
3+
import classNames from 'classnames'
44

55
import {
66
PlatformRoute,
@@ -37,8 +37,9 @@ const ToolSelectorWide: FC<ToolSelectorWideProps> = (props: ToolSelectorWideProp
3737
<div className={classNames(
3838
styles[baseClass],
3939
styles[activeIndicatorClass],
40-
isLink ? styles['tool-selector-wide-is-link'] : undefined
41-
)}>
40+
isLink ? styles['tool-selector-wide-is-link'] : undefined,
41+
)}
42+
>
4243
<Link
4344
className='large-tab'
4445
tabIndex={-1}

src-ts/header/utility-selectors/UtilitySelector/ProfileSelector/profile-logged-in/profile-panel/ProfilePanel.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
import classNames from 'classnames'
21
import { FC, useContext } from 'react'
32
import { NavigateFunction, useNavigate } from 'react-router-dom'
3+
import classNames from 'classnames'
44

55
import {
66
authUrlLogout,

src-ts/lib/avatar/Avatar.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import classNames from 'classnames'
21
import { FC } from 'react'
2+
import classNames from 'classnames'
33

44
import styles from './Avatar.module.scss'
55

src-ts/lib/breadcrumb/Breadcrumb.tsx

Lines changed: 52 additions & 50 deletions
Original file line numberDiff line numberDiff line change
@@ -15,58 +15,60 @@ const Breadcrumb: FC<BreadcrumbProps> = (props: BreadcrumbProps) => {
1515
return <></>
1616
}
1717

18-
return createPortal((
19-
<div className={styles['breadcrumb-wrap']}>
20-
<nav className={styles.breadcrumb}>
21-
<ol className='desktop-hide'>
22-
<>
23-
{
24-
props.items.length <= 2 && props.items.map((item, index) =>
25-
<BreadcrumbItem
26-
index={index + 1}
27-
item={item}
28-
key={index}
29-
/>
30-
)
31-
}
32-
33-
{
34-
props.items.length > 2 && (
35-
<>
36-
<BreadcrumbItem
37-
index={0}
38-
item={{
39-
...props.items[props.items.length - 2],
40-
isElipsis: true,
41-
name: '...',
42-
url: props.items[props.items.length - 2].url,
43-
}}
44-
/>
18+
return createPortal(
19+
(
20+
<div className={styles['breadcrumb-wrap']}>
21+
<nav className={styles.breadcrumb}>
22+
<ol className='desktop-hide'>
23+
<>
24+
{
25+
props.items.length <= 2 && props.items.map((item, index) => (
4526
<BreadcrumbItem
46-
index={1}
47-
item={{
48-
...props.items[props.items.length - 1],
49-
name: props.items[props.items.length - 1].name,
50-
url: props.items[props.items.length - 1].url,
51-
}}
27+
index={index + 1}
28+
item={item}
29+
key={index}
5230
/>
53-
</>
54-
)
55-
}
56-
</>
57-
</ol>
58-
<ol className='mobile-hide'>
59-
{props.items.map((item, index) =>
60-
<BreadcrumbItem
61-
index={index + 1}
62-
item={item}
63-
key={index}
64-
/>
65-
)}
66-
</ol>
67-
</nav>
68-
</div>
69-
), portalRootEl)
31+
))
32+
}
33+
34+
{
35+
props.items.length > 2 && (
36+
<>
37+
<BreadcrumbItem
38+
index={0}
39+
item={{
40+
...props.items[props.items.length - 2],
41+
isElipsis: true,
42+
name: '...',
43+
url: props.items[props.items.length - 2].url,
44+
}}
45+
/>
46+
<BreadcrumbItem
47+
index={1}
48+
item={{
49+
...props.items[props.items.length - 1],
50+
name: props.items[props.items.length - 1].name,
51+
url: props.items[props.items.length - 1].url,
52+
}}
53+
/>
54+
</>
55+
)
56+
}
57+
</>
58+
</ol>
59+
<ol className='mobile-hide'>
60+
{props.items.map((item, index) => (
61+
<BreadcrumbItem
62+
index={index + 1}
63+
item={item}
64+
key={index}
65+
/>
66+
))}
67+
</ol>
68+
</nav>
69+
</div>
70+
), portalRootEl,
71+
)
7072
}
7173

7274
export default Breadcrumb

src-ts/lib/breadcrumb/breadcrumb-item/BreadcrumbItem.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
import { FC } from 'react'
22
import { Link } from 'react-router-dom'
33

4-
import styles from "../Breadcrumb.module.scss"
4+
import styles from '../Breadcrumb.module.scss'
5+
56
import { BreadcrumbItemModel } from './breadcrumb-item.model'
67

78
interface BreadcrumbItemProps {

src-ts/lib/button/Button.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
1-
import classNames from 'classnames'
21
import { FC, SVGProps } from 'react'
32
import { Link } from 'react-router-dom'
3+
import classNames from 'classnames'
44

5-
import '../styles/index.scss'
65
import { IconOutline } from '../svgs'
6+
import '../styles/index.scss'
77

88
export type ButtonSize = 'xs' | 'sm' | 'md' | 'lg' | 'xl'
99
export type ButtonStyle = 'icon' | 'icon-bordered' | 'link' | 'primary' | 'secondary' | 'tertiary' | 'text'

src-ts/lib/card/Card.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import classNames from 'classnames'
21
import { FC, ReactNode, SVGProps } from 'react'
2+
import classNames from 'classnames'
33

44
import { ButtonStyle } from '../button'
55
import '../styles/index.scss'

src-ts/lib/contact-support-form/ContactSupportForm.tsx

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,7 +54,9 @@ const ContactSupportForm: FC<ContactSupportFormProps> = (props: ContactSupportFo
5454
const emailElement: JSX.Element | undefined = !!profile?.email
5555
? (
5656
<>
57-
&nbsp;at <strong>{profile.email}</strong>
57+
&nbsp;at
58+
{' '}
59+
<strong>{profile.email}</strong>
5860
</>
5961
)
6062
: undefined
@@ -64,7 +66,10 @@ const ContactSupportForm: FC<ContactSupportFormProps> = (props: ContactSupportFo
6466
<LoadingSpinner hide={!loading} type='Overlay' />
6567
<div className={styles['contact-support-intro']}>
6668
<p>
67-
Hi {profile?.firstName || 'there'}, we're here to help.
69+
Hi
70+
{' '}
71+
{profile?.firstName || 'there'}
72+
, we're here to help.
6873
</p>
6974
<p>
7075
Please describe what you'd like to discuss, and a

src-ts/lib/content-layout/ContentLayout.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
import classNames from 'classnames'
21
import { FC, ReactNode } from 'react'
2+
import classNames from 'classnames'
33

44
import { Button, ButtonProps } from '../button'
55
import '../styles/index.scss'

src-ts/lib/form/Form.tsx

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
1-
import classNames from 'classnames'
21
import {
32
ChangeEvent,
43
createRef,
@@ -10,10 +9,11 @@ import {
109
useEffect,
1110
useState,
1211
} from 'react'
12+
import classNames from 'classnames'
1313

1414
import { Button } from '../button'
15-
import '../styles/index.scss'
1615
import { IconOutline } from '../svgs'
16+
import '../styles/index.scss'
1717

1818
import { FormAction, FormButton, FormDefinition, FormInputModel } from '.'
1919
import {
@@ -145,7 +145,7 @@ const Form: <ValueType extends any, RequestType extends any>(props: FormProps<Va
145145

146146
formInitializeValues(inputs, props.formValues)
147147

148-
const setOnClickOnReset: (button: FormButton) => FormButton = (button) => {
148+
const setOnClickOnReset: (button: FormButton) => FormButton = button => {
149149
// if this is a reset button, set its onclick to reset
150150
if (!!button.isReset) {
151151
button = {
@@ -193,7 +193,7 @@ const Form: <ValueType extends any, RequestType extends any>(props: FormProps<Va
193193

194194
return (
195195
<form
196-
action=""
196+
action=''
197197
className={styles.form}
198198
key={formKey}
199199
onSubmit={onSubmitAsync}

src-ts/lib/form/form-functions/form.functions.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ export async function onSubmitAsync<T>(
6868
formValue: T,
6969
save: (value: T) => Promise<void>,
7070
onSuccess?: () => void,
71-
customValidateForm?: (formElements: HTMLFormControlsCollection, event: ValidationEvent, inputs: ReadonlyArray<FormInputModel>) => boolean
71+
customValidateForm?: (formElements: HTMLFormControlsCollection, event: ValidationEvent, inputs: ReadonlyArray<FormInputModel>) => boolean,
7272
): Promise<void> {
7373

7474
event.preventDefault()
@@ -94,7 +94,7 @@ export async function onSubmitAsync<T>(
9494

9595
// set the properties for the updated T value
9696
inputs
97-
.forEach((field) => {
97+
.forEach(field => {
9898
(formValue as any)[field.name] = field.value
9999
})
100100

@@ -186,7 +186,7 @@ function validateField(formInputDef: FormInputModel, formElements: HTMLFormContr
186186
})
187187
}
188188

189-
export type ValidationEvent = 'blur' | 'change' | 'submit' | 'initial'
189+
export type ValidationEvent = 'blur' | 'change' | 'submit' | 'initial'
190190

191191
export function validateForm(formElements: HTMLFormControlsCollection, event: ValidationEvent, inputs: ReadonlyArray<FormInputModel>): boolean {
192192
const errors: ReadonlyArray<FormInputModel> = inputs?.filter(formInputDef => {

src-ts/lib/form/form-groups/FormGroups.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,10 @@ import { FormGroup } from '../form-group.model'
66
import { FormInputModel } from '../form-input.model'
77

88
import { FormCardSet } from './form-card-set'
9-
import FormGroupItem from './form-group-item/FormGroupItem'
109
import { InputImagePicker, InputRating, InputText, InputTextarea } from './form-input'
1110
import { FormInputRow } from './form-input-row'
1211
import { InputTextTypes } from './form-input/input-text/InputText'
12+
import FormGroupItem from './form-group-item/FormGroupItem'
1313
import FormRadio from './form-radio'
1414
import styles from './FormGroups.module.scss'
1515

0 commit comments

Comments
 (0)