Files
Edu/apps/portal-shell/.eslintrc.tokens.js
SpecialX a28a6bd6ea feat(portal-shell): clean widget design tokens and fix lint:tokens (P1-6)
516 mechanical replacements across 25 widget files:
- spacing xs/sm/md/lg/xl to numeric 1/2/3/4/6
- text-heading-3 to text-lg font-semibold
- bg-danger to bg-destructive
- border border dedup

Fix .eslintrc.tokens.js to use typescript-eslint parser (was importing
uninstalled @typescript-eslint/parser). lint:tokens now passes.
2026-07-22 15:07:38 +08:00

45 lines
1.3 KiB
JavaScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
/**
* ESLint Design Tokens 配置独立运行eslint -c .eslintrc.tokens.js src
*
* 与 eslint.config.js 中的 design-tokens 规则等价,保留以对齐 teacher-portal 习惯。
* 使用 typescript-eslint 包的 parser与 eslint.config.js 一致)。
* 关联project_rules §3.10
*/
import tseslint from "typescript-eslint";
/** @type {import('eslint').Linter.Config[]} */
export default tseslint.config(
{
files: ["**/*.{ts,tsx,js,jsx}"],
languageOptions: {
parser: tseslint.parser,
ecmaVersion: 2024,
sourceType: "module",
parserOptions: {
ecmaFeatures: { jsx: true },
},
},
rules: {
"no-restricted-syntax": [
"error",
{
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)$/]",
message:
"禁止硬编码字体名字面量,使用 var(--font-family-sans/serif/mono)project_rules §3.10",
},
],
},
},
{
files: ["**/primitive.css", "**/manifest.ts"],
rules: {
"no-restricted-syntax": "off",
},
},
);