Skip to content

Commit c388fbd

Browse files
Merge branch 'develop' into feat/MetisNetwork
2 parents beb9173 + 96495a4 commit c388fbd

File tree

112 files changed

+445
-510
lines changed

Some content is hidden

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

112 files changed

+445
-510
lines changed

.eslintrc.json

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
"env": {
88
"node": true
99
},
10-
"plugins": ["unused-imports", "lodash"],
10+
"plugins": ["unused-imports"],
1111
"rules": {
1212
"constructor-super": "error",
1313
"dot-notation": "error",
@@ -37,7 +37,6 @@
3737
"no-template-curly-in-string": "error",
3838
"prefer-const": "warn",
3939
"use-isnan": "error",
40-
"unused-imports/no-unused-imports-ts": "error",
41-
"lodash/import-scope": ["error", "member"]
40+
"unused-imports/no-unused-imports-ts": "error"
4241
}
4342
}

.vscode/extensions.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
"editorconfig.editorconfig",
1010
"aaron-bond.better-comments",
1111
"davidanson.vscode-markdownlint",
12-
"jpoissonnier.vscode-styled-components",
12+
"diegolincoln.vscode-styled-components",
1313
"christian-kohler.path-intellisense"
1414
],
1515
// List of extensions recommended by VS Code that should not be recommended for users of this workspace.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,7 @@
5252
"devDependencies": {
5353
"@commitlint/cli": "^16.0.0",
5454
"@commitlint/config-conventional": "^16.0.0",
55+
"@dimensiondev/eslint-plugin": "^0.0.1-20211222115249-7984aa5",
5556
"@dimensiondev/patch-package": "^6.5.0",
5657
"@jest/globals": "^27.4.4",
5758
"@magic-works/i18n-codegen": "^0.0.6",
@@ -63,7 +64,6 @@
6364
"eslint": "8.5.0",
6465
"eslint-config-prettier": "^8.3.0",
6566
"eslint-plugin-import": "2.25.3",
66-
"eslint-plugin-lodash": "^7.3.0",
6767
"eslint-plugin-prettier": "^4.0.0",
6868
"eslint-plugin-react": "^7.28.0",
6969
"eslint-plugin-react-hooks": "^4.3.0",

packages/.eslintrc.json

Lines changed: 27 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,14 @@
11
{
22
"root": true,
33
"parser": "@typescript-eslint/parser",
4-
"parserOptions": { "ecmaVersion": 7, "sourceType": "module", "project": "./tsconfig.eslint.json" },
4+
"parserOptions": {
5+
"ecmaVersion": 7,
6+
"sourceType": "module",
7+
"project": "./tsconfig.eslint.json",
8+
"warnOnUnsupportedTypeScriptVersion": false
9+
},
510
"extends": ["../.eslintrc.json", "plugin:import/typescript"],
6-
"plugins": ["@typescript-eslint", "unused-imports", "lodash", "import", "unicorn", "react", "react-hooks"],
11+
"plugins": ["@typescript-eslint", "@dimensiondev", "unused-imports", "import", "unicorn", "react", "react-hooks"],
712
"rules": {
813
"no-restricted-imports": [
914
"error",
@@ -21,6 +26,13 @@
2126
"yoda": "error",
2227
"radix": "error",
2328
"eqeqeq": ["error", "always"],
29+
"import/no-deprecated": "warn",
30+
"no-cond-assign": "error",
31+
"no-constant-condition": "error",
32+
"no-script-url": "error",
33+
"no-throw-literal": "error",
34+
"no-unmodified-loop-condition": "error",
35+
"no-useless-concat": "error",
2436
"prefer-regex-literals": "error",
2537
"react/jsx-boolean-value": "error",
2638
"react/jsx-curly-brace-presence": ["warn", { "props": "never", "children": "never" }],
@@ -30,9 +42,6 @@
3042
"react/self-closing-comp": ["warn", { "component": true, "html": true }],
3143
"react-hooks/exhaustive-deps": "off",
3244
"react-hooks/rules-of-hooks": "error",
33-
"import/no-deprecated": "warn",
34-
"lodash/import-scope": ["error", "member"],
35-
"unused-imports/no-unused-imports-ts": "warn",
3645
"unicorn/better-regex": "error",
3746
"unicorn/catch-error-name": ["error", { "ignore": ["^err$"] }],
3847
"unicorn/no-instanceof-array": "error",
@@ -43,19 +52,30 @@
4352
"unicorn/prefer-dom-node-dataset": "error",
4453
"unicorn/prefer-number-properties": "error",
4554
"unicorn/throw-new-error": "error",
55+
"unused-imports/no-unused-imports-ts": "error",
56+
"@dimensiondev/no-jsx-template-literal": "error",
57+
"@dimensiondev/no-number-constructor": "off",
58+
"@dimensiondev/no-simple-template-literal": "error",
59+
"@dimensiondev/no-unsafe-location": "error",
60+
"@dimensiondev/prefer-early-return": "error",
4661
"@typescript-eslint/await-thenable": "error",
62+
"@typescript-eslint/no-base-to-string": "off",
4763
"@typescript-eslint/no-for-in-array": "error",
4864
"@typescript-eslint/no-implied-eval": "error",
65+
"@typescript-eslint/no-inferrable-types": "error",
4966
"@typescript-eslint/no-invalid-this": "error",
5067
"@typescript-eslint/no-loop-func": "error",
5168
"@typescript-eslint/no-this-alias": "error",
69+
"@typescript-eslint/prefer-enum-initializers": "error",
5270
"@typescript-eslint/prefer-for-of": "error",
5371
"@typescript-eslint/prefer-includes": "error",
72+
"@typescript-eslint/prefer-literal-enum-member": "error",
5473
"@typescript-eslint/prefer-nullish-coalescing": "error",
5574
"@typescript-eslint/prefer-optional-chain": "error",
5675
"@typescript-eslint/prefer-reduce-type-parameter": "error",
76+
"@typescript-eslint/prefer-regexp-exec": "off",
5777
"@typescript-eslint/prefer-string-starts-ends-with": "error",
58-
"@typescript-eslint/prefer-enum-initializers": "error",
59-
"@typescript-eslint/prefer-literal-enum-member": "error"
78+
"@typescript-eslint/restrict-plus-operands": "off",
79+
"@typescript-eslint/restrict-template-expressions": "off"
6080
}
6181
}

packages/dashboard/src/components/DashboardFrame/Navigation.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ const ListItemLink = styled(ListItemLinkUnStyled)(({ theme }) => {
6565
color: MaskColorVar.textLink,
6666
backgroundColor: theme.palette.background.default,
6767
position: 'relative',
68-
[`${listItemIconClasses.root}`]: {
68+
[listItemIconClasses.root]: {
6969
color: MaskColorVar.textLink,
7070
},
7171
'&:after': {
@@ -91,7 +91,7 @@ const LogoItem = styled(MuiListItem)(({ theme }) => ({
9191
})) as any as typeof MuiListItem
9292

9393
const ItemIcon = styled(ListItemIcon)(({ theme }) => ({
94-
[`& svg`]: {
94+
'& svg': {
9595
fontSize: 36,
9696
},
9797
}))

packages/dashboard/src/components/MaskAlert/index.tsx

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ const InfoAlert = styled(Alert)(({ theme }) => ({
99
display: 'flex',
1010
alignItems: 'center',
1111
lineHeight: '16px',
12-
color: `${MaskColorVar.secondaryInfoText}`,
13-
fontSize: `${theme.typography.caption.fontSize}`,
12+
color: MaskColorVar.secondaryInfoText,
13+
fontSize: theme.typography.caption.fontSize,
1414
},
1515
[`& > .${alertClasses.icon}`]: {
1616
alignItems: 'center',
@@ -20,45 +20,45 @@ const InfoAlert = styled(Alert)(({ theme }) => ({
2020
},
2121
// standard
2222
[`&.${alertClasses.standardInfo}`]: {
23-
backgroundColor: `${getMaskColor(theme).infoBackground}`,
23+
backgroundColor: getMaskColor(theme).infoBackground,
2424
},
2525
[`&.${alertClasses.standardInfo} .${alertClasses.icon}`]: {
26-
color: `${getMaskColor(theme).secondaryInfoText}`,
26+
color: getMaskColor(theme).secondaryInfoText,
2727
},
2828
[`&.${alertClasses.standardInfo} .${alertClasses.action}`]: {
29-
color: `${getMaskColor(theme).secondaryInfoText}`,
29+
color: getMaskColor(theme).secondaryInfoText,
3030
},
3131
// error
3232
[`&.${alertClasses.standardError}`]: {
33-
backgroundColor: `${MaskColorVar.redMain.alpha(0.1)}`,
33+
backgroundColor: MaskColorVar.redMain.alpha(0.1),
3434
},
3535
[`&.${alertClasses.standardError} .${alertClasses.icon}`]: {
36-
color: `${getMaskColor(theme).redMain}`,
36+
color: getMaskColor(theme).redMain,
3737
'path:first-child': {
38-
fill: `${MaskColorVar.redMain.alpha(0.5)}`,
38+
fill: MaskColorVar.redMain.alpha(0.5),
3939
},
4040
path: {
41-
fill: `${getMaskColor(theme).redMain}`,
41+
fill: getMaskColor(theme).redMain,
4242
},
4343
},
4444
[`&.${alertClasses.standardError} .${alertClasses.action}`]: {
45-
color: `${getMaskColor(theme).redMain}`,
45+
color: getMaskColor(theme).redMain,
4646
},
4747
[`&.${alertClasses.standardError} .${alertClasses.message}`]: {
48-
color: `${getMaskColor(theme).redMain}`,
48+
color: getMaskColor(theme).redMain,
4949
},
5050
// success
5151
[`&.${alertClasses.standardSuccess}`]: {
52-
backgroundColor: `${MaskColorVar.greenMain.alpha(0.1)}`,
52+
backgroundColor: MaskColorVar.greenMain.alpha(0.1),
5353
},
5454
[`&.${alertClasses.standardSuccess} .${alertClasses.icon}`]: {
55-
color: `${getMaskColor(theme).greenMain}`,
55+
color: getMaskColor(theme).greenMain,
5656
},
5757
[`&.${alertClasses.standardSuccess} .${alertClasses.action}`]: {
58-
color: `${getMaskColor(theme).greenMain}`,
58+
color: getMaskColor(theme).greenMain,
5959
},
6060
[`&.${alertClasses.standardSuccess} .${alertClasses.message}`]: {
61-
color: `${getMaskColor(theme).greenMain}`,
61+
color: getMaskColor(theme).greenMain,
6262
},
6363
}))
6464

packages/dashboard/src/components/Mnemonic/MnemonicReveal.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ export function MnemonicReveal(props: MnemonicRevealProps) {
2323
return (
2424
<Grid container spacing={2}>
2525
{words.map((item, index) => (
26-
<Grid item xs={3} key={index + item}>
26+
<Grid item xs={3} key={index}>
2727
<WordCard>{item}</WordCard>
2828
</Grid>
2929
))}

packages/dashboard/src/components/PageFrame/index.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@ const PageTitle = styled(Grid)(({ theme }) => ({
6161
const Containment = styled(Grid)(({ theme }) => ({
6262
maxWidth: '100%',
6363
display: 'flex',
64-
height: `calc(100vh - 64px)`,
64+
height: 'calc(100vh - 64px)',
6565
overflow: 'hidden',
6666
}))
6767

packages/dashboard/src/components/Restore/BackupInfoCard.tsx

Lines changed: 12 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,6 @@ interface BackupInfoProps {
1010
}
1111

1212
export const BackupInfoCard = memo(({ info }: BackupInfoProps) => {
13-
const economizeAbstract = (str: string) => {
14-
if (!str.length) return <div>error</div>
15-
if (str.length < 30) return <div>{str}</div>
16-
return (
17-
<Tooltip title={str} placement="top" arrow>
18-
<div>{str.substr(0, 30) + '...' + '(' + str.split(',').length + ')'}</div>
19-
</Tooltip>
20-
)
21-
}
2213
return (
2314
<Card variant="background">
2415
<Grid
@@ -47,3 +38,15 @@ export const BackupInfoCard = memo(({ info }: BackupInfoProps) => {
4738
</Card>
4839
)
4940
})
41+
42+
function economizeAbstract(input: string) {
43+
if (!input.length) return <div>error</div>
44+
if (input.length < 30) return <div>{input}</div>
45+
return (
46+
<Tooltip title={input} placement="top" arrow>
47+
<div>
48+
{input.slice(0, 30)}...({input.split(',').length})
49+
</div>
50+
</Tooltip>
51+
)
52+
}

packages/dashboard/src/components/Stepper/index.tsx

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -54,10 +54,9 @@ export const Stepper = (props: StepperProps) => {
5454

5555
useEffect(() => {
5656
Children.forEach(props.children, (child: ReactElement<StepProps>) => {
57-
if (isValidElement(child)) {
58-
const name = child.props.name
59-
setSteps(name, child)
60-
}
57+
if (!isValidElement(child)) return
58+
const name = child.props.name
59+
setSteps(name, child)
6160
})
6261
}, [])
6362

0 commit comments

Comments
 (0)