-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy patheslint.config.mjs
More file actions
52 lines (50 loc) · 1.58 KB
/
Copy patheslint.config.mjs
File metadata and controls
52 lines (50 loc) · 1.58 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
import { defineConfig, globalIgnores } from "eslint/config";
import nextVitals from "eslint-config-next/core-web-vitals";
import nextTs from "eslint-config-next/typescript";
const eslintConfig = defineConfig([
...nextVitals,
...nextTs,
// Override default ignores of eslint-config-next.
globalIgnores([
// Default ignores of eslint-config-next:
".next/**",
"out/**",
"build/**",
"test-results/**",
"next-env.d.ts",
]),
// UI 一致性护栏:品牌色单一源 + 禁止引入第三套 UI 库。
// 令牌唯一源见 styles/theme.css;TS 侧常量见 lib/theme/brand.ts。
{
files: ["**/*.{ts,tsx}"],
ignores: ["lib/theme/brand.ts"],
rules: {
"no-restricted-syntax": [
"error",
{
selector: "Literal[value=/#0e9fe4/i]",
message:
"品牌主色请从 @/lib/theme/brand 导入 BRAND,勿硬编码 #0e9fe4(令牌单一源见 styles/theme.css)。",
},
{
selector: "TemplateElement[value.raw=/#0e9fe4/i]",
message:
"品牌主色请从 @/lib/theme/brand 导入 BRAND,勿硬编码 #0e9fe4(令牌单一源见 styles/theme.css)。",
},
],
"no-restricted-imports": [
"error",
{
patterns: [
{
group: ["@mui/*", "@emotion/*"],
message:
"本项目 UI 仅用 Tailwind 直写(前台,预设见 lib/theme.ts)与 Ant Design(后台),勿引入 MUI/emotion。",
},
],
},
],
},
},
]);
export default eslintConfig;