From: jdlrobson Date: Wed, 1 Aug 2018 07:28:33 +0000 (+0800) Subject: Warn against certain jQuery methods X-Git-Tag: 1.34.0-rc.0~4406^2 X-Git-Url: http://git.cyclocoop.org/%22%20.%20generer_url_ecrire%28%22config_fonctions%22%2C%20%22image_process=%24process%22%29%20.%20%22?a=commitdiff_plain;h=93976b5c341183e4e754badca98f82a87384d185;p=lhc%2Fweb%2Fwiklou.git Warn against certain jQuery methods For time being these messages will warn. In a follow up, I plan to fix issues and add eslint-ignore lines and make this error rather than warn. Bug: T200877 Change-Id: I4552191f639b1022cb085ef5eb4abda835c2d91c --- diff --git a/.eslintrc.json b/.eslintrc.json index 844895d12c..e24fa83491 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -11,6 +11,34 @@ "OO": false }, "rules": { + "no-restricted-properties": [ + 1, + { + "object": "$", + "property": "map", + "message": "Please use Array.prototype.map instead" + }, + { + "object": "$", + "property": "isArray", + "message": "Please use Array.isArray instead" + }, + { + "object": "$", + "property": "isFunction", + "message": "Please use typeof (e.g. typeof e === 'function') instead" + }, + { + "object": "$", + "property": "grep", + "message": "Please use Array.prototype.filter instead" + }, + { + "object": "$", + "property": "trim", + "message": "Please use String.prototype.trim instead" + } + ], "dot-notation": 0, "max-len": 0 }