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

fix: rename typeParameters to typeArguments where needed #5384

Conversation

JoshuaKGoldberg
Copy link
Member

@JoshuaKGoldberg JoshuaKGoldberg commented Jul 26, 2022

BREAKING CHANGE:
Adds duplicate properties on the AST and deprecates their old names

PR Checklist

Overview

Renames typeParameters to typeArguments in locations that are indeed providing type arguments.

To recap the terminology:

  • An argument is something you provide to a recipient, such as a type provided explicitly to a call expression
  • A parameter is how the recipient receives what you provide, such as a function declaration's generic type parameter

Marked as a breaking change even though the old, now-@deprecated property is still there.

@typescript-eslint
Copy link
Contributor

Thanks for the PR, @JoshuaKGoldberg!

typescript-eslint is a 100% community driven project, and we are incredibly grateful that you are contributing to that community.

The core maintainers work on this in their personal time, so please understand that it may not be possible for them to review your work immediately.

Thanks again!


🙏 Please, if you or your company is finding typescript-eslint valuable, help us sustain the project by sponsoring it transparently on https://opencollective.com/typescript-eslint. As a thank you, your profile/company logo will be added to our main README which receives thousands of unique visitors per day.

@nx-cloud
Copy link

nx-cloud bot commented Jul 26, 2022

☁️ Nx Cloud Report

CI is running/has finished running commands for commit 627a883. As they complete they will appear below. Click to see the status, the terminal output, and the build insights.

📂 See all runs for this branch


🟥 Failed Commands
nx run-many --target=lint --parallel
✅ Successfully ran 50 targets

Sent with 💌 from NxCloud.

@netlify
Copy link

netlify bot commented Jul 26, 2022

Deploy Preview for typescript-eslint ready!

Name Link
🔨 Latest commit 627a883
🔍 Latest deploy log https://app.netlify.com/sites/typescript-eslint/deploys/63f7061a0a1f550008a8517d
😎 Deploy Preview https://deploy-preview-5384--typescript-eslint.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify site settings.

@JoshuaKGoldberg JoshuaKGoldberg added the breaking change This change will require a new major version to be released label Jul 26, 2022
@JoshuaKGoldberg JoshuaKGoldberg deleted the correct-type-parameters-to-arguments branch July 26, 2022 01:19
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Aug 26, 2022
@JoshuaKGoldberg JoshuaKGoldberg restored the correct-type-parameters-to-arguments branch February 5, 2023 05:47
@JoshuaKGoldberg JoshuaKGoldberg force-pushed the correct-type-parameters-to-arguments branch from 2cc8461 to 6573aa0 Compare February 5, 2023 06:02
@JoshuaKGoldberg JoshuaKGoldberg marked this pull request as ready for review February 5, 2023 06:26
@JoshuaKGoldberg JoshuaKGoldberg added this to the 6.0.0 milestone Feb 5, 2023
@bradzacher
Copy link
Member

Thinking about this in terms of the broader ecosystem and the impacts - I wonder if we want to give consumers one major version to migrate?
A hard cut over might be a bit difficult for the ecosystem to come handle as it would involve every single plugin updating their code (which could leave users in an impossible to upgrade state for some time).

How about this: this version we add the new property and we mark the old property as @deprecated, then in v7 we remove the old property entirely.

If we wanted we could also do something like define a getter that throws when in a test environment to help flag plugins that they should migrate.

WDYT?

@JoshuaKGoldberg JoshuaKGoldberg changed the base branch from main to v6 February 7, 2023 17:03
@JoshuaKGoldberg
Copy link
Member Author

JoshuaKGoldberg commented Feb 7, 2023

Yeah that makes sense. I'll put the @deprecated old properties in this PR (once I get the new ones working)

The process env check + getter idea is really nifty - seems like a good followup feature request. I'd like to get it in v6... thinking 🤔

@typescript-eslint typescript-eslint unlocked this conversation Feb 7, 2023
@codecov
Copy link

codecov bot commented Feb 10, 2023

Codecov Report

Merging #5384 (627a883) into v6 (d676683) will not change coverage.
The diff coverage is 72.50%.

Additional details and impacted files
@@           Coverage Diff           @@
##               v6    #5384   +/-   ##
=======================================
  Coverage   87.06%   87.06%           
=======================================
  Files         365      365           
  Lines       12579    12579           
  Branches     3720     3720           
=======================================
  Hits        10952    10952           
  Misses       1278     1278           
  Partials      349      349           
Flag Coverage Δ
unittest 87.06% <72.50%> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

Impacted Files Coverage Δ
...es/eslint-plugin/src/rules/no-array-constructor.ts 100.00% <ø> (ø)
...es/eslint-plugin/src/rules/no-invalid-void-type.ts 95.83% <0.00%> (ø)
packages/eslint-plugin/src/rules/no-type-alias.ts 100.00% <ø> (ø)
packages/type-utils/src/isUnsafeAssignment.ts 84.00% <ø> (ø)
packages/visitor-keys/src/visitor-keys.ts 100.00% <ø> (ø)
packages/typescript-estree/src/convert.ts 28.20% <18.18%> (ø)
packages/eslint-plugin/src/rules/array-type.ts 97.14% <100.00%> (ø)
packages/eslint-plugin/src/rules/ban-types.ts 100.00% <100.00%> (ø)
...lugin/src/rules/consistent-generic-constructors.ts 90.69% <100.00%> (ø)
...lugin/src/rules/consistent-indexed-object-style.ts 92.06% <100.00%> (ø)
... and 9 more

@bradzacher bradzacher changed the title fix!: rename typeParameters to typeArguments where needed fix: rename typeParameters to typeArguments where needed Feb 13, 2023
@bradzacher bradzacher added the awaiting response Issues waiting for a reply from the OP or another party label Feb 13, 2023
@bradzacher bradzacher removed the awaiting response Issues waiting for a reply from the OP or another party label Feb 20, 2023
Copy link
Member

@bradzacher bradzacher left a comment

Choose a reason for hiding this comment

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

Yeah that makes sense. I'll put the @deprecated old properties in this PR (once I get the new ones working)

Once we've got this change, this is good-to-go I think.

yarn.lock Outdated Show resolved Hide resolved
@bradzacher bradzacher added the awaiting response Issues waiting for a reply from the OP or another party label Feb 20, 2023
@JoshuaKGoldberg JoshuaKGoldberg marked this pull request as draft February 21, 2023 03:45
@JoshuaKGoldberg
Copy link
Member Author

JoshuaKGoldberg commented Feb 21, 2023

I think the lint & integration test failures are unrelated to this PR. Indeed, they were ✅

@JoshuaKGoldberg JoshuaKGoldberg marked this pull request as ready for review February 21, 2023 20:45
@JoshuaKGoldberg JoshuaKGoldberg removed the awaiting response Issues waiting for a reply from the OP or another party label Feb 22, 2023
@JoshuaKGoldberg JoshuaKGoldberg marked this pull request as draft February 23, 2023 06:09
@JoshuaKGoldberg JoshuaKGoldberg marked this pull request as ready for review February 23, 2023 06:25
@JoshuaKGoldberg JoshuaKGoldberg merged commit 08d757b into typescript-eslint:v6 Feb 23, 2023
@JoshuaKGoldberg JoshuaKGoldberg deleted the correct-type-parameters-to-arguments branch February 23, 2023 07:02
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Mar 3, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
breaking change This change will require a new major version to be released
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Some properties named typeParameters instead of typeArguments
3 participants