same error log twice when async is true

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

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
3/5
Tempo stimato
1-2 giorni
Idoneità per principianti
45/100
Tipo di issue
Bug
Chiarezza
Abbastanza chiara
Stato di attività
Ferma
Stack tecnologico
typescript
Ambito
tooling

Direzione di ricerca

Start at the pluginTypeCheck integration and its handling of tsCheckerOptions.async, then reproduce the issue with the provided configuration and the invalid const a: number = '' assignment. Repeatedly save the same file and compare the logger output; done means each save reports the type error only once.

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

Descrizione

复现步骤:

import { pluginTypeCheck } from '@rsbuild/plugin-type-check';
import { defineConfig } from '@rslib/core';

export default defineConfig({
    lib: [
        {
            format: 'esm',
            bundle: false,
            shims: {
                esm: {
                    require: true,
                    __filename: true,
                    __dirname: true,
                },
            },
            autoExtension: false,
            output: {
                target: 'node',
                distPath: {
                    root: './dist/esm',
                },
                filename: {
                    js: '[name].mjs',
                },
            },
        },
        {
            format: 'cjs',
            bundle: false,
            autoExtension: false,
            output: {
                target: 'node',
                distPath: {
                    root: './dist/cjs',
                },
                filename: {
                    js: '[name].cjs',
                },
            },
        },
    ],
    plugins: [
        // https://github.com/rspack-contrib/rsbuild-plugin-type-check
        pluginTypeCheck({
            enable: true,
            tsCheckerOptions: {
                async: true,
                formatter: { type: 'codeframe', pathType: 'absolute' },
                typescript: {
                    typescriptPath: require.resolve('typescript'),
                },
                logger: {
                    log(message) {
                        console.log(message);
                    },
                    error(message: string) {
                        console.log(message);
                    },
                },
            },
        }),
    ],
});
const a: number = '';

注意观察时间,当连续保存同一个文件的时候,一次保存将有概率导致两次输出

Image
Lingua principale
TypeScript
Stelle
13
Fork
6
Merge medio
5h 59m
PR unite (30g)
1

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 rstackjs/rsbuild-plugin-type-check

Tutte le issue di rstackjs/rsbuild-plugin-type-check

Issue simili

Altre issue su TypeScript

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.