summaryrefslogtreecommitdiff
path: root/.eslintrc.yml
diff options
context:
space:
mode:
authorPhilip Chimento <philip.chimento@gmail.com>2020-08-15 12:08:23 -0700
committerPhilip Chimento <philip.chimento@gmail.com>2020-08-30 19:38:19 -0700
commit0f3c532b818f302e18bef5838986c4deb6cc475e (patch)
tree7884cf183b9262ef2a322a9470fd0689570b2964 /.eslintrc.yml
parent9d39e6874423d2258600217f237caa95c168e187 (diff)
downloadgjs-0f3c532b818f302e18bef5838986c4deb6cc475e.tar.gz
maint: Add more eslint rules for restricted syntax
We do want people to stop using Lang.copyProperties. In addition, 'x instanceof Array' is not correct, use Array.isArray() instead.
Diffstat (limited to '.eslintrc.yml')
-rw-r--r--.eslintrc.yml5
1 files changed, 5 insertions, 0 deletions
diff --git a/.eslintrc.yml b/.eslintrc.yml
index a6164125..b50a5760 100644
--- a/.eslintrc.yml
+++ b/.eslintrc.yml
@@ -109,6 +109,9 @@ rules:
no-restricted-properties:
- error
- object: Lang
+ property: copyProperties
+ message: Use Object.assign()
+ - object: Lang
property: bind
message: Use arrow notation or Function.prototype.bind()
- object: Lang
@@ -129,6 +132,8 @@ rules:
BlockStatement[body.length=1]
CallExpression[arguments.length=0][callee.object.type="Super"][callee.property.name="_init"]
message: _init() that only calls super._init() is unnecessary
+ - selector: BinaryExpression[operator="instanceof"][right.name="Array"]
+ message: Use Array.isArray()
no-return-assign: error
no-return-await: error
no-self-compare: error