@lark-apaas/fullstack-presets 1.0.6 → 1.0.8
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.
|
@@ -116,6 +116,20 @@ exports.default = {
|
|
|
116
116
|
selector: "JSXOpeningElement[name.name='a']:has(JSXAttribute[name.name='href'][value.value=/^(?!https?:|\\u002F\\u002F|mailto:|tel:|#).+/])",
|
|
117
117
|
message: "Please don't use relative paths in <a> tags. Use NavLink from 'react-router-dom' instead.",
|
|
118
118
|
},
|
|
119
|
+
// 禁止 variant 为 outline|link|ghost 的 Button 使用 text-white
|
|
120
|
+
{
|
|
121
|
+
selector: 'JSXElement[openingElement.name.name="Button"]' +
|
|
122
|
+
':has(JSXAttribute[name.name="variant"][value.value=/^(outline|link|ghost)$/])' +
|
|
123
|
+
':has(JSXAttribute[name.name="className"][value.value=/text-white/])',
|
|
124
|
+
message: 'Button with variant="outline|link|ghost" should not use "text-white" className. This causes visibility issues. Consider using proper semantic color tokens from `client/src/tailwind-theme.css`',
|
|
125
|
+
},
|
|
126
|
+
// 禁止在 Button 上组合 text-primary-foreground 与 bg-background 并用的情况
|
|
127
|
+
{
|
|
128
|
+
selector: 'JSXElement[openingElement.name.name="Button"]' +
|
|
129
|
+
':has(JSXAttribute[name.name="className"][value.value=/text-primary-foreground/])' +
|
|
130
|
+
':has(JSXAttribute[name.name="className"][value.value=/bg-background/])',
|
|
131
|
+
message: 'Button should not use "text-primary-foreground" and "bg-background" className. This causes visibility issues. Consider using proper semantic color tokens from `client/src/tailwind-theme.css`',
|
|
132
|
+
},
|
|
119
133
|
],
|
|
120
134
|
},
|
|
121
135
|
};
|