Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add lint workflow+config, format and eslint fixes #71

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

x100111010
Copy link

  • add lint workflow and config ed7497e

fix crashing a7f1a61

  • == checks equality with type coercion (5 == '5' is true)

  • === checks equality without type coercion (5 === '5' is false)

  • added ?. to prevent crashes when objects may be undefined or null

Warnings:

  • == causes build warnings

  • addressed all ESLint issues across various files and format using npx prettier --config ./config/.prettierrc.json --write "**/*.js" a27e99f

[eslint] Fixes:

  • src\App.js:

    • Line 52:34: Expected '===' and instead saw '==' (eqeqeq)
    • Line 84:18: Expected '===' and instead saw '==' (eqeqeq)
    • Line 87:27: Expected '===' and instead saw '==' (eqeqeq)
    • Line 179:44: Expected '===' and instead saw '==' (eqeqeq)
    • Line 186:25: img elements must have an alt prop (jsx-a11y/alt-text)
    • Line 243:72: Expected '===' and instead saw '==' (eqeqeq)
    • Line 297:23: Using target="_blank" without rel="noreferrer" (react/jsx-no-target-blank)
    • Line 320:23: Using target="_blank" without rel="noreferrer" (react/jsx-no-target-blank)
    • Line 351:23: Using target="_blank" without rel="noreferrer" (react/jsx-no-target-blank)
    • Line 374:23: Using target="_blank" without rel="noreferrer" (react/jsx-no-target-blank)
  • src\Dashboard.js:

    • Line 30:9: 'handleShow' is assigned a value but never used (no-unused-vars)
    • Line 34:19: 'setBalance' is assigned a value but never used (no-unused-vars)
    • Line 35:19: 'setAddress' is assigned a value but never used (no-unused-vars)
    • Line 43:18: Expected '===' and instead saw '==' (eqeqeq)
    • Line 46:27: Expected '===' and instead saw '==' (eqeqeq)
    • Line 80:15: img elements must have an alt prop (jsx-a11y/alt-text)
  • src\bech32.js:

    • Line 79:17: Expected '===' and instead saw '==' (eqeqeq)
  • src\components\AddressInfo.js:

    • Line 55:42: Expected '===' and instead saw '==' (eqeqeq)
    • Line 98:19: Expected '===' and instead saw '==' (eqeqeq)
    • Line 105:19: Expected '===' and instead saw '==' (eqeqeq)
    • Line 114:39: Expected '===' and instead saw '==' (eqeqeq)
    • Line 123:11: Expected '===' and instead saw '==' (eqeqeq)
    • Line 190:6: React Hook useEffect has a missing dependency (react-hooks/exhaustive-deps)
    • Line 218:6: React Hook useEffect has missing dependencies (react-hooks/exhaustive-deps)
    • Line 268:6: React Hook useEffect has missing dependencies (react-hooks/exhaustive-deps)
    • Line 523:49: Expected '===' and instead saw '==' (eqeqeq)
    • Line 583:67: Expected '===' and instead saw '==' (eqeqeq)
    • Line 677:21: Comments inside children section of tag should be placed inside braces (react/jsx-no-comment-textnodes)
  • src\components\BlockDAG.js:

    • Line 90:6: React Hook useEffect has a missing dependency (react-hooks/exhaustive-deps)
  • src\components\BlockInfo.js:

    • Line 40:7: 'sompiOrKas' is assigned a value but never used (no-unused-vars)
    • Line 51:17: Expected '===' and instead saw '==' (eqeqeq)
    • Line 61:17: Expected '===' and instead saw '==' (eqeqeq)
    • Line 78:10: 'blockColor' is assigned a value but never used (no-unused-vars)
    • Line 78:22: 'setBlockColor' is assigned a value but never used (no-unused-vars)
    • Line 453:41: Using target="_blank" without rel="noreferrer" (react/jsx-no-target-blank)
  • src\components\BlocksPage.js:

    • Line 4:1: Assign arrow function to a variable before exporting as module default (import/no-anonymous-default-export)
  • src\components\CoinsupplyBox.js:

    • Line 68:6: React Hook useEffect has a missing dependency (react-hooks/exhaustive-deps)
  • src\components\CopyButton.js:

    • Line 6:1: Assign arrow function to a variable before exporting as module default (import/no-anonymous-default-export)
  • src\components\MarketDataBox.js:

    • Line 113:15: Using target="_blank" without rel="noreferrer" (react/jsx-no-target-blank)
  • src\components\QrButton.js:

    • Line 4:1: Assign arrow function to a variable before exporting as module default (import/no-anonymous-default-export)
  • src\components\TransactionInfo.js:

    • Line 1:11: 'BigInt' is defined but never used (no-unused-vars)
    • Line 18:22: Expected '===' and instead saw '==' (eqeqeq)
    • Line 27:10: 'storageMass' is assigned a value but never used (no-unused-vars)
    • Line 27:23: 'setStorageMass' is assigned a value but never used (no-unused-vars)
    • Line 30:10: 'error' is assigned a value but never used (no-unused-vars)
    • Line 31:11: 'price' is assigned a value but never used (no-unused-vars)
    • Line 37:10: 'blockColor' is assigned a value but never used (no-unused-vars)
    • Line 37:22: 'setBlockColor' is assigned a value but never used (no-unused-vars)
    • Line 53:6: React Hook useEffect has a missing dependency (react-hooks/exhaustive-deps)
    • Line 55:9: 'getAmountFromOutputs' is assigned a value but never used (no-unused-vars)
    • Line 57:19: Expected '===' and instead saw '==' (eqeqeq)
    • Line 72:43: Expected '===' and instead saw '==' (eqeqeq)
    • Line 82:24: Expected '===' and instead saw '==' (eqeqeq)
    • Line 99:6: React Hook useEffect has a missing dependency (react-hooks/exhaustive-deps)
  • src\components\TxPage.js:

    • Line 4:1: Assign arrow function to a variable before exporting as module default (import/no-anonymous-default-export)

