amilajack / amilajack/eslint-plugin-compat

Dont work with Array.prototype.at

Offen
#539 11 Kommentare 10 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
Vorherrschende Sprache
TypeScript
Sterne
3.2k
Forks
115
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

I have Next.js (13) project, in code i use `['some', 'arrays'].at(-1)` and **dont has error from this plugin**.

`Array.prototype.at` supports in Safari 15.4: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/at
but i have correct `.browserlistrc` with `not safari < 12`:
```
last 2 versions
since 2018
node 17

not dead
not android < 5
not op_mini all
not opera < 64
not ios_saf < 12.2
not safari < 12
not edge < 100
not firefox < 100
not chrome < 80
```

Project fixed when i add `import 'core-js/features/array/at'` in `pages/_app.tsx`.

Plugin added correctly, and have setting in `.eslintrc.json`:
```
"settings": {
"polyfills": [
"URL.createObjectURL",
"URL.revokeObjectURL"
]
},
```
Added because Next add some (3) [polyfills underhood](https://nextjs.org/docs/basic-features/supported-browsers-features).

Beitragsleitfaden

Beitragsleitfaden öffnen

Bewertung

Dieses Issue wurde noch nicht bewertet.

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.