Vitest: report extended diagnostics (NG81xx) as warnings, whatever their configured category

Aperta
#31 0 commenti 0 reazioni 0 assegnatari Vedi su GitHub

I maintainer di solito rispondono entro 1 giorno

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
48/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Attiva
Stack tecnologico
angular, typescript, vite

Direzione di ricerca

Start in ngp/preprocessor/src/processor.js and trace how extended diagnostics get their category during Vitest runs. Read the related JIT compatibility work in #27 to understand the intended test mode or shared option. Done means NG81xx diagnostics are warnings, or their category is configurable in test mode, without relying on process.env.VITEST.

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

Descrizione

feature

Part of #27.

Problem

Projects set extendedDiagnostics.defaultCategory: 'error' for their builds. Under ngp that makes, for example, an unused standalone import (NG8113) fail the whole spec file. JIT never ran extended diagnostics on specs, and the build and lint still report them.

Proposed change

Under Vitest, report NG81xx as warnings (ngp/preprocessor/src/processor.js). An option for their category in test mode would work as well.

Our patch gates this on process.env.VITEST, which is the wrong switch for a library. In ngp it belongs in its test mode, or behind one option shared by the JIT-compatibility changes in #27 (for example test: { jitCompat: true }).

Setup: ngp 0.3.0, @angular/compiler/compiler-cli 22.3.0-next.4, Vite 8, Vitest 5.1.0 (pool: 'forks'), a Nx monorepo with 1,035 Angular projects, one Vitest config each, specs written for TestBed under JIT (Analog).

Lingua principale
TypeScript
Stelle
7
Fork
0
Merge medio
12h 24m
PR unite (30g)
13

Preparare l'ambiente

Questo progetto non fornisce container di sviluppo, Dockerfile né guida per i contributori, quindi l'ambiente è a tuo carico: parti dal suo README e consulta la nostra guida al primo contributo per i passaggi generali.

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.

Altre issue di push-based/vite-plugin-ngp

Tutte le issue di push-based/vite-plugin-ngp

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.