addressed all ESLint issues across various files and format using `npx prettier --config ./config/.prettierrc.json --write "**/*.js"`

[eslint] Fixes:

- `src\App.js:`
  - Line 52:34:   Expected '===' and instead saw '==' (eqeqeq)
  - Line 84:18:   Expected '===' and instead saw '==' (eqeqeq)
  - Line 87:27:   Expected '===' and instead saw '==' (eqeqeq)
  - Line 179:44:  Expected '===' and instead saw '==' (eqeqeq)
  - Line 186:25:  img elements must have an alt prop (jsx-a11y/alt-text)
  - Line 243:72:  Expected '===' and instead saw '==' (eqeqeq)
  - Line 297:23:  Using target="_blank" without rel="noreferrer" (react/jsx-no-target-blank)
  - Line 320:23:  Using target="_blank" without rel="noreferrer" (react/jsx-no-target-blank)
  - Line 351:23:  Using target="_blank" without rel="noreferrer" (react/jsx-no-target-blank)
  - Line 374:23:  Using target="_blank" without rel="noreferrer" (react/jsx-no-target-blank)

- `src\Dashboard.js:`
  - Line 30:9:   'handleShow' is assigned a value but never used (no-unused-vars)
  - Line 34:19:  'setBalance' is assigned a value but never used (no-unused-vars)
  - Line 35:19:  'setAddress' is assigned a value but never used (no-unused-vars)
  - Line 43:18:  Expected '===' and instead saw '==' (eqeqeq)
  - Line 46:27:  Expected '===' and instead saw '==' (eqeqeq)
  - Line 80:15:  img elements must have an alt prop (jsx-a11y/alt-text)

- `src\bech32.js:`
  - Line 79:17:  Expected '===' and instead saw '==' (eqeqeq)

