diff options
author | Philip Chimento <philip.chimento@gmail.com> | 2019-08-04 11:25:29 -0700 |
---|---|---|
committer | Philip Chimento <philip.chimento@gmail.com> | 2019-08-13 22:18:32 -0700 |
commit | a7e935582e6fd0687f705403b7d070707b7e61e5 (patch) | |
tree | 643c557d23001317dbab95880981c772e96bbb09 | |
parent | 86f5d9dbc5510ecf97621c39721db31089618432 (diff) | |
download | gjs-a7e935582e6fd0687f705403b7d070707b7e61e5.tar.gz |
CI: Add space-in-parens and space-unary-ops to eslint rules
We already followed these rules except in some of the tweener code.
-rw-r--r-- | .eslintrc.yml | 2 | ||||
-rw-r--r-- | modules/tweener/equations.js | 8 | ||||
-rw-r--r-- | modules/tweener/tweener.js | 2 |
3 files changed, 7 insertions, 5 deletions
diff --git a/.eslintrc.yml b/.eslintrc.yml index 8a248248..e81e7014 100644 --- a/.eslintrc.yml +++ b/.eslintrc.yml @@ -135,9 +135,11 @@ rules: # for `function ()` and `async () =>`, preserve space around keywords anonymous: always asyncArrow: always + space-in-parens: error space-infix-ops: - error - int32Hint: false + space-unary-ops: error globals: ARGV: readonly Debugger: readonly diff --git a/modules/tweener/equations.js b/modules/tweener/equations.js index dc009863..fdcbc745 100644 --- a/modules/tweener/equations.js +++ b/modules/tweener/equations.js @@ -479,7 +479,7 @@ function easeInElastic(t, b, c, d, pParams) { } else { s = p / (2 * Math.PI) * Math.asin(c / a); } - return -(a * Math.pow(2, 10 * (t -= 1)) * Math.sin( (t * d - s) * (2 * Math.PI) / p )) + b; + return -(a * Math.pow(2, 10 * (t -= 1)) * Math.sin((t * d - s) * (2 * Math.PI) / p)) + b; } /** @@ -507,7 +507,7 @@ function easeOutElastic(t, b, c, d, pParams) { } else { s = p / (2 * Math.PI) * Math.asin(c / a); } - return a * Math.pow(2, -10 * t) * Math.sin( (t * d - s) * (2 * Math.PI) / p ) + c + b; + return a * Math.pow(2, -10 * t) * Math.sin((t * d - s) * (2 * Math.PI) / p) + c + b; } /** @@ -536,8 +536,8 @@ function easeInOutElastic(t, b, c, d, pParams) { s = p / (2 * Math.PI) * Math.asin(c / a); } if (t < 1) - return -.5 * (a * Math.pow(2, 10 * (t -= 1)) * Math.sin( (t * d - s) * (2 * Math.PI) / p )) + b; - return a * Math.pow(2, -10 * (t -= 1)) * Math.sin( (t * d - s) * (2 * Math.PI) / p ) * .5 + c + b; + return -.5 * (a * Math.pow(2, 10 * (t -= 1)) * Math.sin((t * d - s) * (2 * Math.PI) / p)) + b; + return a * Math.pow(2, -10 * (t -= 1)) * Math.sin((t * d - s) * (2 * Math.PI) / p) * .5 + c + b; } /** diff --git a/modules/tweener/tweener.js b/modules/tweener/tweener.js index 1ce79207..540d4853 100644 --- a/modules/tweener/tweener.js +++ b/modules/tweener/tweener.js @@ -623,7 +623,7 @@ function _getNumberOfProperties(object) { // the following line is disabled becasue eslint was picking up the following error: the variable name is defined but never used, however since it is required to search the object it is used and we'll allow the line to be ignored to get rid of the error message /* eslint-disable-next-line */ for (let name in object) { - totalProperties ++; + totalProperties++; } |