Skip to content

Commit

Permalink
Update isDefaultThisBinding description
Browse files Browse the repository at this point in the history
  • Loading branch information
mdjermanovic committed Oct 4, 2019
1 parent e757dde commit 387ad1e
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions lib/rules/utils/ast-utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -581,14 +581,17 @@ module.exports = {
*
* First, this checks the node:
*
* - The function name does not start with uppercase (it's a constructor).
* - The function name does not start with uppercase. It's a convention to capitalize the names
* of constructor functions. This check is not performed if `capIsConstructor` is set to `false`.
* - The function does not have a JSDoc comment that has a @this tag.
*
* Next, this checks the location of the node.
* If the location is below, this judges `this` is valid.
*
* - The location is not on an object literal.
* - The location is not assigned to a variable which starts with an uppercase letter.
* - The location is not assigned to a variable which starts with an uppercase letter. Applies to anonymous
* functions only, as the name of the variable is considered to be the name of the function in this case.
* This check is not performed if `capIsConstructor` is set to `false`.
* - The location is not on an ES2015 class.
* - Its `bind`/`call`/`apply` method is not called directly.
* - The function is not a callback of array methods (such as `.forEach()`) if `thisArg` is given.
Expand Down

0 comments on commit 387ad1e

Please sign in to comment.