- `src\components\AddressInfo.js:`
  - Line 55:42:   Expected '===' and instead saw '==' (eqeqeq)
  - Line 98:19:   Expected '===' and instead saw '==' (eqeqeq)
  - Line 105:19:  Expected '===' and instead saw '==' (eqeqeq)
  - Line 114:39:  Expected '===' and instead saw '==' (eqeqeq)
  - Line 123:11:  Expected '===' and instead saw '==' (eqeqeq)
  - Line 190:6:   React Hook useEffect has a missing dependency (react-hooks/exhaustive-deps)
  - Line 218:6:   React Hook useEffect has missing dependencies (react-hooks/exhaustive-deps)
  - Line 268:6:   React Hook useEffect has missing dependencies (react-hooks/exhaustive-deps)
  - Line 523:49:  Expected '===' and instead saw '==' (eqeqeq)
  - Line 583:67:  Expected '===' and instead saw '==' (eqeqeq)
  - Line 677:21:  Comments inside children section of tag should be placed inside braces (react/jsx-no-comment-textnodes)

- `src\components\BlockDAG.js:`
  - Line 90:6:  React Hook useEffect has a missing dependency (react-hooks/exhaustive-deps)

- `src\components\BlockInfo.js:`
  - Line 40:7:    'sompiOrKas' is assigned a value but never used (no-unused-vars)
  - Line 51:17:   Expected '===' and instead saw '==' (eqeqeq)
  - Line 61:17:   Expected '===' and instead saw '==' (eqeqeq)
  - Line 78:10:   'blockColor' is assigned a value but never used (no-unused-vars)
  - Line 78:22:   'setBlockColor' is assigned a value but never used (no-unused-vars)
  - Line 453:41:  Using target="_blank" without rel="noreferrer" (react/jsx-no-target-blank)

- `src\components\BlocksPage.js:`
  - Line 4:1:  Assign arrow function to a variable before exporting as module default (import/no-anonymous-default-export)

- `src\components\CoinsupplyBox.js:`
  - Line 68:6:  React Hook useEffect has a missing dependency (react-hooks/exhaustive-deps)

- `src\components\CopyButton.js:`
  - Line 6:1:  Assign arrow function to a variable before exporting as module default (import/no-anonymous-default-export)

- `src\components\MarketDataBox.js:`
  - Line 113:15:  Using target="_blank" without rel="noreferrer" (react/jsx-no-target-blank)

- `src\components\QrButton.js:`
  - Line 4:1:  Assign arrow function to a variable before exporting as module default (import/no-anonymous-default-export)

- `src\components\TransactionInfo.js:`
  - Line 1:11:   'BigInt' is defined but never used (no-unused-vars)
  - Line 18:22:  Expected '===' and instead saw '==' (eqeqeq)
  - Line 27:10:  'storageMass' is assigned a value but never used (no-unused-vars)
  - Line 27:23:  'setStorageMass' is assigned a value but never used (no-unused-vars)
  - Line 30:10:  'error' is assigned a value but never used (no-unused-vars)
  - Line 31:11:  'price' is assigned a value but never used (no-unused-vars)
  - Line 37:10:  'blockColor' is assigned a value but never used (no-unused-vars)
  - Line 37:22:  'setBlockColor' is assigned a value but never used (no-unused-vars)
  - Line 53:6:   React Hook useEffect has a missing dependency (react-hooks/exhaustive-deps)
  - Line 55:9:   'getAmountFromOutputs' is assigned a value but never used (no-unused-vars)
  - Line 57:19:  Expected '===' and instead saw '==' (eqeqeq)
  - Line 72:43:  Expected '===' and instead saw '==' (eqeqeq)
  - Line 82:24:  Expected '===' and instead saw '==' (eqeqeq)
  - Line 99:6:   React Hook useEffect has a missing dependency (react-hooks/exhaustive-deps)

- `src\components\TxPage.js:`
  - Line 4:1:  Assign arrow function to a variable before exporting as module default (import/no-anonymous-default-export)
- `==` checks equality with type coercion (`5 == '5'` is `true`)
- `===` checks equality without type coercion (`5 === '5'` is `false`)

- added `?.` to prevent crashes when objects may be `undefined` or `null`

Warnings:
- `==` causes build warnings
Copy link

vercel bot commented Oct 22, 2024

@x100111010 is attempting to deploy a commit to the lamer1's projects Team on Vercel.

A member of the Team first needs to authorize it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant