Skip to content

chore: ban Array/String.prototype.at() via eslint#603

Merged
mrholek merged 1 commit into
mainfrom
chore/lint-ban-array-at
Jul 14, 2026
Merged

chore: ban Array/String.prototype.at() via eslint#603
mrholek merged 1 commit into
mainfrom
chore/lint-ban-array-at

Conversation

@mrholek

@mrholek mrholek commented Jul 14, 2026

Copy link
Copy Markdown
Member

Follow-up to #602. Adds an eslint no-restricted-properties rule that forbids .at():

'no-restricted-properties': ['error', { property: 'at', message: '…use index access, e.g. arr[arr.length - 1]' }]

Array.prototype.at() / String.prototype.at() require Chrome 92 / Safari 15.4 / iOS 15.4, but .browserslistrc declares Chrome >= 60 / Safari >= 12 and the build does not polyfill (.babelrc.js has no useBuiltIns). The rule guards against silently reintroducing it. js/src is already .at()-free, so lint is green.

…rties

Guards against reintroducing .at(), which is unsupported in the browsers
declared in .browserslistrc (Chrome < 92, Safari < 15.4) and is not polyfilled
by the build.
@mrholek
mrholek merged commit 1ee7961 into main Jul 14, 2026
7 checks passed
@coveralls

Copy link
Copy Markdown

Coverage Report for CI Build 29297832842

Coverage remained the same at 94.655%

Details

  • Coverage remained the same as the base build.
  • Patch coverage: No coverable lines changed in this PR.
  • No coverage regressions found.

Uncovered Changes

No uncovered changes found.

Coverage Regressions

No coverage regressions found.


Coverage Stats

Coverage Status
Relevant Lines: 7462
Covered Lines: 7187
Line Coverage: 96.31%
Relevant Branches: 3090
Covered Branches: 2801
Branch Coverage: 90.65%
Branches in Coverage %: Yes
Coverage Strength: 737.42 hits per line

💛 - Coveralls

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants