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

Docs: update doc for class-methods-use-this (fixes #8910) #9374

Merged
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
7 changes: 6 additions & 1 deletion docs/rules/class-methods-use-this.md
@@ -1,6 +1,6 @@
# Enforce that class methods utilize `this` (class-methods-use-this)

If a class method does not use `this`, it can safely be made a static function.
If a class method does not use `this`, it can *sometimes* be made a static function. It is not always the case that you can turn the class method to a static function and depends on your codebase.

It's possible to have a class method which doesn't use `this`, such as:

Expand Down Expand Up @@ -117,3 +117,8 @@ class A {
}
}
```

## Further Reading

* [Classes](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes)
* [Static Methods](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Classes/static)