rstackjs / rstackjs/rsbuild-plugin-type-check
same error log twice when async is true
Open
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 13
- Forks
- 6
- Avg merge
- 3h 32m
- Merged PRs (30d)
- 6
Description
复现步骤:
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 = '';
注意观察时间,当连续保存同一个文件的时候,一次保存将有概率导致两次输出
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
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.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- tooling
- Issue type
- Bug
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 45/100