Skip to content

New Rule Proposal: no-array-prototype-at and no-string-prototype-at #76

@ota-meshi

Description

@ota-meshi

Please describe what the rule should do:

  • no-array-prototype-at ... Disallow Array.prototype.at and TypedArray .prototype.at method.
  • no-string-prototype-at ... Disallow String.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?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions