Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

fix(eslint-plugin): [prefer-readonly] report if a member's property is reassigned#6043

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Conversation

@islandryu
Copy link
Contributor

@islandryuislandryu commentedNov 19, 2022
edited
Loading

PR Checklist

Overview

@nx-cloud
Copy link

nx-cloudbot commentedNov 19, 2022
edited
Loading

☁️ Nx Cloud Report

CI is running/has finished running commands for commitbe983e9. 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


✅ Successfully ran 47 targets

Sent with 💌 fromNxCloud.

@typescript-eslint
Copy link
Contributor

Thanks for the PR,@islandryu!

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 onhttps://opencollective.com/typescript-eslint.

@netlify
Copy link

netlifybot commentedNov 19, 2022
edited
Loading

Deploy Preview fortypescript-eslint ready!

NameLink
🔨 Latest commitbe983e9
🔍 Latest deploy loghttps://app.netlify.com/sites/typescript-eslint/deploys/6382776df71c450008c5c1f5
😎 Deploy Previewhttps://deploy-preview-6043--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 yourNetlify site settings.

@codecov
Copy link

codecovbot commentedNov 19, 2022
edited
Loading

Codecov Report

Merging#6043 (be983e9) intomain (d69fdf4) willincrease coverage by0.00%.
The diff coverage is100.00%.

Additional details and impacted files
@@           Coverage Diff           @@##             main    #6043   +/-   ##=======================================  Coverage   91.27%   91.28%           =======================================  Files         366      366             Lines       12362    12363    +1       Branches     3616     3617    +1     =======================================+ Hits        11284    11285    +1  Misses        768      768             Partials      310      310
FlagCoverage Δ
unittest91.28% <100.00%> (+<0.01%)⬆️

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

Impacted FilesCoverage Δ
...ackages/eslint-plugin/src/rules/prefer-readonly.ts99.09% <100.00%> (+<0.01%)⬆️

@islandryuislandryu marked this pull request as ready for reviewNovember 19, 2022 13:17
Copy link
Member

@JoshuaKGoldbergJoshuaKGoldberg left a comment

Choose a reason for hiding this comment

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

Code change looks great to start, thanks for sending this in@islandryu! 🙌 Just requesting changes for a bit more test coverage.

messageId:'preferReadonly',
},
],
},
Copy link
Member

@JoshuaKGoldbergJoshuaKGoldbergNov 19, 2022
edited
Loading

Choose a reason for hiding this comment

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

A few more test cases to consider...

this.testObj.prop;this.testObj?.prop;this.testObj!.prop;this.testObj!.prop='';this.testObj.prop.prop='';this.testObj.prop.doesSomething();this.testObj?.prop.prop;this.testObj?.prop?.prop;this.testObj.prop?.prop;this.testObj!.prop?.prop;

For any change to rule logic, it's generally good to try to add bothvalid andinvalid test cases.

Choose a reason for hiding this comment

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

@islandryu by "test cases" I do mean cases plural - we generally try to keep these separate, so that each test case tests one case. It's easy to miss incorrect or mismatched errors when they're all lumped together. Could you split them up please?

@JoshuaKGoldbergJoshuaKGoldberg added the awaiting responseIssues waiting for a reply from the OP or another party labelNov 19, 2022
@islandryu
Copy link
ContributorAuthor

@JoshuaKGoldberg
Thank you!
I've added a test case!

JoshuaKGoldberg reacted with heart emoji

Copy link
Member

@JoshuaKGoldbergJoshuaKGoldberg left a comment

Choose a reason for hiding this comment

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

Sorry, I might not have been very clear - I'm hoping for quite a few cases to test this. It's a behavior that has a lot of edge cases we should test for individually. Thanks!

messageId:'preferReadonly',
},
],
},

Choose a reason for hiding this comment

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

@islandryu by "test cases" I do mean cases plural - we generally try to keep these separate, so that each test case tests one case. It's easy to miss incorrect or mismatched errors when they're all lumped together. Could you split them up please?

@islandryu
Copy link
ContributorAuthor

@JoshuaKGoldberg
Thank you.
Is it correct like this?

Copy link
Member

@JoshuaKGoldbergJoshuaKGoldberg left a comment

Choose a reason for hiding this comment

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

Yup, this is great - thanks for sending this in! 🙌

@JoshuaKGoldbergJoshuaKGoldbergenabled auto-merge (squash)November 26, 2022 20:30
@JoshuaKGoldbergJoshuaKGoldberg merged commit6e079eb intotypescript-eslint:mainNov 26, 2022
@github-actionsgithub-actionsbot locked asresolvedand limited conversation to collaboratorsDec 5, 2022
Sign up for freeto subscribe to this conversation on GitHub. Already have an account?Sign in.

Reviewers

@JoshuaKGoldbergJoshuaKGoldbergJoshuaKGoldberg approved these changes

Assignees

No one assigned

Labels

awaiting responseIssues waiting for a reply from the OP or another party

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

Bug: [prefer-readonly] does not report if a member's property is reassigned

2 participants

@islandryu@JoshuaKGoldberg

[8]ページ先頭

©2009-2025 Movatter.jp