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

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

Merged
merged 9 commits into from
Jul 12, 2023

Conversation

legobeat
Copy link
Contributor

@legobeat legobeat commented May 12, 2023

  • 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
Copy link

socket-security bot commented May 12, 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.

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

Mrtenz commented May 12, 2023

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

@mcmire
Copy link
Contributor

mcmire commented May 12, 2023

Good timing. I was just thinking about this yesterday!

@legobeat
Copy link
Contributor Author

legobeat commented May 20, 2023

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
@@ -35,7 +35,7 @@
"eslint": "^8.27.0",
"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",
Copy link
Contributor Author

@legobeat legobeat May 20, 2023

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
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
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?

Copy link
Contributor Author

@legobeat legobeat Jul 10, 2023

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.

},
"peerDependencies": {
"@metamask/eslint-config": "^11.0.0",
"@typescript-eslint/eslint-plugin": "^5.42.1",
"@typescript-eslint/parser": "^5.42.1",
"eslint": "^8.27.0",
"typescript": "~4.8.4"
"typescript": "~4.8.4 || ^5.0.0"
Copy link
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
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
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.

"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
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
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?

Copy link
Member

@Gudahtt Gudahtt Jul 7, 2023

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

Copy link
Contributor Author

@legobeat legobeat Jul 10, 2023

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
Copy link

socket-security bot commented Jun 14, 2023

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 Gudahtt and a team 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
Copy link
Contributor

mcmire commented Jul 12, 2023

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
Contributor Author

@mcmire rebased

Copy link
Contributor

@mcmire mcmire 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!

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