eslint-plugin-es
eslint-plugin-es copied to clipboard
New Rule Proposal: `no-array-prototype-at` and `no-string-prototype-at`
Please describe what the rule should do:
-
no-array-prototype-at
... DisallowArray.prototype.at
and TypedArray.prototype.at
method. -
no-string-prototype-at
... DisallowString.prototype.at
method.
These methods will be added in ES2022.
https://github.com/tc39/proposal-relative-indexing-method
Provide 2-3 code examples that this rule will warn about:
var e = array.at(-1);
var e = typedArray.at(-1);
var c = string.at(-1);
Do you think we should rename the rule and to check both arrays and strings?