Skip to content

typescript: add support for typescript 5.0.x, 5.1.x - #288

Merged
legobeat merged 9 commits into
MetaMask:mainfrom
legobeat:typescript-5
Jul 12, 2023
Merged

legobeat merged 9 commits into
MetaMask:mainfrom
legobeat:typescript-5

Conversation

@legobeat

@legobeat legobeat commented May 12, 2023 •

Copy link
Copy Markdown
Contributor
  • This lifts the current typescript version restriction to allow running on version 5.
  • It also updates the package devDependency typescript accordingly.
  • yarn dedupe and minor-bump related deps

@legobeat
legobeat requested a review from a team as a code owner May 12, 2023 04:36
@legobeat
legobeat marked this pull request as draft May 12, 2023 04:36
@socket-security

socket-security Bot commented May 12, 2023 •

Copy link
Copy Markdown

👍 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.

@legobeat
legobeat marked this pull request as ready for review May 12, 2023 04:38
@Mrtenz

Mrtenz commented May 12, 2023

Copy link
Copy Markdown
Member

Did you verify that the ESLint plugin works with TypeScript 5? Might have to bump that too.

@mcmire

mcmire commented May 12, 2023

Copy link
Copy Markdown
Contributor

Good timing. I was just thinking about this yesterday!

@legobeat
legobeat marked this pull request as draft May 12, 2023 22:08
@legobeat

legobeat commented May 20, 2023 •

Copy link
Copy Markdown
Contributor Author

Did you verify that the ESLint plugin works with TypeScript 5? Might have to bump that too.

Seems fine (and tests are now running on ts5) but it did seem warranted to bump eslint-plugin-jsdoc (included here now).

Also lifted the peerDependency range of the same plugin to allow existing users to upgrade config package while staying on the same plugin version.

@legobeat
legobeat marked this pull request as ready for review May 20, 2023 01:01
Comment thread packages/base/package.json Outdated
"eslint-config-prettier": "^8.5.0",
"eslint-plugin-import": "^2.26.0",
"eslint-plugin-jsdoc": "^39.6.2",
"eslint-plugin-jsdoc": "^39.6.2 || ^41 || ^43.0.7",

@legobeat legobeat May 20, 2023 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

For background of motivation of the specific version, see #290.

  • Minimize upgrade overhead (keep existing ^39.6.2)
  • Maintenance fixes for existing users without breaking rules (^41)
  • Forwards-compatibility with new rules while allowing for node 14 (^43.0.7)

Open to holding off on introducing 43 here if considered premature or out of scope.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Hmm. Wouldn't using this with v43 cause the error that #290 is meant to resolve? Perhaps we should wait for that PR before introducing this.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

@legobeat What do you think about @Gudahtt's comment?

@legobeat legobeat Jul 10, 2023 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

In order to unblock this and break the relationship between the two PRs, I'm dropping ^43.0.7 from this one.

Comment thread packages/typescript/package.json Outdated
"@typescript-eslint/parser": "^5.42.1",
"eslint": "^8.27.0",
"typescript": "~4.8.4"
"typescript": "~4.8.4 || ^5.0.0"

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

We had been intentionally using ~ ranges for TypeScript to prevent it from being used on TypeScript versions that may not be compatible with the plugin we're using. i.e. to prevent this error:

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

Without this, it's easy to upgrade and not notice any incompatibility until you run the linter locally and see that message.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I agree. It's annoying that @typescript-eslint isn't automatically compatible with future versions of TypeScript, but I think it's better for our projects to not get updated to a new version of TypeScript prematurely than it is to have to keep the TypeScript versions manually updated. What do you think about changing this to:

Suggested change
"typescript": "~4.8.4 || ^5.0.0"
"typescript": "~4.8.4 || ~5.0.0"

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Let's at least support 5.1. Changing to ~4.8.4 || ~5.0 || ~5.1.

Comment thread packages/base/package.json Outdated
"eslint-plugin-import": "^2.26.0",
"eslint-plugin-jsdoc": "^39.6.2",
"eslint-plugin-import": "^2.27.5",
"eslint-plugin-jsdoc": "^39.6.2 || ^41 || ^43.0.7",

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

The versions referenced in each README should be updated as well

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

What do we recommend that people install for new projects? Should it be ^43.0.7?

@Gudahtt Gudahtt Jul 7, 2023 •

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Good question. I guess that could stay the same for now, though the eslint-plugin-import reference should be updated at least, since the minimum has been increased

@legobeat legobeat Jul 10, 2023 •

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

READMEs updated. Changed recommendation to ^41.1.2.

@socket-security

socket-security Bot commented Jun 14, 2023 •

Copy link
Copy Markdown

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

Packages Version New capabilities Transitives Size Publisher
eslint-plugin-jsdoc 41.1.2 None +6 2.37 MB gajus

🚮 Removed packages: typescript@4.8.4

@legobeat
legobeat requested review from a team and Gudahtt July 7, 2023 06:22
@legobeat legobeat changed the title typescript: add support for typescript@^5.0.0 typescript: add support for typescript 5.0, 5.1 Jul 10, 2023
@legobeat legobeat changed the title typescript: add support for typescript 5.0, 5.1 typescript: add support for typescript 5.0.x, 5.1.x Jul 10, 2023
@mcmire

mcmire commented Jul 12, 2023 •

Copy link
Copy Markdown
Contributor

The version ranges are getting a bit complicated — I hope we can simplify them in the future — but I can live with them. I can approve this once the conflicts are resolved.

@legobeat

Copy link
Copy Markdown
Contributor Author

@mcmire rebased

@mcmire mcmire left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks good!

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.

4 participants