same error log twice when async is true

オープン
#33 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
3/5
見積もり時間
1〜2日
初心者へのやさしさ
45/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
typescript
領域
tooling

調査の方向性

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.

索引モデルが issue の本文から書いたものです。

説明

复现步骤:

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
主要言語
TypeScript
スター
13
フォーク
6
平均マージ
5時間 59分
マージ済み PR(30日)
1

環境構築

このプロジェクトには開発コンテナ、Dockerfile、コントリビューションガイドがありません。まず README を読み、一般的な手順ははじめてのコントリビューションガイドを参照してください。

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

rstackjs/rsbuild-plugin-type-check のほかの issue

rstackjs/rsbuild-plugin-type-check の issue をすべて見る

似ている issue

TypeScript の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。