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: improve autofix of prefer-object-has-own #15419

Merged
merged 7 commits into from Dec 14, 2021

Conversation

snitin315
Copy link
Contributor

Prerequisites checklist

What is the purpose of this pull request? (put an "X" next to an item)

[ ] Documentation update
[x] Bug fix (template)
[ ] New rule (template)
[ ] Changes an existing rule (template)
[ ] Add autofix to a rule
[ ] Add a CLI option
[ ] Add something to the core
[ ] Other, please explain:

What changes did you make? (Give an overview)

Resolve #15346 (comment)

Improve autofix for the case - return{}.hasOwnProperty.call(object, property)

Is there anything you'd like reviewers to focus on?

No

@eslint-github-bot eslint-github-bot bot added triage An ESLint team member will look at this issue soon bug ESLint is working incorrectly labels Dec 11, 2021
@snitin315 snitin315 added accepted There is consensus among the team that this change meets the criteria for inclusion autofix This change is related to ESLint's autofixing capabilities rule Relates to ESLint's core rules and removed triage An ESLint team member will look at this issue soon labels Dec 11, 2021
@snitin315 snitin315 force-pushed the fix/improve-autofix-prefer-object-has-own branch from 548eb55 to c7367b5 Compare December 11, 2021 08:25
lib/rules/prefer-object-has-own.js Outdated Show resolved Hide resolved
lib/rules/prefer-object-has-own.js Outdated Show resolved Hide resolved
@snitin315 snitin315 force-pushed the fix/improve-autofix-prefer-object-has-own branch from 767fb28 to 95e7cd3 Compare December 13, 2021 01:21
@snitin315 snitin315 force-pushed the fix/improve-autofix-prefer-object-has-own branch from 52b954c to 46ab859 Compare December 13, 2021 01:26
Copy link
Member

@mdjermanovic mdjermanovic left a comment

Choose a reason for hiding this comment

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

This works well, I have only one small suggestion.

lib/rules/prefer-object-has-own.js Outdated Show resolved Hide resolved
Copy link
Member

@mdjermanovic mdjermanovic left a comment

Choose a reason for hiding this comment

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

LGTM, thanks!

@mdjermanovic mdjermanovic merged commit f13d4a6 into main Dec 14, 2021
@mdjermanovic mdjermanovic deleted the fix/improve-autofix-prefer-object-has-own branch December 14, 2021 16:14
@eslint-github-bot eslint-github-bot bot locked and limited conversation to collaborators Jun 13, 2022
@eslint-github-bot eslint-github-bot bot added the archived due to age This issue has been archived; please open a new issue for any further discussion label Jun 13, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
accepted There is consensus among the team that this change meets the criteria for inclusion archived due to age This issue has been archived; please open a new issue for any further discussion autofix This change is related to ESLint's autofixing capabilities bug ESLint is working incorrectly rule Relates to ESLint's core rules
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants