问题:工具栏第一行的控件高度不一致(搜索框与标签按钮 34px,优先级分组与 到期统计按钮 30px,第二行按钮 26px),排在一起参差不齐。 根因:高度是靠 padding + line-height 撑出来的,而各组字号不同——搜索框和 标签按钮用 text-sm(行高 20px),优先级与统计按钮用 text-xs(行高 16px), 两者的 py 又都是 1.5 和 1,于是自然差出 4~8px。 修复:改为显式固定高度,不再受字号影响。 - 第一行(搜索框 / 优先级分组 / 标签 / 今日到期 / 逾期)统一 h-9(36px) - 优先级分组内的按钮改用 h-full 填满容器内区,不再靠 padding 撑 - 第二行(归档 / 显示归档 / 清空筛选)统一 h-8(32px), 与第一行形成明确的次级层级 顺手把 .screenshots/ 加入 ESLint 与 Prettier 忽略——那是截图脚本的产物目录。 验证:用 Playwright 实测各控件 boundingBox,第一行全部 36px;单元测试 480 个、 E2E 25 个通过。
45 lines
1.1 KiB
JavaScript
45 lines
1.1 KiB
JavaScript
import js from '@eslint/js'
|
|
import prettier from 'eslint-config-prettier/flat'
|
|
import pluginVue from 'eslint-plugin-vue'
|
|
import globals from 'globals'
|
|
import tseslint from 'typescript-eslint'
|
|
|
|
export default tseslint.config(
|
|
{ ignores: ['dist/**', 'node_modules/**', 'coverage/**', '.screenshots/**'] },
|
|
js.configs.recommended,
|
|
tseslint.configs.recommended,
|
|
pluginVue.configs['flat/recommended'],
|
|
{
|
|
files: ['**/*.vue'],
|
|
languageOptions: {
|
|
parserOptions: { parser: tseslint.parser },
|
|
},
|
|
},
|
|
{
|
|
languageOptions: {
|
|
globals: { ...globals.browser },
|
|
},
|
|
},
|
|
{
|
|
// 构建/截图等脚本运行在 Node 环境
|
|
files: ['scripts/**/*.{js,mjs,ts}'],
|
|
languageOptions: {
|
|
globals: { ...globals.node },
|
|
},
|
|
},
|
|
{
|
|
rules: {
|
|
// 允许用下划线前缀标记「有意不使用」的参数与变量
|
|
'@typescript-eslint/no-unused-vars': [
|
|
'error',
|
|
{
|
|
argsIgnorePattern: '^_',
|
|
varsIgnorePattern: '^_',
|
|
caughtErrorsIgnorePattern: '^_',
|
|
},
|
|
],
|
|
},
|
|
},
|
|
prettier,
|
|
)
|