Skip to content

Commit

Permalink
Docs: update doc for class-methods-use-this (fixes eslint#8910)
Browse files Browse the repository at this point in the history
  • Loading branch information
VictorHom committed Oct 1, 2017
1 parent 8ebb034 commit 98a28b6
Showing 1 changed file with 6 additions and 1 deletion.
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)

0 comments on commit 98a28b6

Please sign in to comment.