Fix/ts type imports - #4081
Merged
Merged
Conversation
Contributor
PR CI 汇总状态:全部通过
由 pull_request test workflow 自动生成 |
luoluoTH
force-pushed
the
fix/ts-type-imports
branch
5 times, most recently
from
August 5, 2026 03:35
7cb4fa2 to
c9657ab
Compare
luoluoTH
force-pushed
the
fix/ts-type-imports
branch
5 times, most recently
from
August 5, 2026 06:14
983c621 to
ff6345e
Compare
feat:render和link渲染端增加ts导入校验 fix:修改或修复ts perf:switch增加块级作用域 fix:修复Use 'const' instead fix:Buffer和Uint8Array ts报错问题 fix:修复link渲染端得ts报错 fix:修复autoprefixer警告(end->flex-end)类似得警告 fix:关闭no-unused-vars fix:修复ci检测后的报错 perf::引入依赖 fix:关闭v7中新增的规则
luoluoTH
force-pushed
the
fix/ts-type-imports
branch
from
August 7, 2026 09:52
17e644a to
2aa5784
Compare
youngster-yj
approved these changes
Aug 10, 2026
song-xiao-lin
approved these changes
Aug 10, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
概述
本 PR 基于 master 分支,修复了渲染端的 TypeScript 类型导入校验问题及相关 TS 报错,确保项目在
verbatimModuleSyntax: true配置下通过 tsc 和 ESLint 检查。改动内容
1. TS 类型导入修复 (
import type).eslintrc.cjs),启用@typescript-eslint/consistent-type-imports规则TS1484错误:将纯类型导入改为import type { X }或内联import { type X }global.d.ts中的import()type annotations(ESLint 禁止此语法),改为import type * as Namespace+declare global2.
.d.ts类型声明文件导入修复.d.ts文件的导入统一使用import type { X }(整体),避免 Vite 在verbatimModuleSyntax下尝试解析声明文件路径导致Failed to resolve import错误import { type X, type Y } from '...Type'改为import type { X, Y } from '...Type'3. TS 类型错误修复
Buffer与Uint8Array类型不兼容:new Buffer(x)→Buffer.from(x),: Buffer类型标注 →: Uint8ArrayStringToUint8Array:Buffer.from(str) as unknown as Uint8Array零拷贝转型YakitAutoCompleteref 类型不兼容(影响 10+ 文件)MainOperatorContent中YakitRoute与string类型不兼容YakitSelectoptions 可能为 undefinedimport alias在verbatimModuleSyntax下的TS1288错误4. ESLint 规则修复
no-case-declarations:为 switch case 块中的let/const声明添加{}块级作用域(134 处)prefer-const:将从未重新赋值的let改为const(719 处)5. CSS autoprefixer 警告修复
text-align: start→text-align: leftalign-items: start→align-items: flex-startjustify-content: end→justify-content: flex-end6. 其他
YakitSelectType.d.ts中误加的import { type } from 'os'AuditCode.tsx中setQuery不支持回调形式的问题YakitAuditHoleTable.tsx中 pagination 缺少onChange和属性重复指定验证
npx tsc --noEmit:主渲染端和 link 渲染端均 0 错误npx eslint src/ --ext .ts,.tsx:0 errornpx vite build(link 渲染端):构建成功影响范围
app/renderer/src/main)app/renderer/engine-link-startup)第一种合并方式