feat(portal-shell): v2.0 P0 shadcn standardization + security + streaming + error handling
- shadcn/ui 标准化:废弃纸感令牌,统一 bg-background/text-foreground 等 - Tailwind v4 + @theme inline,移除 tailwind.config.js - React 19 use() + Suspense 流式渲染,首屏骨架秒出 - 三级错误边界:Route → Section → Widget 层层兜底 - 错误上报:useErrorReport → sendBeacon → /api/log mock 端点 - 三层安全边界:L1 角色门禁 / L2 权限点门禁 / L3 数据范围 - 权限位图 base36 压缩:67 权限点 → ~14 字符,JWT 体积减少 ≥ 99% - notify 统一 Toast 封装,禁止业务直接 import sonner - PluginBoundary 替代 PluginLoader(错误边界 + Suspense + Skeleton 三件套) 验证:typecheck 0 错误 / lint 0 错误 / build 6 路由生成成功
This commit is contained in:
@@ -4,16 +4,10 @@
|
||||
* 与 eslint.config.js 中的 design-tokens 规则等价,保留以对齐 teacher-portal 习惯。
|
||||
* 关联:project_rules §3.10
|
||||
*/
|
||||
let tsParser;
|
||||
try {
|
||||
// eslint-disable-next-line @typescript-eslint/no-require-imports
|
||||
tsParser = require("@typescript-eslint/parser");
|
||||
} catch {
|
||||
tsParser = undefined;
|
||||
}
|
||||
import tsParser from "@typescript-eslint/parser";
|
||||
|
||||
/** @type {import('eslint').Linter.Config[]} */
|
||||
module.exports = [
|
||||
export default [
|
||||
{
|
||||
files: ["**/*.{ts,tsx,js,jsx}"],
|
||||
languageOptions: {
|
||||
@@ -28,12 +22,12 @@ module.exports = [
|
||||
"no-restricted-syntax": [
|
||||
"error",
|
||||
{
|
||||
selector: 'Literal[value=/^#[0-9a-fA-F]{3,8}$/]',
|
||||
selector: "Literal[value=/^#[0-9a-fA-F]{3,8}$/]",
|
||||
message:
|
||||
"禁止硬编码颜色 #hex,使用 var(--*) 或 Tailwind bg-* 类(project_rules §3.10)",
|
||||
},
|
||||
{
|
||||
selector: 'Literal[value=/^(Inter|Fraunces|JetBrains Mono)$/]',
|
||||
selector: "Literal[value=/^(Inter|Fraunces|JetBrains Mono)$/]",
|
||||
message:
|
||||
"禁止硬编码字体名字面量,使用 var(--font-family-sans/serif/mono)(project_rules §3.10)",
|
||||
},
|
||||
|
||||
Reference in New Issue
Block a user