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

0 commit comments

Comments
 (0)