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

Update: enforceForClassFields in class-methods-use-this (refs #14857) #15018

Merged
merged 13 commits into from Sep 10, 2021

Conversation

yeonjuan
Copy link
Member

@yeonjuan yeonjuan commented Sep 1, 2021

Prerequisites checklist

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

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

What changes did you make? (Give an overview)

  1. add enforceForClassFields options.

2.Fix exceptMethods options to use # prefix for ignoring private methods

3, fix false-negative

/* eslint class-methods-use-this: ["error"] */

class C {
    doesNotUseThis() { // false negative
        return class { foo = this };
    }
}

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

@eslint-github-bot eslint-github-bot bot added the triage An ESLint team member will look at this issue soon label Sep 1, 2021
@linux-foundation-easycla
Copy link

linux-foundation-easycla bot commented Sep 1, 2021

CLA Signed

The committers are authorized under a signed CLA.

@yeonjuan yeonjuan changed the title Update: update options in class-methods-use (refs #14857) Update: enforceForClassFields option in class-methods-use (refs #14857) Sep 2, 2021
@mdjermanovic mdjermanovic added accepted There is consensus among the team that this change meets the criteria for inclusion bug ESLint is working incorrectly enhancement This change enhances an existing feature of ESLint rule Relates to ESLint's core rules and removed triage An ESLint team member will look at this issue soon labels Sep 2, 2021
lib/rules/class-methods-use-this.js Outdated Show resolved Hide resolved
@yeonjuan
Copy link
Member Author

yeonjuan commented Sep 4, 2021

@mdjermanovic Thanks for the review :) I changed it

docs/rules/class-methods-use-this.md Outdated Show resolved Hide resolved
docs/rules/class-methods-use-this.md Outdated Show resolved Hide resolved
docs/rules/class-methods-use-this.md Outdated Show resolved Hide resolved
docs/rules/class-methods-use-this.md Outdated Show resolved Hide resolved
docs/rules/class-methods-use-this.md Outdated Show resolved Hide resolved
docs/rules/class-methods-use-this.md Outdated Show resolved Hide resolved
docs/rules/class-methods-use-this.md Outdated Show resolved Hide resolved
@mdjermanovic
Copy link
Member

Code looks good! I left only some suggestions about the documentation.

yeonjuan and others added 8 commits September 6, 2021 01:44
Co-authored-by: Milos Djermanovic <milos.djermanovic@gmail.com>
Co-authored-by: Milos Djermanovic <milos.djermanovic@gmail.com>
Co-authored-by: Milos Djermanovic <milos.djermanovic@gmail.com>
Co-authored-by: Milos Djermanovic <milos.djermanovic@gmail.com>
Co-authored-by: Milos Djermanovic <milos.djermanovic@gmail.com>
Co-authored-by: Milos Djermanovic <milos.djermanovic@gmail.com>
Co-authored-by: Milos Djermanovic <milos.djermanovic@gmail.com>
@yeonjuan
Copy link
Member Author

yeonjuan commented Sep 5, 2021

@mdjermanovic Thanks for the suggestions. I edited and also changed the example order - #15018 (comment)

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

Also thanks for fixing the behavior of "exceptMethods" with numeric and string literals as property names.

@mdjermanovic mdjermanovic changed the title Update: enforceForClassFields option in class-methods-use (refs #14857) Update: enforceForClassFields in class-methods-use-this (refs #14857) Sep 5, 2021
@mdjermanovic mdjermanovic merged commit 6d1ccb6 into master Sep 10, 2021
@mdjermanovic mdjermanovic deleted the class-field-calss-methods-use-this branch September 10, 2021 10:14
@eslint-github-bot eslint-github-bot bot locked and limited conversation to collaborators Mar 10, 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 Mar 10, 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 bug ESLint is working incorrectly enhancement This change enhances an existing feature of ESLint rule Relates to ESLint's core rules
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants