Skip to content

refactor: TypeScript ~4.8.4 and ESLint deps upgrades and initial type fixes#6080

Merged
leotm merged 26 commits intomainfrom
typescript-5-eslint-upgrade-initial-fixes
Jul 26, 2023
Merged

refactor: TypeScript ~4.8.4 and ESLint deps upgrades and initial type fixes#6080
leotm merged 26 commits intomainfrom
typescript-5-eslint-upgrade-initial-fixes

Conversation

@leotm
Copy link
Copy Markdown
Contributor

@leotm leotm commented Mar 30, 2023

Description

This is the initial effort of: #5993

Refer to our pinned Google Sheet in Mobile Comms Practise for remaining initial type fixes done

TODO

  • Upgrade to TypeScript 5 ~4.8.4
  • Fix current ESLint warning i.e. upgrade @typescript-eslint/parser to support TypeScript version
  • Upgrade @types devDeps (and add missing i18n-js)
  • Upgrade various ESLint devDeps keeping linting errors 0
  • Fix lint warning - remove dupe test
  • Doc current @react-native-community lint config
  • Convert prev files in Fix 18 JS type errors for TSC to output 683 TS/TSX errors #5975 from JS to TS
  • Fix initial set of type errors (ref: our internal Google Sheet pinned in Slack channel)

Screenshots/Recordings

If applicable, add screenshots and/or recordings to visualize the before and after of your change

Issue

Checklist

  • There is a related GitHub issue
  • Tests are included if applicable
  • Any added code is fully documented

@leotm leotm added type-tech-debt Technical debt No QA Needed Apply this label when your PR does not need any QA effort. needs-dev-review PR needs reviews from other engineers (in order to receive required approvals) labels Mar 30, 2023
@github-actions
Copy link
Copy Markdown
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.

@socket-security
Copy link
Copy Markdown

socket-security bot commented Mar 30, 2023

👍 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: @pkgr/utils@2.3.1, @metamask/eslint-config@9.0.0, comment-parser@1.2.4, tapable@2.2.1, regextras@0.8.0, eslint-plugin-jsdoc@36.1.1, get-tsconfig@4.5.0

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 package-name@version specifiers. e.g. @SocketSecurity ignore foo@1.0.0 bar@* or ignore all packages with @SocketSecurity ignore-all

@leotm leotm force-pushed the typescript-5-eslint-upgrade-initial-fixes branch from d6bda75 to 0e2ecbc Compare March 30, 2023 16:36
@leotm leotm marked this pull request as ready for review March 30, 2023 16:51
@leotm leotm requested a review from a team as a code owner March 30, 2023 16:51
@leotm leotm changed the title TypeScript 5 ESLint upgrade and initial type fixes TypeScript 5 and ESLint deps upgrades and initial type fixes Mar 30, 2023
NicolasMassart
NicolasMassart previously approved these changes Apr 3, 2023
Copy link
Copy Markdown
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. Thanks @leotm for the explanation of the changes.

@NicolasMassart NicolasMassart self-requested a review April 3, 2023 15:22
@NicolasMassart NicolasMassart dismissed their stale review April 3, 2023 15:23

dismiss as it requires to tested with upgraded nodejs to v16

@NicolasMassart
Copy link
Copy Markdown
Contributor

@leotm I will approve again as soon as we test all this with new Node version. Otherwise looks good to me.

@leotm leotm requested a review from Gudahtt April 3, 2023 15:43
@leotm leotm changed the title TypeScript 5 and ESLint deps upgrades and initial type fixes TypeScript ~4.8.4 and ESLint deps upgrades and initial type fixes Apr 5, 2023
@leotm
Copy link
Copy Markdown
Contributor Author

leotm commented Apr 6, 2023

@leotm I will approve again as soon as we test all this with new Node version. Otherwise looks good to me.

updated in 833dea8#diff-7ae45ad102eab3b6d7e7896acd08c427a9b25b346470d7bc6507b6481575d519L493-R493

@leotm leotm requested a review from NicolasMassart June 22, 2023 16:59
@leotm leotm changed the title TypeScript ~4.8.4 and ESLint deps upgrades and initial type fixes refactor: TypeScript ~4.8.4 and ESLint deps upgrades and initial type fixes Jun 26, 2023
@leotm
Copy link
Copy Markdown
Contributor Author

