Skip to content

feat(eslint-plugin): [prefer-readonly-parameter-types] Added option utilityTypeSufficient which makes Readonly<> sufficient to satisfy the rule #4053

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

Closed
wants to merge 5 commits into from

Conversation

marekdedic
Copy link
Contributor

@marekdedic marekdedic commented Oct 25, 2021

PR Checklist

Overview

Added the option utilityTypeSufficient to the rule prefer-readonly-parameter-types which makes it so that Readonly<> is enough to satisfy the rule. Turning this option on is a sort of a compromise as it makes it not so strict, but much easier to use.

This could "solve" #2699.

…tilityTypeSufficient which makes Readonly<> sufficient to satisfy the rule
@typescript-eslint
Copy link
Contributor

Thanks for the PR, @marekdedic!

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 Oct 25, 2021

@codecov
Copy link

codecov bot commented Oct 25, 2021

Codecov Report

Merging #4053 (ba0d99b) into master (f418f48) will increase coverage by 0.00%.
The diff coverage is 100.00%.

❗ Current head ba0d99b differs from pull request most recent head 63eefc5. Consider uploading reports for the commit 63eefc5 to get more accurate results

@@           Coverage Diff           @@
##           master    #4053   +/-   ##
=======================================
  Coverage   93.33%   93.33%           
=======================================
  Files         152      152           
  Lines        8014     8018    +4     
  Branches     2568     2571    +3     
=======================================
+ Hits         7480     7484    +4     
  Misses        180      180           
  Partials      354      354           
Flag Coverage Δ
unittest 93.33% <100.00%> (+<0.01%) ⬆️

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

Impacted Files Coverage Δ
...lugin/src/rules/prefer-readonly-parameter-types.ts 100.00% <100.00%> (ø)

@marekdedic marekdedic marked this pull request as ready for review October 25, 2021 15:10
@JoshuaKGoldberg
Copy link
Member

Hey @marekdedic, thanks for sending this PR! It looks like the issue you're referencing from last year was not marked as accepting PRs: #2699 (comment). We generally ask that PRs address accepted issues, to save you the time of writing up the PR in case the issue isn't something the project should take in.

If you'd like to make the case that the rule should have an option to allow Readonly<> and similar, could you please file a new issue?

@marekdedic
Copy link
Contributor Author

I can see why...

@marekdedic marekdedic closed this Nov 16, 2021
@marekdedic marekdedic deleted the prefer-readonly-parameter-types-allow-utility-type branch November 16, 2021 14:02
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Dec 17, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[prefer-readonly-parameter-types] FR: Add an option to allow Readonly<> to satisfy the rule
2 participants