microsoft / microsoft/TypeScript

FR: Add TS config option to disable "<some regex feature> is only available when targeting 'es2018' or later.".

Aperta
#59,066 5 commenti 0 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

In Discussion Suggestion
Lingua principale
Go
Stelle
111k
Fork
14.4k
Merge medio
1g 19h
PR unite (30g)
117

Descrizione

Acknowledgement
  • I acknowledge that issues using this template may be closed without further explanation at the maintainer's discretion.
Comment

Search terms for existing issues

"regex", "regular expressions"

Problem

The Google TS build infrastructure runs the TypeScript compiler with a centrally defined target language = "ES2016" for edit-refresh & testing. For production, users can still target newer language versions, but for various reasons our edit-refresh setup is stuck on this older language version.

This means that with TS 5.5 we start seeing build errors like "This regular expression flag is only available when targeting 'es2018' or later.".

Our current workaround will be either using the RegExp constructor or adding a patch to our compiler fork.

Proposal

Add a TS config option to toggle whether these sorts of errors are emitted at all.

Use cases

I realize that Google infra's situation is unusual, so this might not be a generally useful proposal & understand if you don't support this.

However, some possibilities I could imagine for someone setting an older target language than necessary for the browsers they support might be:

Guida per i contributori

Apri la guida per i contributori

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Direzione di ricerca

Inizia esaminando come TypeScript emette le diagnosi delle espressioni regolari dipendenti da target e come vengono definite e testate le opzioni del compilatore. Il lavoro è completato quando un’opzione di configurazione TS può sopprimere queste diagnosi senza modificare target o il comportamento della transpilazione; l’issue non indica file o test specifici.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Valutazione

Stack tecnologico
typescript
Ambito
compilers
Tipo di issue
Funzionalità
Difficoltà
5/5
Tempo stimato
Più di una settimana
Stato di attività
Ferma
Chiarezza
Abbastanza chiara
Idoneità per principianti
30/100

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.