leotm commented Jun 26, 2023

@SocketSecurity ignore @pkgr/utils@2.3.1
@SocketSecurity ignore react-native-vector-icons@6.4.2
@SocketSecurity ignore tapable@2.2.1
@SocketSecurity ignore eslint-plugin-jsdoc@39.9.1
@SocketSecurity ignore get-tsconfig@4.5.0

prev semver pkg issues resolved by updating branch with main e.g. #6685 (comment)

https://github.com/MetaMask/metamask-mobile/pull/6080/checks?check_run_id=14556428146

  • filesystem access expected for static analysis (eslint, ts)
    • eslint-plugin-jsdoc
    • get-tsconfig
  • unmaintained (ideally migrate to maintained pkg)
    • react-native-vector-icons
    • tapable
  • No README
    • @pkgr/utils

@leotm
Copy link
Copy Markdown
Contributor Author

leotm commented Jun 26, 2023

prev: https://github.com/MetaMask/metamask-mobile/pull/6080/checks?check_run_id=14556428146 X
current: https://github.com/MetaMask/metamask-mobile/pull/6080/checks?check_run_id=14557603138

tommasini
tommasini previously approved these changes Jul 18, 2023
Copy link
Copy Markdown
Contributor

@tommasini tommasini left a comment

Choose a reason for hiding this comment

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

LGTM!

Conflicts resolved
- app/components/UI/Identicon/index.tsx (pair reviewed w @tommasini)
- package.json
    @typescript-eslint/eslint-plugin: ^5.57.0
    @typescript-eslint/parser: ^5.57.0
    @walletconnect/types: ^2.9.0
    typescript: ~4.8.4
@leotm
Copy link
Copy Markdown
Contributor Author

leotm commented Jul 20, 2023

@SocketSecurity ignore @eslint/js@8.44.0
@SocketSecurity ignore @eslint/eslintrc@2.1.0

https://github.com/MetaMask/metamask-mobile/pull/6080/checks?check_run_id=15201697183

filesystem access expected for static analysis

  • @eslint/js@8.44.0

No contributors or author data (package.json)

  • @eslint/eslintrc@2.1.0

Conflict resolved
- yarn.lock (via running yarn)
@leotm leotm force-pushed the typescript-5-eslint-upgrade-initial-fixes branch from 89b65a0 to 397d46d Compare July 25, 2023 13:31
@leotm leotm force-pushed the typescript-5-eslint-upgrade-initial-fixes branch from 397d46d to 8c746e7 Compare July 25, 2023 13:31
@leotm
Copy link
Copy Markdown
Contributor Author

leotm commented Jul 25, 2023

@SocketSecurity ignore @metamask/eslint-config@9.0.0
@SocketSecurity ignore comment-parser@1.2.4
@SocketSecurity ignore regextras@0.8.0
@SocketSecurity ignore eslint-plugin-jsdoc@36.1.1

https://github.com/MetaMask/metamask-mobile/runs/15326569677

filesystem access expected for static analysis

  • eslint-plugin-jsdoc@36.1.1

new author

  • metamask/eslint-config@9.0.0

unmaintained

  • comment-parser@1.2.4
  • regextras@0.8.0

@leotm leotm requested a review from Gudahtt July 25, 2023 13:36
Copy link
Copy Markdown
Member

@Gudahtt Gudahtt left a comment

Choose a reason for hiding this comment

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

LGTM!

@sonarqubecloud
Copy link
Copy Markdown

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

0.0% 0.0% Coverage
0.0% 0.0% Duplication

@leotm leotm merged commit a936db3 into main Jul 26, 2023
@leotm leotm deleted the typescript-5-eslint-upgrade-initial-fixes branch July 26, 2023 11:32
@github-actions github-actions bot locked and limited conversation to collaborators Jul 26, 2023
@github-actions github-actions bot removed the needs-dev-review PR needs reviews from other engineers (in order to receive required approvals) label Jul 26, 2023
@metamaskbot metamaskbot added the release-7.5.0 Issue or pull request that will be included in release 7.5.0 label Jul 26, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

No QA Needed Apply this label when your PR does not need any QA effort. release-7.5.0 Issue or pull request that will be included in release 7.5.0 type-tech-debt Technical debt

Projects

None yet

Development

Successfully merging this pull request may close these issues.

8 participants