Skip to content

same error log twice when async is true #33

@lake2

Description

@lake2

复现步骤:

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions