Skip to content

feat: add dom.iterable lib in TS compiler options#69

Merged
heymath merged 1 commit intomainfrom
add-tsconfig-compiler-option-lib-dom-iterable
Sep 5, 2025
Merged

feat: add dom.iterable lib in TS compiler options#69
heymath merged 1 commit intomainfrom
add-tsconfig-compiler-option-lib-dom-iterable

Conversation

@heymath
Copy link
Member

@heymath heymath commented Apr 1, 2025

Proposition : ajout de la lib "dom.iterable" dans la config TypeScript

Pourquoi ?

J'avais écrit ça dans une PR :

const [touch] = event.touches;

Parce que la règle ESLint m'empêchait d'écrire :

const touch = event.touches[0];

Mais du coup ça pètait une erreur TypeScript au build time :

Type error: Type 'TouchList' must have a '[Symbol.iterator]()' method that returns an iterator.

@heymath heymath self-assigned this Apr 1, 2025
@heymath heymath requested a review from a team as a code owner April 1, 2025 21:55
@heymath
Copy link
Member Author

heymath commented Apr 2, 2025

@vouill Est-ce qu'on considère ça comme suffisamment impactant pour être une nouvelle version majeure au fait ?
ça considère que toutes les apps ont un niveau de compatibilité pour les navigateurs avec Symbol.Iterator / ES2015 (ES6)
Mais je pense que c'est déjà ce qu'on fait aujourd'hui de manière non explicite, non ?

@vouill
Copy link
Contributor

vouill commented Apr 3, 2025

@heymath

Mais je pense que c'est déjà ce qu'on fait aujourd'hui de manière non explicite, non ?

Oui je pense pareil, donc pas besoin de version majeure imo

https://caniuse.com/es6

97% should be good

@heymath heymath force-pushed the add-tsconfig-compiler-option-lib-dom-iterable branch from 190c55e to c24ea03 Compare September 5, 2025 08:50
@heymath heymath merged commit 8ae84a1 into main Sep 5, 2025
3 checks passed
@heymath heymath deleted the add-tsconfig-compiler-option-lib-dom-iterable branch September 5, 2025 08:54
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