From 822281e467850c1205f54d0b2be2c4c61ddba23d Mon Sep 17 00:00:00 2001 From: Reckless_Satoshi Date: Fri, 9 Sep 2022 10:33:29 -0700 Subject: [PATCH] Run npm run lint:fix Still many linting errors to fix manually --- .github/workflows/linter.yml | 5 +- frontend/package.json | 2 +- frontend/src/components/App.js | 2 +- .../src/components/AutocompletePayments.js | 12 +-- frontend/src/components/BookPage.js | 18 ++-- frontend/src/components/BottomBar.js | 30 +++---- .../components/Charts/DepthChart/index.tsx | 6 +- frontend/src/components/Dialogs/AuditPGP.tsx | 8 +- frontend/src/components/Dialogs/Community.tsx | 4 +- .../components/Dialogs/ExchangeSummary.tsx | 4 +- frontend/src/components/Dialogs/Info.tsx | 6 +- frontend/src/components/Dialogs/Learn.tsx | 4 +- frontend/src/components/Dialogs/NoRobot.tsx | 4 +- frontend/src/components/Dialogs/Profile.tsx | 12 +-- frontend/src/components/Dialogs/Stats.tsx | 4 +- .../src/components/Dialogs/StoreToken.tsx | 4 +- frontend/src/components/EncryptedChat.js | 4 +- .../FlagWithProps/FlagWithProps.tsx | 4 +- .../LinearDeterminate/LinearDeterminate.tsx | 4 +- frontend/src/components/MakerPage.js | 90 ++++++++++--------- frontend/src/components/OrderPage.js | 58 ++++++------ frontend/src/components/PaymentText.js | 6 +- frontend/src/components/TradeBox.js | 31 ++++--- frontend/src/components/TradeSummary.tsx | 6 +- frontend/src/components/UnsafeAlert.js | 4 +- frontend/src/components/UserGenPage.js | 10 +-- .../src/components/payment-methods/Icons.js | 2 +- frontend/src/utils/clipboard.js | 2 +- frontend/src/utils/match.ts | 4 +- frontend/src/utils/pgp.js | 2 +- frontend/src/utils/prettyNumbers.test.ts | 2 +- frontend/src/utils/webln.ts | 2 +- 32 files changed, 185 insertions(+), 171 deletions(-) diff --git a/.github/workflows/linter.yml b/.github/workflows/linter.yml index b84124aa..b8f5172c 100644 --- a/.github/workflows/linter.yml +++ b/.github/workflows/linter.yml @@ -36,4 +36,7 @@ jobs: uses: wearerequired/lint-action@v2 with: prettier: true - prettier_dir: frontend \ No newline at end of file + prettier_dir: frontend + # Many linting errors + # eslint: true + # eslint_dir: frontend \ No newline at end of file diff --git a/frontend/package.json b/frontend/package.json index 347fbf13..302706a2 100644 --- a/frontend/package.json +++ b/frontend/package.json @@ -83,4 +83,4 @@ "webln": "^0.3.0", "websocket": "^1.0.34" } -} \ No newline at end of file +} diff --git a/frontend/src/components/App.js b/frontend/src/components/App.js index e4b3330b..435bafb9 100644 --- a/frontend/src/components/App.js +++ b/frontend/src/components/App.js @@ -9,7 +9,7 @@ import { LearnDialog } from './Dialogs'; import { I18nextProvider } from 'react-i18next'; import i18n from './i18n'; -//Icons +// Icons import DarkModeIcon from '@mui/icons-material/DarkMode'; import LightModeIcon from '@mui/icons-material/LightMode'; import SchoolIcon from '@mui/icons-material/School'; diff --git a/frontend/src/components/AutocompletePayments.js b/frontend/src/components/AutocompletePayments.js index b688e38b..2833eebf 100644 --- a/frontend/src/components/AutocompletePayments.js +++ b/frontend/src/components/AutocompletePayments.js @@ -232,9 +232,9 @@ export default function AutocompletePayments(props) { const [val, setVal] = useState(); function optionsToString(newValue) { - var str = ''; - var arrayLength = newValue.length; - for (var i = 0; i < arrayLength; i++) { + let str = ''; + const arrayLength = newValue.length; + for (let i = 0; i < arrayLength; i++) { str += newValue[i].name + ' '; } return str.slice(0, -1); @@ -242,7 +242,7 @@ export default function AutocompletePayments(props) { function handleAddNew(inputProps) { paymentMethods.push({ name: inputProps.value, icon: 'custom' }); - var a = value.push({ name: inputProps.value, icon: 'custom' }); + const a = value.push({ name: inputProps.value, icon: 'custom' }); setVal(() => ''); if (a || a == null) { @@ -274,7 +274,7 @@ export default function AutocompletePayments(props) { {value.map((option, index) => ( ))} - + @@ -320,7 +320,7 @@ export default function AutocompletePayments(props) { ) : null ) : null} - ) : //Here goes what happens if there is no groupedOptions + ) : // Here goes what happens if there is no groupedOptions getInputProps().value.length > 0 ? (