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

chore: update eslint v^8.44 #10865

Merged
merged 28 commits into from
Sep 9, 2024
Merged

chore: update eslint v^8.44 #10865

merged 28 commits into from
Sep 9, 2024

Conversation

tommasini
Copy link
Contributor

@tommasini tommasini commented Aug 28, 2024

Description

This PR aims to update eslint to match extension version and to support the typescript version on mobile and remove this warning:

WARNING: You are currently running a version of TypeScript which is not officially supported by @typescript-eslint/typescript-estree.

You may find that it works just fine, or you may not.

SUPPORTED TYPESCRIPT VERSIONS: >=3.3.1 <5.2.0

YOUR TYPESCRIPT VERSION: 5.4.5

There is some things that we need to do to finish this PR:

  • Solve new linter issues

  • Consider keep or not the @babel/preset-react to the babel parser config to javascript files (not needed, deepcheck flagged it as not used)

  • Discover why app/selectors/accountTrackerController.test.tsx was triggering an issue on eslint

  • Discover why we still have eslint issues here: e2e/pages/Settings/AesCryptoTestForm.ts (maybe we just need to convert it to JS since every e2e file is on JS )

  • Investigate if we should disable no-unused-vars for JS files since our efforts should be to transition those files to TypeScript (we didn't flag this until now, so let's keep this unused vars unchecked by the linter)

  • Investigate if we should we enable empty functions on test files (we shouldn't)

  • Remove unused dev package @metamask/eslint-config

Next steps after this PR:

Related issues

Fixes:

Manual testing steps

  1. Go to this page...

Screenshots/Recordings

Screen.Recording.2024-09-06.at.12.01.00.mov

Before

After

Pre-merge author checklist

Pre-merge reviewer checklist

  • I've manually tested the PR (e.g. pull and build branch, run the app, test code being changed).
  • I confirm that this PR addresses all acceptance criteria described in the ticket it closes and includes the necessary testing evidence such as recordings and or screenshots.

Copy link
Contributor

CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes.

Copy link

socket-security bot commented Aug 28, 2024

New and removed dependencies detected. Learn more about Socket for GitHub ↗︎

Package New capabilities Transitives Size Publisher
npm/@babel/eslint-parser@7.25.1 unsafe 0 215 kB nicolo-ribaudo
npm/@babel/helper-plugin-utils@7.24.8 None 0 114 kB nicolo-ribaudo
npm/@babel/helper-string-parser@7.24.8 None 0 31.8 kB nicolo-ribaudo
npm/@babel/helper-validator-option@7.24.8 None 0 11.8 kB nicolo-ribaudo
npm/@babel/plugin-syntax-jsx@7.24.7 None 0 70 kB nicolo-ribaudo
npm/@babel/plugin-transform-react-display-name@7.24.7 None 0 78.4 kB nicolo-ribaudo
npm/@babel/plugin-transform-react-jsx@7.25.2 None 0 144 kB nicolo-ribaudo
npm/@babel/types@7.25.4 environment 0 2.48 MB nicolo-ribaudo
npm/@eslint-community/regexpp@4.11.0 None 0 446 kB eslint-community-bot
npm/@eslint/eslintrc@2.1.4 filesystem, unsafe 0 659 kB eslintbot
npm/@eslint/js@8.57.0 None 0 13.9 kB eslintbot
npm/@humanwhocodes/config-array@0.11.14 None 0 55.6 kB nzakas
npm/@humanwhocodes/module-importer@1.0.1 unsafe 0 21.2 kB nzakas
npm/@humanwhocodes/object-schema@2.0.3 None 0 23.3 kB nzakas
npm/@nicolo-ribaudo/eslint-scope-5-internals@5.1.1-v1 None 0 1.66 kB nicolo-ribaudo
npm/@react-native/eslint-config@0.75.2 None 0 18.3 kB react-native-bot
npm/@react-native/eslint-plugin@0.75.2 None 0 6.5 kB react-native-bot
npm/@types/semver@7.5.8 None 0 23.3 kB types
npm/@typescript-eslint/eslint-plugin@7.18.0 None 0 2.83 MB jameshenry
npm/@typescript-eslint/parser@7.18.0 None 0 18.2 kB jameshenry
npm/@typescript-eslint/scope-manager@7.18.0 None 0 618 kB jameshenry
npm/@typescript-eslint/type-utils@7.18.0 None 0 109 kB jameshenry
npm/@typescript-eslint/types@7.18.0 None 0 160 kB jameshenry
npm/@typescript-eslint/typescript-estree@7.18.0 None 0 579 kB jameshenry
npm/@typescript-eslint/utils@7.18.0 None 0 284 kB jameshenry
npm/@typescript-eslint/visitor-keys@7.18.0 None 0 19.4 kB jameshenry
npm/@ungap/structured-clone@1.2.0 None 0 26.2 kB webreflection
npm/acorn@8.12.1 None 0 538 kB marijn
npm/ansi-colors@1.1.0 None 0 22 kB doowb
npm/eslint-config-prettier@8.10.0 None 0 19.9 kB lydell
npm/eslint-plugin-ft-flow@2.0.3 None 0 505 kB brianzchen
npm/eslint-plugin-jest@27.9.0 filesystem 0 325 kB simenb
npm/eslint-plugin-react-hooks@4.6.2 environment 0 118 kB react-bot
npm/eslint-visitor-keys@3.4.3 None 0 32.3 kB eslintbot
npm/eslint@8.57.0 environment, filesystem 0 3.04 MB eslintbot
npm/espree@9.6.1 None 0 73.6 kB eslintbot
npm/esquery@1.6.0 None 0 1.04 MB michaelficarra
npm/globby@11.1.0 filesystem 0 21.8 kB sindresorhus
npm/ignore@5.3.2 None 0 53.6 kB kael
npm/optionator@0.9.4 None 0 50.2 kB gkz
npm/string-natural-compare@3.0.1 None 0 10.1 kB nwoltman
npm/string.prototype.repeat@1.0.0 None 0 8.61 kB nicolo-ribaudo
npm/ts-api-utils@1.3.0 None 0 828 kB joshuakgoldberg
npm/word-wrap@1.2.5 None 0 11.8 kB jonschlinkert

🚮 Removed packages: npm/@babel/helper-plugin-utils@7.24.7), npm/@babel/helper-string-parser@7.24.7), npm/@babel/helper-validator-option@7.23.5), npm/@babel/plugin-syntax-jsx@7.24.1), npm/@babel/plugin-transform-react-display-name@7.24.1), npm/@babel/plugin-transform-react-jsx@7.23.4), npm/@babel/types@7.24.7), npm/@eslint-community/regexpp@4.10.0), npm/@metamask/eslint-config@9.0.0), npm/@react-native-community/eslint-config@2.0.0), npm/@react-native-community/eslint-plugin@1.1.0), npm/@types/eslint-visitor-keys@1.0.0), npm/@types/json-schema@7.0.12), npm/@types/semver@7.5.0), npm/@typescript-eslint/eslint-plugin@5.62.0), npm/@typescript-eslint/experimental-utils@3.10.1), npm/@typescript-eslint/parser@5.62.0), npm/@typescript-eslint/scope-manager@5.62.0), npm/@typescript-eslint/type-utils@5.62.0), npm/@typescript-eslint/types@3.10.1), npm/@typescript-eslint/typescript-estree@3.10.1), npm/@typescript-eslint/utils@5.62.0), npm/@typescript-eslint/visitor-keys@3.10.1), npm/acorn@8.11.3), npm/ansi-colors@4.1.1), npm/babel-eslint@10.1.0), npm/eslint-config-prettier@8.8.0), npm/eslint-plugin-flowtype@2.50.3), npm/eslint-plugin-jest@22.4.1), npm/eslint-plugin-react-hooks@4.3.0), npm/eslint-visitor-keys@3.4.1), npm/globby@13.1.3), npm/ignore@5.2.4), npm/natural-compare-lite@1.4.0), npm/optionator@0.9.1), npm/tsutils@3.21.0), npm/v8-compile-cache@2.3.0), npm/word-wrap@1.2.4)

