@lark-apaas/fullstack-presets 1.1.5-beta.4 → 1.1.5-beta.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -44,6 +44,15 @@ exports.looseRestrictSyntaxRules = [
|
|
|
44
44
|
selector: "VariableDeclarator[id.name='RoutesComponent'] > ArrowFunctionExpression > JSXElement:not([openingElement.name.name='Routes'])",
|
|
45
45
|
message: 'RoutesComponent must return <Routes> directly without any wrapper. Do not add <div>, <BrowserRouter> or other wrappers. You can only modify routes inside <Routes> (add/edit/remove <Route> elements).',
|
|
46
46
|
},
|
|
47
|
+
// 禁止在 Tailwind 任意值语法中使用包含空格的 hsl/rgb 值
|
|
48
|
+
{
|
|
49
|
+
selector: 'JSXAttribute[name.name="className"][value.value=/\\[hsl\\([^\\]]*\\s[^\\]]*\\)/]',
|
|
50
|
+
message: 'Tailwind 4 arbitrary values cannot contain spaces. Replace spaces with underscores in hsl() values. Example: from-[hsl(215_60%_18%)] instead of from-[hsl(215 60% 18%)]',
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
selector: 'JSXAttribute[name.name="className"][value.value=/\\[rgb\\([^\\]]*\\s[^\\]]*\\)/]',
|
|
54
|
+
message: 'Tailwind 4 arbitrary values cannot contain spaces. Replace spaces with underscores in rgb() values. Example: bg-[rgb(255_255_255)] instead of bg-[rgb(255 255 255)]',
|
|
55
|
+
},
|
|
47
56
|
];
|
|
48
57
|
// 严格语法规则:仅正常模式启用,loose 模式下不启用
|
|
49
58
|
const strictSyntaxRules = [
|
|
@@ -95,7 +104,7 @@ const strictSyntaxRules = [
|
|
|
95
104
|
},
|
|
96
105
|
];
|
|
97
106
|
const looseSpecificPlugins = {
|
|
98
|
-
'@lark-apaas': { rules: custom_eslint_rules_1.customRules }
|
|
107
|
+
'@lark-apaas': { rules: custom_eslint_rules_1.customRules },
|
|
99
108
|
};
|
|
100
109
|
// 宽松模式下覆盖的规则(关闭非关键规则)
|
|
101
110
|
const looseOverrideRules = isLooseMode
|
|
@@ -192,7 +201,11 @@ const appTsxConfig = isLooseMode
|
|
|
192
201
|
name: '@lark-apaas/client-recommend/app-tsx',
|
|
193
202
|
files: ['client/src/app.tsx'],
|
|
194
203
|
rules: {
|
|
195
|
-
'no-restricted-syntax': [
|
|
204
|
+
'no-restricted-syntax': [
|
|
205
|
+
'error',
|
|
206
|
+
...baseSyntaxRules,
|
|
207
|
+
...exports.looseRestrictSyntaxRules,
|
|
208
|
+
],
|
|
196
209
|
},
|
|
197
210
|
}
|
|
198
211
|
: null;
|