Skip to content

ServerKit is a lightweight, modern server control panel for managing web applications, databases, and services on your VPS or dedicated server. Built with Python/Flask backend and React frontend.

fix(frontend): Phase 5 §8.5 — narrow the legacy-.card lint rule to stop false positives

Juan Denisa4135de92d13
diff --git a/frontend/eslint.config.js b/frontend/eslint.config.js
index 3a30377c..d5358509 100644
--- a/frontend/eslint.config.js
+++ b/frontend/eslint.config.js
@@ -45,7 +45,11 @@ export default [
message: 'Use the shared Button component (or IconButton for icon-only actions).',
},
{
- selector: 'JSXOpeningElement[name.name="div"] > JSXAttribute[name.name="className"] > Literal[value=/\\bcard\\b/]',
+ // Match the legacy card family (.card, .card-header, .card-body, …) as a
+ // LEADING class token — not unrelated compounds like `settings-card`,
+ // `sk-spec-card`, or `wp-site-card-skeleton`, which the old `\bcard\b`
+ // pattern flagged as false positives.
+ selector: 'JSXOpeningElement[name.name="div"] > JSXAttribute[name.name="className"] > Literal[value=/(^|\\s)card(\\s|$|-)/]',
message: 'Use the shared Card component instead of the legacy .card class.',
},
],