View full report↗︎

Copy link

socket-security bot commented Aug 28, 2024

👍 Dependency issues cleared. Learn more about Socket for GitHub ↗︎

This PR previously contained dependency changes with security issues that have been resolved, removed, or ignored.

Ignoring: npm/string.prototype.repeat@1.0.0

View full report↗︎

Next steps

Take a deeper look at the dependency

Take a moment to review the security alert above. Review the linked package source code to understand the potential risk. Ensure the package is not malicious before proceeding. If you're unsure how to proceed, reach out to your security team or ask the Socket team for help at support [AT] socket [DOT] dev.

Remove the package

If you happen to install a dependency that Socket reports as Known Malware you should immediately remove it and select a different dependency. For other alert types, you may may wish to investigate alternative packages or consider if there are other ways to mitigate the specific risk posed by the dependency.

Mark a package as acceptable risk

To ignore an alert, reply with a comment starting with @SocketSecurity ignore followed by a space separated list of ecosystem/package-name@version specifiers. e.g. @SocketSecurity ignore npm/foo@1.0.0 or ignore all packages with @SocketSecurity ignore-all

package.json Show resolved Hide resolved
tommasini added a commit that referenced this pull request Aug 29, 2024
## **Description**

With this PR we are bumping typescript version on mobile.

