Repository navigation
chore: migrate to eslint flat config and prettier 3 - #939
Open
liweijie0812 wants to merge 30 commits into
Open
liweijie0812 wants to merge 30 commits into
liweijie0812 wants to merge 30 commits into
Conversation
- 用 eslint.config.mjs 合并根/site/site-components/theme-generator/auto-release 的 ESLint 配置 - 升级 eslint 10 / prettier 3 / typescript-eslint,移除子包独立 lint 脚本 - 保留错误 cause,清理失效 disable 注释,修复 template-shadow 与属性顺序 - 对 CLI 脚本与受信任 v-html 内容按路径关闭对应规则
- stylelint 15 -> 17,stylelint-config-standard 34 -> 40,stylelint-config-standard-less 2 -> 4 - 移除 v17 已删除的 number-leading-zero 规则(同时消除与 prettier 的前导 0 冲突) - stylelint --fix 清理既有 less 格式问题
commit: |
TDesign Component Site Preview CI Open |
- .less 增加 prettier --write,与其它文件类型流程对齐 - eslint 使用 eslint-config-prettier 关闭冲突规则,移除 eslint-plugin-prettier
- 关闭 no-descending-specificity(Less 嵌套展开后顺序难保证,避免样式回归) - word-break: break-word 改为 overflow-wrap - 字体族补齐通用族 fallback(sans-serif/monospace) - 移除被 margin 简写覆盖的 margin-right - 删除无引用的空文件 layout.less - 统一 less 字体族声明格式
- 拆分 lint 为 lint:css/lint:js/lint:eslint/typecheck 及对应 :fix 链 - 新增 typecheck 脚本,修复 site target/lib 为 ES2022 - 支持 .vue 的 stylelint 解析(postcss-html),新增 .stylelintignore 排除构建产物 - 关闭与 TDesign 设计规范冲突的 stylelint 规则,修复存量格式问题 - 更新 lint-staged 支持 .vue/.css 的 stylelint
- TDesign- 前缀类名统一改为 td-(site-components 及站点消费方) - tdesign-toc_* 下划线类名改为 td-toc-* 并同步 tdoc 插件配置 - __light__/__dark__ 主题工具类改为 td-light/td-dark - 驼峰类名 topTxt/bottomTxt 改为 top-txt/bottom-txt - 内置主题 token 关闭 selector-class-pattern 规则 stylelint selector-class-pattern 告警清零
重构时把按钮选择器统一为 class(.td-doc-changelog__entry),但模板仍用 id, 导致 shadowRoot 查询失败、回退到游离节点,滚动吸顶显隐失效。统一为 class。
- 删除 config/spline.ts 及其全部引用 - 清理 td-doc-header 中的 spline/iframe/缩略图逻辑与样式 - 移除 tdoc 插件、design 页面、站点配置中的 spline 字段 - 同步清理类型定义、测试 mock 与 demo
- 修正 Less 文件中 rgb 颜色函数错误用法 - 涉及 site-components 与 site 多个组件的样式
This reverts commit e674818.
tdoc 插件(vite-plugin-tdoc)的目录类名由插件配置生成且为固定格式, 不应改为 BEM。还原 docs.less、td-doc-content 及各 doc 页面中的类名, 并在 stylelint selector-class-pattern 中豁免 tdesign-toc_* 前缀。
将 971ff07(td- 前缀统一改名)的全部改动还原: - TDesign- 前缀类名还原(site-components 及站点消费方) - __light__/__dark__、topTxt/bottomTxt 还原 - 内置主题 override 的 selector-class-pattern 还原 保留后续 commit 的有效修改:rgba() 替换、tdesign-toc_* 目录类名、 spline 功能、changelog 入口 id→class 修复、theme-tabs 渲染修复。 类名统一改 td- 的改动后续另起 PR 处理。
- 新增 eqeqeq(smart)/no-var/prefer-const 及 vue/no-unused-refs、vue/no-useless-template-attributes - 修复 8 处松散比较,保留 == null 惯用写法 - 移除 .vue 块中冗余的 browser globals
- 启用 typescript-eslint stylistic 配置 - 按目录拆分浏览器/Node globals - 补全 CommonJS 配置文件的匹配范围 - 移除冗余的 d.ts 覆盖段,启用 reportUnusedDisableDirectives - 允许有意的空箭头函数/方法实现
- td-doc-search: 移除重复的 overflow-wrap 声明,避免 break-word 覆盖 anywhere 削弱断词 - td-doc-changelog: 补回 -webkit-mask / -webkit-animation,与保留厂商前缀的配置一致 - fonts.less: 补 ::-moz-range-track,与非前缀 appearance 的方向保持一致 - .stylelintrc.js: 修正 no-descending-specificity 的注释说明,与实际规则语义对齐 - package.json: lint 改用 run-s lint:parallel typecheck,不再依赖 shell && 串联退出码
升级 lint 链路依赖到最新版本: - @commitlint/cli / config-conventional: 8.2.0 -> 21.2.4 - husky: 8.0.3 -> 9.1.7 - lint-staged: 16.4.0 -> 17.6.0 - rimraf: 3.0.2 -> 6.1.3(含 site) - cz-conventional-changelog: 3.0.2 -> 3.3.0(含 site) - eslint: 10.12.0 -> 10.13.0 - prettier: 3.9.9 -> 3.9.10 - typescript-eslint: 8.71.1 -> 8.72.0 - vue-eslint-parser: 10.3.0 -> 10.4.1 配套调整: - husky 9:移除 hook 中对 husky.sh 的引导,prepare 脚本改为 husky - 移除 site 中与根目录重复的 commitlint 配置(site/commitlint.config.js)及对应依赖 - 移除 site 中冗余的 cz-conventional-changelog 及 commitizen 配置 - eslint.config.mjs 同步移除已删除文件的引用
husky hook 由 sh(dash) 执行,原脚本使用了 bash 专有的 [[ =~ ]],导致 "[[: not found" 报错并恒走 else 分支,@tencent.com 邮箱实际上从未被拦截。 改为 POSIX case 匹配,保持原有拦截语义,同时: - 补回 shebang,符合 husky 9 对 hook 脚本的 POSIX 兼容要求 - lint-staged 失败时以原退出码中断,避免误打印校验通过
…flat-config # Conflicts: # docs/introduce.md # pnpm-lock.yaml
…flat-config # Conflicts: # packages/site-components/config/header.ts # packages/site-components/src/components/td-doc-footer/style.less # packages/site-components/src/components/td-logo/index.ts # packages/site-components/src/components/td-logo/portal.less # packages/site-components/src/styles/dark.less # packages/site-components/src/styles/reset.less # packages/site-components/src/styles/vars.less # site/src/pages/about/release.vue # site/src/pages/home/index.vue # site/src/style/color.less # site/src/style/fonts.less # site/src/style/home.less # site/src/style/motion.less
This branch has not been deployed
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 的性质是?
🔗 相关 Issue
💡 需求背景和解决方案
📝 更新日志
fix(组件名称): 处理问题或特性描述 ...
本条 PR 不需要纳入 Changelog
☑️ 请求合并前的自查清单