fix: tsconfig include default value and warning msg #1902
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
🤔 这个变动的性质是?/ What is the nature of this change?
🔗 相关 Issue / Related Issue
无
💡 需求背景和解决方案 / Background or solution
之前 tsconfig.json
include
配置项的脚手架默认值和框架警告提示都包含.dumi/**/*
,示例:如果用户照做的话,会导致 dumi 的临时文件目录
.dumi/tmp
也被包含进去,在项目执行 tsc 时将会包含不必要的检查,甚至可能抛出不该用户关心的类型错误。所以该 PR 做了 3 处改动:
.dumi/**/*
.dumi/**/*
(用户已修复过)会自动帮用户去除,并根据需要把.dumi
下的其他文件加进去,尽可能让已经处理过的用户或通过新脚手架创建的用户不感知这个二次修复.dumi/**/*
(用户还没修复过),但同时又使用到.dumi
文件夹下的 TypeScript 约定式文件(比如.dumi/app.tsx
、.dumi/theme/**/*
)做针对性警告提示,建议用户将它们添加到 tsconfig.json include 中额外说明:为什么需要额外将
.dumi
下的 TypeScript 文件添加到include
中?因为include
的默认值是**/*
,不包含.
开头的隐藏文件,如果不添加的话会导致相关文件丢失 TypeScript 类型提示📝 更新日志 / Changelog