With this, we can remove some of @ts-expect-error that we have, and
match extension version.

We although create a warning when running eslint (yarn lint)

```
WARNING: You are currently running a version of TypeScript which is not officially supported by @typescript-eslint/typescript-estree.

You may find that it works just fine, or you may not.

SUPPORTED TYPESCRIPT VERSIONS: >=3.3.1 <5.2.0

YOUR TYPESCRIPT VERSION: 5.4.5
```

Since typescript seems to be working fine we can go with this PR to
review but also means that we also need to update eslint, that is
happening on this
[PR](#10865), and since
have more changes will be open for discussion.

## **Related issues**

Fixes:

## **Manual testing steps**

1. Go to this page...
2.
3.

## **Screenshots/Recordings**

<!-- If applicable, add screenshots and/or recordings to visualize the
before and after of your change. -->

### **Before**

<!-- [screenshots/recordings] -->

### **After**

<!-- [screenshots/recordings] -->

## **Pre-merge author checklist**

- [ ] I’ve followed [MetaMask Contributor
Docs](https://github.com/MetaMask/contributor-docs) and [MetaMask Mobile
Coding
Standards](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/CODING_GUIDELINES.md).
- [ ] I've completed the PR template to the best of my ability
- [ ] I’ve included tests if applicable
- [ ] I’ve documented my code using [JSDoc](https://jsdoc.app/) format
if applicable
- [ ] I’ve applied the right labels on the PR (see [labeling
guidelines](https://github.com/MetaMask/metamask-mobile/blob/main/.github/guidelines/LABELING_GUIDELINES.md)).
Not required for external contributors.

## **Pre-merge reviewer checklist**

- [ ] I've manually tested the PR (e.g. pull and build branch, run the
app, test code being changed).
- [ ] I confirm that this PR addresses all acceptance criteria described
in the ticket it closes and includes the necessary testing evidence such
as recordings and or screenshots.
Base automatically changed from chore/update-typescript-version-5-4-5 to main August 29, 2024 19:30
An error occurred while trying to automatically change base from chore/update-typescript-version-5-4-5 to main August 29, 2024 19:30
@codecov-commenter
Copy link

Codecov Report

Attention: Patch coverage is 0% with 4 lines in your changes missing coverage. Please review.

Project coverage is 52.75%. Comparing base (8dcdd3c) to head (fc21530).
Report is 16 commits behind head on main.

Files with missing lines Patch % Lines
...y/components/Icons/Icon/scripts/generate-assets.js 0.00% 1 Missing ⚠️
...omponents/UI/CollectibleMedia/CollectibleMedia.tsx 0.00% 0 Missing and 1 partial ⚠️
...rmations/components/EditGasFee1559Update/index.tsx 0.00% 0 Missing and 1 partial ⚠️
app/core/MobilePortStream.js 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main   #10865      +/-   ##
==========================================
- Coverage   52.75%   52.75%   -0.01%     
==========================================
  Files        1534     1540       +6     
  Lines       36777    36860      +83     
  Branches     4335     4357      +22     
==========================================
+ Hits        19403    19444      +41     
- Misses      16058    16094      +36     
- Partials     1316     1322       +6     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@leotm
Copy link
Member

leotm commented Aug 30, 2024

@SocketSecurity ignore npm/string.prototype.repeat@1.0.0
New Author: nicolo-ribaudo, Previous Author: mathias

@tommasini tommasini added Run Smoke E2E Triggers smoke e2e on Bitrise and removed No QA Needed Apply this label when your PR does not need any QA effort. labels Sep 3, 2024
Copy link
Contributor

github-actions bot commented Sep 3, 2024

https://bitrise.io/ Bitrise

❌❌❌ pr_smoke_e2e_pipeline failed on Bitrise! ❌❌❌

Commit hash: b27124a
Build link: https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/654bc82e-5903-4985-a1d5-f41ab8db6042

Note

  • You can kick off another pr_smoke_e2e_pipeline on Bitrise by removing and re-applying the Run Smoke E2E label on the pull request

wachunei
wachunei previously approved these changes Sep 3, 2024
Copy link
Member

@wachunei wachunei left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ramp changes LGTM

@tommasini tommasini added needs-dev-review PR needs reviews from other engineers (in order to receive required approvals) Run Smoke E2E Triggers smoke e2e on Bitrise and removed Run Smoke E2E Triggers smoke e2e on Bitrise labels Sep 3, 2024
app/core/MobilePortStream.js Outdated Show resolved Hide resolved
app/selectors/accountTrackerControllerReRenders.test.tsx Outdated Show resolved Hide resolved
e2e/pages/Settings/AesCryptoTestForm.js Outdated Show resolved Hide resolved
patches/@metamask+eslint-config-typescript+9.0.1.patch Outdated Show resolved Hide resolved
Copy link
Contributor

@brianacnguyen brianacnguyen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Icon changes look good. For safety, can you attach a screenshot of an Icon from either the app or storybook to make sure theyre still functioning as expected?

@tommasini
Copy link
Contributor Author

@brianacnguyen Video added! Thanks for bringing it up!

@tommasini tommasini added Run Smoke E2E Triggers smoke e2e on Bitrise and removed Run Smoke E2E Triggers smoke e2e on Bitrise labels Sep 6, 2024
Copy link
Contributor

github-actions bot commented Sep 6, 2024

https://bitrise.io/ Bitrise

✅✅✅ pr_smoke_e2e_pipeline passed on Bitrise! ✅✅✅

Commit hash: be044bd
Build link: https://app.bitrise.io/app/be69d4368ee7e86d/pipelines/8c120b8e-c5c0-451d-9da8-e5f49f06e9e3

Note

  • You can kick off another pr_smoke_e2e_pipeline on Bitrise by removing and re-applying the Run Smoke E2E label on the pull request

Copy link
Contributor

@brianacnguyen brianacnguyen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved icon changes

Copy link
Contributor

@NicolasMassart NicolasMassart left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good to me.

Copy link

sonarcloud bot commented Sep 9, 2024

@tommasini tommasini merged commit 462fc33 into main Sep 9, 2024
39 checks passed
@tommasini tommasini deleted the chore/eslint-update branch September 9, 2024 10:07
@github-actions github-actions bot locked and limited conversation to collaborators Sep 9, 2024
@github-actions github-actions bot removed the needs-dev-review PR needs reviews from other engineers (in order to receive required approvals) label Sep 9, 2024
@metamaskbot metamaskbot added the release-7.32.0 Issue or pull request that will be included in release 7.32.0 label Sep 9, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
release-7.32.0 Issue or pull request that will be included in release 7.32.0 Run Smoke E2E Triggers smoke e2e on Bitrise team-mobile-platform
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

9 participants