ci: enable depcheck and fix dependency and linter issues (#233)
* ci: enable depcheck and fix dependency and linter issues * chore: lock dependency versions * chore: update dependencies to latest working ones * chore: fix deprecation createMuiTheme * chore: revert notistack to v1
This commit is contained in:
@@ -0,0 +1,3 @@
|
|||||||
|
{
|
||||||
|
"ignores": ["@types/jest", "@commitlint/config-conventional", "@types/react-router"]
|
||||||
|
}
|
||||||
@@ -8,7 +8,9 @@
|
|||||||
"plugin:@typescript-eslint/recommended",
|
"plugin:@typescript-eslint/recommended",
|
||||||
"prettier",
|
"prettier",
|
||||||
"plugin:prettier/recommended",
|
"plugin:prettier/recommended",
|
||||||
"plugin:react/recommended"
|
"plugin:react/recommended",
|
||||||
|
"react-app",
|
||||||
|
"react-app/jest"
|
||||||
],
|
],
|
||||||
"env": {
|
"env": {
|
||||||
"browser": true,
|
"browser": true,
|
||||||
|
|||||||
@@ -47,6 +47,9 @@ jobs:
|
|||||||
env:
|
env:
|
||||||
CI: true
|
CI: true
|
||||||
|
|
||||||
|
- name: Dependency check
|
||||||
|
run: npm run depcheck
|
||||||
|
|
||||||
- name: Build
|
- name: Build
|
||||||
run: npm run build
|
run: npm run build
|
||||||
|
|
||||||
|
|||||||
Generated
+10383
-5320
File diff suppressed because it is too large
Load Diff
+37
-34
@@ -28,48 +28,56 @@
|
|||||||
"@material-ui/core": "4.12.3",
|
"@material-ui/core": "4.12.3",
|
||||||
"@material-ui/icons": "4.11.2",
|
"@material-ui/icons": "4.11.2",
|
||||||
"@material-ui/lab": "4.0.0-alpha.57",
|
"@material-ui/lab": "4.0.0-alpha.57",
|
||||||
"@types/react-router": "5.1.13",
|
"axios": "0.24.0",
|
||||||
"@types/react-router-dom": "5.1.7",
|
|
||||||
"axios": "0.21.1",
|
|
||||||
"bignumber.js": "9.0.1",
|
"bignumber.js": "9.0.1",
|
||||||
"feather-icons": "4.28.0",
|
"formik": "2.2.9",
|
||||||
"formik": "2.2.8",
|
|
||||||
"formik-material-ui": "3.0.1",
|
"formik-material-ui": "3.0.1",
|
||||||
"material-ui-dropzone": "3.5.0",
|
"material-ui-dropzone": "3.5.0",
|
||||||
"notistack": "1.0.9",
|
"notistack": "1.0.10",
|
||||||
"opener": "1.5.2",
|
"opener": "1.5.2",
|
||||||
"qrcode.react": "1.0.1",
|
"qrcode.react": "1.0.1",
|
||||||
"react": "17.0.2",
|
"react": "17.0.2",
|
||||||
"react-copy-to-clipboard": "5.0.3",
|
"react-copy-to-clipboard": "5.0.4",
|
||||||
"react-dom": "17.0.2",
|
"react-dom": "17.0.2",
|
||||||
"react-feather": "2.0.9",
|
"react-feather": "2.0.9",
|
||||||
"react-identicons": "1.2.5",
|
"react-identicons": "1.2.5",
|
||||||
"react-router-dom": "5.2.0",
|
"react-router-dom": "5.2.0",
|
||||||
"react-syntax-highlighter": "15.4.3",
|
"react-syntax-highlighter": "15.4.4",
|
||||||
"semver": "7.3.2",
|
"semver": "7.3.5",
|
||||||
"serve-handler": "6.1.3"
|
"serve-handler": "6.1.3"
|
||||||
},
|
},
|
||||||
"devDependencies": {
|
"devDependencies": {
|
||||||
"@testing-library/jest-dom": "5.12.0",
|
"@commitlint/config-conventional": "14.1.0",
|
||||||
"@testing-library/react": "11.2.6",
|
"@testing-library/jest-dom": "5.15.0",
|
||||||
"@testing-library/user-event": "13.1.5",
|
"@testing-library/react": "12.1.2",
|
||||||
"@types/jest": "26.0.22",
|
"@types/jest": "27.0.2",
|
||||||
"@types/node": "14.14.41",
|
"@types/qrcode.react": "1.0.2",
|
||||||
"@types/qrcode.react": "1.0.1",
|
"@types/react": "17.0.34",
|
||||||
"@types/react": "17.0.3",
|
"@types/react-copy-to-clipboard": "5.0.2",
|
||||||
"@types/react-copy-to-clipboard": "5.0.0",
|
"@types/react-dom": "17.0.11",
|
||||||
"@types/react-dom": "17.0.3",
|
"@types/react-router": "5.1.17",
|
||||||
"@types/react-syntax-highlighter": "13.5.0",
|
"@types/react-router-dom": "5.3.2",
|
||||||
"@types/semver": "7.3.6",
|
"@types/react-syntax-highlighter": "13.5.2",
|
||||||
"eslint": "7.32.0",
|
"@types/semver": "7.3.9",
|
||||||
"eslint-config-prettier": "8.3.0",
|
"@typescript-eslint/eslint-plugin": "4.33.0",
|
||||||
"eslint-plugin-jest": "24.4.0",
|
"@typescript-eslint/parser": "4.33.0",
|
||||||
"eslint-plugin-prettier": "3.4.1",
|
"babel-eslint": "10.1.0",
|
||||||
"eslint-plugin-react": "7.24.0",
|
"depcheck": "1.4.2",
|
||||||
"prettier": "2.3.2",
|
"eslint": "7.24.0",
|
||||||
|
"eslint-config-prettier": "8.2.0",
|
||||||
|
"eslint-config-react-app": "6.0.0",
|
||||||
|
"eslint-plugin-flowtype": "5.10.0",
|
||||||
|
"eslint-plugin-import": "2.25.2",
|
||||||
|
"eslint-plugin-jest": "24.3.5",
|
||||||
|
"eslint-plugin-jsx-a11y": "6.4.1",
|
||||||
|
"eslint-plugin-prettier": "3.4.0",
|
||||||
|
"eslint-plugin-react": "7.23.2",
|
||||||
|
"eslint-plugin-react-hooks": "4.2.0",
|
||||||
|
"eslint-plugin-testing-library": "3.10.2",
|
||||||
|
"prettier": "2.4.1",
|
||||||
"react-scripts": "4.0.3",
|
"react-scripts": "4.0.3",
|
||||||
"typescript": "4.2.4",
|
"typescript": "4.4.4",
|
||||||
"web-vitals": "1.1.1"
|
"web-vitals": "2.1.2"
|
||||||
},
|
},
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"prepare": "npm run build",
|
"prepare": "npm run build",
|
||||||
@@ -77,6 +85,7 @@
|
|||||||
"build": "react-scripts build",
|
"build": "react-scripts build",
|
||||||
"test": "react-scripts test",
|
"test": "react-scripts test",
|
||||||
"serve": "node ./serve.js",
|
"serve": "node ./serve.js",
|
||||||
|
"depcheck": "depcheck .",
|
||||||
"lint": "eslint --fix \"src/**/*.ts\" \"src/**/*.tsx\" && prettier --write \"src/**/*.ts\" \"src/**/*.tsx\"",
|
"lint": "eslint --fix \"src/**/*.ts\" \"src/**/*.tsx\" && prettier --write \"src/**/*.ts\" \"src/**/*.tsx\"",
|
||||||
"lint:check": "eslint \"src/**/*.ts\" \"src/**/*.tsx\" && prettier --check \"src/**/*.ts\" \"src/**/*.tsx\""
|
"lint:check": "eslint \"src/**/*.ts\" \"src/**/*.tsx\" && prettier --check \"src/**/*.ts\" \"src/**/*.tsx\""
|
||||||
},
|
},
|
||||||
@@ -84,12 +93,6 @@
|
|||||||
"build",
|
"build",
|
||||||
"serve.js"
|
"serve.js"
|
||||||
],
|
],
|
||||||
"eslintConfig": {
|
|
||||||
"extends": [
|
|
||||||
"react-app",
|
|
||||||
"react-app/jest"
|
|
||||||
]
|
|
||||||
},
|
|
||||||
"browserslist": {
|
"browserslist": {
|
||||||
"production": [
|
"production": [
|
||||||
">0.2%",
|
">0.2%",
|
||||||
|
|||||||
@@ -55,7 +55,7 @@ export default function WithdrawDepositModal({
|
|||||||
setOpen(false)
|
setOpen(false)
|
||||||
enqueueSnackbar(`${successMessage} Transaction ${transactionHash}`, { variant: 'success' })
|
enqueueSnackbar(`${successMessage} Transaction ${transactionHash}`, { variant: 'success' })
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
enqueueSnackbar(`${errorMessage} Error: ${e.message}`, { variant: 'error' })
|
enqueueSnackbar(`${errorMessage} Error: ${(e as Error).message}`, { variant: 'error' })
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -71,7 +71,7 @@ export default function WithdrawDepositModal({
|
|||||||
|
|
||||||
if (max && t.toDecimal.isGreaterThan(max)) setAmountError(new Error(`Needs to be less than ${max}`))
|
if (max && t.toDecimal.isGreaterThan(max)) setAmountError(new Error(`Needs to be less than ${max}`))
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
setAmountError(e)
|
setAmountError(e as Error)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -100,7 +100,7 @@ export const useAccounting = (
|
|||||||
setUncashedAmounts(results.fulfilled)
|
setUncashedAmounts(results.fulfilled)
|
||||||
setIsloadingUncashed(false)
|
setIsloadingUncashed(false)
|
||||||
})
|
})
|
||||||
}, [settlements, isLoadingUncashed, uncashedAmounts])
|
}, [settlements, isLoadingUncashed, uncashedAmounts, beeDebugApi])
|
||||||
|
|
||||||
const accounting = mergeAccounting(balances, settlements?.settlements, uncashedAmounts)
|
const accounting = mergeAccounting(balances, settlements?.settlements, uncashedAmounts)
|
||||||
|
|
||||||
|
|||||||
@@ -39,7 +39,7 @@ export default function Files(): ReactElement {
|
|||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
refresh()
|
refresh()
|
||||||
}, [])
|
}, []) // eslint-disable-line react-hooks/exhaustive-deps
|
||||||
|
|
||||||
// Choose a postage stamp that has the lowest usage
|
// Choose a postage stamp that has the lowest usage
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
|
|||||||
@@ -77,7 +77,7 @@ export default function FormDialog({ label }: Props): ReactElement {
|
|||||||
await refresh()
|
await refresh()
|
||||||
handleClose()
|
handleClose()
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
enqueueSnackbar(`Error: ${e.message}`, { variant: 'error' })
|
enqueueSnackbar(`Error: ${(e as Error).message}`, { variant: 'error' })
|
||||||
actions.setSubmitting(false)
|
actions.setSubmitting(false)
|
||||||
}
|
}
|
||||||
}}
|
}}
|
||||||
|
|||||||
@@ -30,13 +30,14 @@ export default function Accounting(): ReactElement {
|
|||||||
const { stamps, isLoading, error, start, stop } = useContext(StampsContext)
|
const { stamps, isLoading, error, start, stop } = useContext(StampsContext)
|
||||||
const { status } = useContext(BeeContext)
|
const { status } = useContext(BeeContext)
|
||||||
|
|
||||||
if (!status.all) return <TroubleshootConnectionCard />
|
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
|
if (!status.all) return
|
||||||
start()
|
start()
|
||||||
|
|
||||||
return () => stop()
|
return () => stop()
|
||||||
}, [])
|
}, [status]) // eslint-disable-line react-hooks/exhaustive-deps
|
||||||
|
|
||||||
|
if (!status.all) return <TroubleshootConnectionCard />
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className={classes.root}>
|
<div className={classes.root}>
|
||||||
|
|||||||
@@ -153,7 +153,7 @@ export function Provider({ children }: Props): ReactElement {
|
|||||||
setApiHealth(false)
|
setApiHealth(false)
|
||||||
|
|
||||||
refresh()
|
refresh()
|
||||||
}, [beeApi])
|
}, [beeApi]) // eslint-disable-line react-hooks/exhaustive-deps
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
setIsLoading(true)
|
setIsLoading(true)
|
||||||
@@ -169,7 +169,7 @@ export function Provider({ children }: Props): ReactElement {
|
|||||||
setSettlements(null)
|
setSettlements(null)
|
||||||
|
|
||||||
refresh()
|
refresh()
|
||||||
}, [beeDebugApi])
|
}, [beeDebugApi]) // eslint-disable-line react-hooks/exhaustive-deps
|
||||||
|
|
||||||
const refresh = async () => {
|
const refresh = async () => {
|
||||||
// Don't want to refresh when already refreshing
|
// Don't want to refresh when already refreshing
|
||||||
@@ -279,7 +279,7 @@ export function Provider({ children }: Props): ReactElement {
|
|||||||
|
|
||||||
await Promise.allSettled(promises)
|
await Promise.allSettled(promises)
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
setError(e)
|
setError(e as Error)
|
||||||
} finally {
|
} finally {
|
||||||
setIsLoading(false)
|
setIsLoading(false)
|
||||||
setIsRefreshing(false)
|
setIsRefreshing(false)
|
||||||
@@ -300,7 +300,7 @@ export function Provider({ children }: Props): ReactElement {
|
|||||||
|
|
||||||
return () => clearInterval(interval)
|
return () => clearInterval(interval)
|
||||||
}
|
}
|
||||||
}, [frequency, beeDebugApi, beeApi])
|
}, [frequency, beeDebugApi, beeApi]) // eslint-disable-line react-hooks/exhaustive-deps
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Context.Provider
|
<Context.Provider
|
||||||
|
|||||||
@@ -68,7 +68,7 @@ export function Provider({ children }: Props): ReactElement {
|
|||||||
setStamps(stamps.map(enrichStamp))
|
setStamps(stamps.map(enrichStamp))
|
||||||
setLastUpdate(Date.now())
|
setLastUpdate(Date.now())
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
setError(e)
|
setError(e as Error)
|
||||||
} finally {
|
} finally {
|
||||||
setIsLoading(false)
|
setIsLoading(false)
|
||||||
}
|
}
|
||||||
@@ -87,7 +87,7 @@ export function Provider({ children }: Props): ReactElement {
|
|||||||
|
|
||||||
return () => clearInterval(interval)
|
return () => clearInterval(interval)
|
||||||
}
|
}
|
||||||
}, [frequency])
|
}, [frequency]) // eslint-disable-line react-hooks/exhaustive-deps
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Context.Provider value={{ stamps, error, isLoading, lastUpdate, start, stop, refresh }}>
|
<Context.Provider value={{ stamps, error, isLoading, lastUpdate, start, stop, refresh }}>
|
||||||
|
|||||||
+2
-2
@@ -1,4 +1,4 @@
|
|||||||
import { createMuiTheme, Theme } from '@material-ui/core/styles'
|
import { createTheme, Theme } from '@material-ui/core/styles'
|
||||||
import { orange } from '@material-ui/core/colors'
|
import { orange } from '@material-ui/core/colors'
|
||||||
|
|
||||||
declare module '@material-ui/core/styles/createPalette' {
|
declare module '@material-ui/core/styles/createPalette' {
|
||||||
@@ -170,7 +170,7 @@ const propsOverrides = {
|
|||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
export const theme = createMuiTheme({
|
export const theme = createTheme({
|
||||||
palette: {
|
palette: {
|
||||||
type: 'light',
|
type: 'light',
|
||||||
background: {
|
background: {
|
||||||
|
|||||||
@@ -42,7 +42,7 @@ describe('utils', () => {
|
|||||||
1,
|
1,
|
||||||
-1,
|
-1,
|
||||||
]
|
]
|
||||||
const wrongValues = [new Function()]
|
const wrongValues = [new Function()] // eslint-disable-line no-new-func
|
||||||
|
|
||||||
correctValues.forEach(v => {
|
correctValues.forEach(v => {
|
||||||
test(`testing ${v}`, () => {
|
test(`testing ${v}`, () => {
|
||||||
|
|||||||
Reference in New Issue
Block a user