From 9312f3d1b249bb226016480f9c1002f285923444 Mon Sep 17 00:00:00 2001 From: jdlrobson Date: Mon, 1 Oct 2018 15:33:46 -0700 Subject: [PATCH] Forbid certain methods with ES6 equivalents We do this in core and in MobileFrontend. Let's ban some here too. Change-Id: I4cc24381ab0b637eb386c93bd0d88fe803db0483 --- .eslintrc.json | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/.eslintrc.json b/.eslintrc.json index 5ffb9b0..09fb2d2 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -12,6 +12,36 @@ }, "rules": { "no-restricted-properties": [2, + { + "object": "$", + "property": "noop", + "message": "Use function() {}" + }, + { + "object": "$", + "property": "isFunction", + "message": "Please use typeof" + }, + { + "object": "$", + "property": "map", + "message": "Please use Array.prototype.map instead" + }, + { + "object": "$", + "property": "isArray", + "message": "Please use Array.isArray instead" + }, + { + "object": "$", + "property": "grep", + "message": "Please use Array.prototype.filter instead" + }, + { + "object": "$", + "property": "trim", + "message": "Please use String.prototype.trim instead" + }, { "property": "done", "message": "The method `done` if used with Deferred objects is incompatible with ES6 Promises. Please use `then`."