CLDXiang / today-frontend

https://fdxk.info
GNU General Public License v3.0
8 stars 4 forks source link

ESLint max-len 忽略 class= 和 d= #147

Closed CLDXiang closed 3 years ago

CLDXiang commented 3 years ago

✨ 工作描述

由于 TailwindCSS 类名和 SVG path d attribute 的字符串难免较长,很容易超出 ESLint max-len 的限制,故使用 max-lenignorePattern 配置忽略这两种情况的 ESLint 检查

添加的正则 pattern 为:^\\s*(class|d)="[^"]+",即忽略 <若干空白符>class="<非 " 字符>"<若干空白符>d="<非 " 字符>" 的行

顺便将此前用数组方式打散的类名改回了 plain class 的写法

🍀 给 Reviewer 的辅助信息

🛠️ 对项目配置的改动

✅ 检查清单

vercel[bot] commented 3 years ago

This pull request is being automatically deployed with Vercel (learn more).
To see the status of your deployment, click below or on the icon next to each commit.

🔍 Inspect: https://vercel.com/cldxiang/today-frontend/3kw93BoguMcjdd4r9xzbvkKW5cfy
✅ Preview: https://today-frontend-git-build-eslint-max-len-cldxiang.vercel.app