@empline/preflight 1.0.20
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.
- package/README.md +540 -0
- package/dist/bin/approve.d.ts +24 -0
- package/dist/bin/approve.d.ts.map +1 -0
- package/dist/bin/approve.js +249 -0
- package/dist/bin/approve.js.map +1 -0
- package/dist/bin/audit.d.ts +64 -0
- package/dist/bin/audit.d.ts.map +1 -0
- package/dist/bin/audit.js +464 -0
- package/dist/bin/audit.js.map +1 -0
- package/dist/bin/install-hooks.d.ts +20 -0
- package/dist/bin/install-hooks.d.ts.map +1 -0
- package/dist/bin/install-hooks.js +204 -0
- package/dist/bin/install-hooks.js.map +1 -0
- package/dist/bin/preflight.d.ts +21 -0
- package/dist/bin/preflight.d.ts.map +1 -0
- package/dist/bin/preflight.js +218 -0
- package/dist/bin/preflight.js.map +1 -0
- package/dist/bin/preinstall.d.ts +15 -0
- package/dist/bin/preinstall.d.ts.map +1 -0
- package/dist/bin/preinstall.js +229 -0
- package/dist/bin/preinstall.js.map +1 -0
- package/dist/bin/review-drift.d.ts +17 -0
- package/dist/bin/review-drift.d.ts.map +1 -0
- package/dist/bin/review-drift.js +292 -0
- package/dist/bin/review-drift.js.map +1 -0
- package/dist/bin/review.d.ts +22 -0
- package/dist/bin/review.d.ts.map +1 -0
- package/dist/bin/review.js +179 -0
- package/dist/bin/review.js.map +1 -0
- package/dist/bin/submit-drift.d.ts +36 -0
- package/dist/bin/submit-drift.d.ts.map +1 -0
- package/dist/bin/submit-drift.js +534 -0
- package/dist/bin/submit-drift.js.map +1 -0
- package/dist/bin/submit.d.ts +23 -0
- package/dist/bin/submit.d.ts.map +1 -0
- package/dist/bin/submit.js +263 -0
- package/dist/bin/submit.js.map +1 -0
- package/dist/bin/watch.d.ts +27 -0
- package/dist/bin/watch.d.ts.map +1 -0
- package/dist/bin/watch.js +327 -0
- package/dist/bin/watch.js.map +1 -0
- package/dist/checks/ai/card-size-detection-validation.d.ts +22 -0
- package/dist/checks/ai/card-size-detection-validation.d.ts.map +1 -0
- package/dist/checks/ai/card-size-detection-validation.js +452 -0
- package/dist/checks/ai/card-size-detection-validation.js.map +1 -0
- package/dist/checks/ai/code-quality-ai.d.ts +17 -0
- package/dist/checks/ai/code-quality-ai.d.ts.map +1 -0
- package/dist/checks/ai/code-quality-ai.js +399 -0
- package/dist/checks/ai/code-quality-ai.js.map +1 -0
- package/dist/checks/ai/recognition-pipeline-validation.d.ts +27 -0
- package/dist/checks/ai/recognition-pipeline-validation.d.ts.map +1 -0
- package/dist/checks/ai/recognition-pipeline-validation.js +808 -0
- package/dist/checks/ai/recognition-pipeline-validation.js.map +1 -0
- package/dist/checks/ai/series-subset-hierarchy.d.ts +21 -0
- package/dist/checks/ai/series-subset-hierarchy.d.ts.map +1 -0
- package/dist/checks/ai/series-subset-hierarchy.js +373 -0
- package/dist/checks/ai/series-subset-hierarchy.js.map +1 -0
- package/dist/checks/api/api-completeness-check.d.ts +26 -0
- package/dist/checks/api/api-completeness-check.d.ts.map +1 -0
- package/dist/checks/api/api-completeness-check.js +311 -0
- package/dist/checks/api/api-completeness-check.js.map +1 -0
- package/dist/checks/api/api-contract-validation.d.ts +24 -0
- package/dist/checks/api/api-contract-validation.d.ts.map +1 -0
- package/dist/checks/api/api-contract-validation.js +219 -0
- package/dist/checks/api/api-contract-validation.js.map +1 -0
- package/dist/checks/api/pagination-validation.d.ts +21 -0
- package/dist/checks/api/pagination-validation.d.ts.map +1 -0
- package/dist/checks/api/pagination-validation.js +270 -0
- package/dist/checks/api/pagination-validation.js.map +1 -0
- package/dist/checks/api/response-consistency.d.ts +21 -0
- package/dist/checks/api/response-consistency.d.ts.map +1 -0
- package/dist/checks/api/response-consistency.js +238 -0
- package/dist/checks/api/response-consistency.js.map +1 -0
- package/dist/checks/api/response-schema-validation.d.ts +25 -0
- package/dist/checks/api/response-schema-validation.d.ts.map +1 -0
- package/dist/checks/api/response-schema-validation.js +288 -0
- package/dist/checks/api/response-schema-validation.js.map +1 -0
- package/dist/checks/api/response-time-budget.d.ts +17 -0
- package/dist/checks/api/response-time-budget.d.ts.map +1 -0
- package/dist/checks/api/response-time-budget.js +294 -0
- package/dist/checks/api/response-time-budget.js.map +1 -0
- package/dist/checks/api/variant-switching-integrity.d.ts +22 -0
- package/dist/checks/api/variant-switching-integrity.d.ts.map +1 -0
- package/dist/checks/api/variant-switching-integrity.js +306 -0
- package/dist/checks/api/variant-switching-integrity.js.map +1 -0
- package/dist/checks/architecture/admin-page-consistency.d.ts +27 -0
- package/dist/checks/architecture/admin-page-consistency.d.ts.map +1 -0
- package/dist/checks/architecture/admin-page-consistency.js +294 -0
- package/dist/checks/architecture/admin-page-consistency.js.map +1 -0
- package/dist/checks/architecture/backend-ui-coverage.d.ts +25 -0
- package/dist/checks/architecture/backend-ui-coverage.d.ts.map +1 -0
- package/dist/checks/architecture/backend-ui-coverage.js +562 -0
- package/dist/checks/architecture/backend-ui-coverage.js.map +1 -0
- package/dist/checks/architecture/component-architecture.d.ts +26 -0
- package/dist/checks/architecture/component-architecture.d.ts.map +1 -0
- package/dist/checks/architecture/component-architecture.js +513 -0
- package/dist/checks/architecture/component-architecture.js.map +1 -0
- package/dist/checks/architecture/component-consolidation-opportunities.d.ts +28 -0
- package/dist/checks/architecture/component-consolidation-opportunities.d.ts.map +1 -0
- package/dist/checks/architecture/component-consolidation-opportunities.js +338 -0
- package/dist/checks/architecture/component-consolidation-opportunities.js.map +1 -0
- package/dist/checks/architecture/orphaned-pages-detection.d.ts +34 -0
- package/dist/checks/architecture/orphaned-pages-detection.d.ts.map +1 -0
- package/dist/checks/architecture/orphaned-pages-detection.js +464 -0
- package/dist/checks/architecture/orphaned-pages-detection.js.map +1 -0
- package/dist/checks/architecture/primitive-component-enforcement.d.ts +25 -0
- package/dist/checks/architecture/primitive-component-enforcement.d.ts.map +1 -0
- package/dist/checks/architecture/primitive-component-enforcement.js +305 -0
- package/dist/checks/architecture/primitive-component-enforcement.js.map +1 -0
- package/dist/checks/architecture/shared-component-enforcement.d.ts +34 -0
- package/dist/checks/architecture/shared-component-enforcement.d.ts.map +1 -0
- package/dist/checks/architecture/shared-component-enforcement.js +725 -0
- package/dist/checks/architecture/shared-component-enforcement.js.map +1 -0
- package/dist/checks/async-cleanup-validation.d.ts +20 -0
- package/dist/checks/async-cleanup-validation.d.ts.map +1 -0
- package/dist/checks/async-cleanup-validation.js +179 -0
- package/dist/checks/async-cleanup-validation.js.map +1 -0
- package/dist/checks/auth/auth-page-consistency.d.ts +25 -0
- package/dist/checks/auth/auth-page-consistency.d.ts.map +1 -0
- package/dist/checks/auth/auth-page-consistency.js +581 -0
- package/dist/checks/auth/auth-page-consistency.js.map +1 -0
- package/dist/checks/auth/authenticated-redirect.d.ts +55 -0
- package/dist/checks/auth/authenticated-redirect.d.ts.map +1 -0
- package/dist/checks/auth/authenticated-redirect.js +389 -0
- package/dist/checks/auth/authenticated-redirect.js.map +1 -0
- package/dist/checks/auth/role-validation.d.ts +31 -0
- package/dist/checks/auth/role-validation.d.ts.map +1 -0
- package/dist/checks/auth/role-validation.js +252 -0
- package/dist/checks/auth/role-validation.js.map +1 -0
- package/dist/checks/auth/session-integrity-validation.d.ts +58 -0
- package/dist/checks/auth/session-integrity-validation.d.ts.map +1 -0
- package/dist/checks/auth/session-integrity-validation.js +402 -0
- package/dist/checks/auth/session-integrity-validation.js.map +1 -0
- package/dist/checks/auth/session-security.d.ts +67 -0
- package/dist/checks/auth/session-security.d.ts.map +1 -0
- package/dist/checks/auth/session-security.js +399 -0
- package/dist/checks/auth/session-security.js.map +1 -0
- package/dist/checks/auth/session-update-safety.d.ts +96 -0
- package/dist/checks/auth/session-update-safety.d.ts.map +1 -0
- package/dist/checks/auth/session-update-safety.js +697 -0
- package/dist/checks/auth/session-update-safety.js.map +1 -0
- package/dist/checks/auth/store-access-delegation.d.ts +33 -0
- package/dist/checks/auth/store-access-delegation.d.ts.map +1 -0
- package/dist/checks/auth/store-access-delegation.js +344 -0
- package/dist/checks/auth/store-access-delegation.js.map +1 -0
- package/dist/checks/business/business-invariants.d.ts +20 -0
- package/dist/checks/business/business-invariants.d.ts.map +1 -0
- package/dist/checks/business/business-invariants.js +174 -0
- package/dist/checks/business/business-invariants.js.map +1 -0
- package/dist/checks/business/currency-precision.d.ts +21 -0
- package/dist/checks/business/currency-precision.d.ts.map +1 -0
- package/dist/checks/business/currency-precision.js +433 -0
- package/dist/checks/business/currency-precision.js.map +1 -0
- package/dist/checks/business/idempotency-key-validation.d.ts +27 -0
- package/dist/checks/business/idempotency-key-validation.d.ts.map +1 -0
- package/dist/checks/business/idempotency-key-validation.js +275 -0
- package/dist/checks/business/idempotency-key-validation.js.map +1 -0
- package/dist/checks/business/image-metadata-injection.d.ts +19 -0
- package/dist/checks/business/image-metadata-injection.d.ts.map +1 -0
- package/dist/checks/business/image-metadata-injection.js +367 -0
- package/dist/checks/business/image-metadata-injection.js.map +1 -0
- package/dist/checks/business/image-upload-optimization.d.ts +20 -0
- package/dist/checks/business/image-upload-optimization.d.ts.map +1 -0
- package/dist/checks/business/image-upload-optimization.js +271 -0
- package/dist/checks/business/image-upload-optimization.js.map +1 -0
- package/dist/checks/business/inventory-atomicity-validation.d.ts +19 -0
- package/dist/checks/business/inventory-atomicity-validation.d.ts.map +1 -0
- package/dist/checks/business/inventory-atomicity-validation.js +257 -0
- package/dist/checks/business/inventory-atomicity-validation.js.map +1 -0
- package/dist/checks/business/order-state-machine-validation.d.ts +19 -0
- package/dist/checks/business/order-state-machine-validation.d.ts.map +1 -0
- package/dist/checks/business/order-state-machine-validation.js +289 -0
- package/dist/checks/business/order-state-machine-validation.js.map +1 -0
- package/dist/checks/business/price-calculation-validation.d.ts +20 -0
- package/dist/checks/business/price-calculation-validation.d.ts.map +1 -0
- package/dist/checks/business/price-calculation-validation.js +247 -0
- package/dist/checks/business/price-calculation-validation.js.map +1 -0
- package/dist/checks/business/price-display-validation.d.ts +22 -0
- package/dist/checks/business/price-display-validation.d.ts.map +1 -0
- package/dist/checks/business/price-display-validation.js +152 -0
- package/dist/checks/business/price-display-validation.js.map +1 -0
- package/dist/checks/business/resilient-recognition-validation.d.ts +26 -0
- package/dist/checks/business/resilient-recognition-validation.d.ts.map +1 -0
- package/dist/checks/business/resilient-recognition-validation.js +230 -0
- package/dist/checks/business/resilient-recognition-validation.js.map +1 -0
- package/dist/checks/business/store-approval-listing-filter.d.ts +19 -0
- package/dist/checks/business/store-approval-listing-filter.d.ts.map +1 -0
- package/dist/checks/business/store-approval-listing-filter.js +176 -0
- package/dist/checks/business/store-approval-listing-filter.js.map +1 -0
- package/dist/checks/business/timezone-handling.d.ts +28 -0
- package/dist/checks/business/timezone-handling.d.ts.map +1 -0
- package/dist/checks/business/timezone-handling.js +294 -0
- package/dist/checks/business/timezone-handling.js.map +1 -0
- package/dist/checks/code-hygiene/any-type-detection.d.ts +30 -0
- package/dist/checks/code-hygiene/any-type-detection.d.ts.map +1 -0
- package/dist/checks/code-hygiene/any-type-detection.js +210 -0
- package/dist/checks/code-hygiene/any-type-detection.js.map +1 -0
- package/dist/checks/code-hygiene/api-error-handling.d.ts +29 -0
- package/dist/checks/code-hygiene/api-error-handling.d.ts.map +1 -0
- package/dist/checks/code-hygiene/api-error-handling.js +285 -0
- package/dist/checks/code-hygiene/api-error-handling.js.map +1 -0
- package/dist/checks/code-hygiene/broken-template-literals.d.ts +24 -0
- package/dist/checks/code-hygiene/broken-template-literals.d.ts.map +1 -0
- package/dist/checks/code-hygiene/broken-template-literals.js +209 -0
- package/dist/checks/code-hygiene/broken-template-literals.js.map +1 -0
- package/dist/checks/code-hygiene/comment-hygiene.d.ts +26 -0
- package/dist/checks/code-hygiene/comment-hygiene.d.ts.map +1 -0
- package/dist/checks/code-hygiene/comment-hygiene.js +421 -0
- package/dist/checks/code-hygiene/comment-hygiene.js.map +1 -0
- package/dist/checks/code-hygiene/console-chars-sync.d.ts +26 -0
- package/dist/checks/code-hygiene/console-chars-sync.d.ts.map +1 -0
- package/dist/checks/code-hygiene/console-chars-sync.js +417 -0
- package/dist/checks/code-hygiene/console-chars-sync.js.map +1 -0
- package/dist/checks/code-hygiene/console-log-detection.d.ts +27 -0
- package/dist/checks/code-hygiene/console-log-detection.d.ts.map +1 -0
- package/dist/checks/code-hygiene/console-log-detection.js +204 -0
- package/dist/checks/code-hygiene/console-log-detection.js.map +1 -0
- package/dist/checks/code-hygiene/dead-code-detection.d.ts +28 -0
- package/dist/checks/code-hygiene/dead-code-detection.d.ts.map +1 -0
- package/dist/checks/code-hygiene/dead-code-detection.js +217 -0
- package/dist/checks/code-hygiene/dead-code-detection.js.map +1 -0
- package/dist/checks/code-hygiene/decorative-separators.d.ts +32 -0
- package/dist/checks/code-hygiene/decorative-separators.d.ts.map +1 -0
- package/dist/checks/code-hygiene/decorative-separators.js +251 -0
- package/dist/checks/code-hygiene/decorative-separators.js.map +1 -0
- package/dist/checks/code-hygiene/empty-catch-detection.d.ts +25 -0
- package/dist/checks/code-hygiene/empty-catch-detection.d.ts.map +1 -0
- package/dist/checks/code-hygiene/empty-catch-detection.js +184 -0
- package/dist/checks/code-hygiene/empty-catch-detection.js.map +1 -0
- package/dist/checks/code-hygiene/fix-hardcoded-emoji.d.ts +18 -0
- package/dist/checks/code-hygiene/fix-hardcoded-emoji.d.ts.map +1 -0
- package/dist/checks/code-hygiene/fix-hardcoded-emoji.js +332 -0
- package/dist/checks/code-hygiene/fix-hardcoded-emoji.js.map +1 -0
- package/dist/checks/code-hygiene/log-level-misuse.d.ts +25 -0
- package/dist/checks/code-hygiene/log-level-misuse.d.ts.map +1 -0
- package/dist/checks/code-hygiene/log-level-misuse.js +383 -0
- package/dist/checks/code-hygiene/log-level-misuse.js.map +1 -0
- package/dist/checks/code-hygiene/missing-logger-import.d.ts +16 -0
- package/dist/checks/code-hygiene/missing-logger-import.d.ts.map +1 -0
- package/dist/checks/code-hygiene/missing-logger-import.js +154 -0
- package/dist/checks/code-hygiene/missing-logger-import.js.map +1 -0
- package/dist/checks/code-hygiene/root-file-hygiene.d.ts +31 -0
- package/dist/checks/code-hygiene/root-file-hygiene.d.ts.map +1 -0
- package/dist/checks/code-hygiene/root-file-hygiene.js +285 -0
- package/dist/checks/code-hygiene/root-file-hygiene.js.map +1 -0
- package/dist/checks/code-hygiene/todo-tracking.d.ts +25 -0
- package/dist/checks/code-hygiene/todo-tracking.d.ts.map +1 -0
- package/dist/checks/code-hygiene/todo-tracking.js +205 -0
- package/dist/checks/code-hygiene/todo-tracking.js.map +1 -0
- package/dist/checks/code-hygiene/unicode-console-compatibility.d.ts +21 -0
- package/dist/checks/code-hygiene/unicode-console-compatibility.d.ts.map +1 -0
- package/dist/checks/code-hygiene/unicode-console-compatibility.js +229 -0
- package/dist/checks/code-hygiene/unicode-console-compatibility.js.map +1 -0
- package/dist/checks/code-quality/duplicate-logic-detection.d.ts +39 -0
- package/dist/checks/code-quality/duplicate-logic-detection.d.ts.map +1 -0
- package/dist/checks/code-quality/duplicate-logic-detection.js +270 -0
- package/dist/checks/code-quality/duplicate-logic-detection.js.map +1 -0
- package/dist/checks/code-quality/feature-flag-hygiene.d.ts +26 -0
- package/dist/checks/code-quality/feature-flag-hygiene.d.ts.map +1 -0
- package/dist/checks/code-quality/feature-flag-hygiene.js +353 -0
- package/dist/checks/code-quality/feature-flag-hygiene.js.map +1 -0
- package/dist/checks/code-quality/grading-config-usage.d.ts +29 -0
- package/dist/checks/code-quality/grading-config-usage.d.ts.map +1 -0
- package/dist/checks/code-quality/grading-config-usage.js +210 -0
- package/dist/checks/code-quality/grading-config-usage.js.map +1 -0
- package/dist/checks/code-quality/legacy-data-pattern-detection.d.ts +36 -0
- package/dist/checks/code-quality/legacy-data-pattern-detection.d.ts.map +1 -0
- package/dist/checks/code-quality/legacy-data-pattern-detection.js +450 -0
- package/dist/checks/code-quality/legacy-data-pattern-detection.js.map +1 -0
- package/dist/checks/code-quality/magic-number-detection.d.ts +30 -0
- package/dist/checks/code-quality/magic-number-detection.d.ts.map +1 -0
- package/dist/checks/code-quality/magic-number-detection.js +405 -0
- package/dist/checks/code-quality/magic-number-detection.js.map +1 -0
- package/dist/checks/code-quality/mock-function-detection.d.ts +32 -0
- package/dist/checks/code-quality/mock-function-detection.d.ts.map +1 -0
- package/dist/checks/code-quality/mock-function-detection.js +244 -0
- package/dist/checks/code-quality/mock-function-detection.js.map +1 -0
- package/dist/checks/code-quality/no-console-production.d.ts +26 -0
- package/dist/checks/code-quality/no-console-production.d.ts.map +1 -0
- package/dist/checks/code-quality/no-console-production.js +272 -0
- package/dist/checks/code-quality/no-console-production.js.map +1 -0
- package/dist/checks/code-quality/shared-utility-gaps.d.ts +27 -0
- package/dist/checks/code-quality/shared-utility-gaps.d.ts.map +1 -0
- package/dist/checks/code-quality/shared-utility-gaps.js +413 -0
- package/dist/checks/code-quality/shared-utility-gaps.js.map +1 -0
- package/dist/checks/code-quality/stub-script-detection.d.ts +32 -0
- package/dist/checks/code-quality/stub-script-detection.d.ts.map +1 -0
- package/dist/checks/code-quality/stub-script-detection.js +211 -0
- package/dist/checks/code-quality/stub-script-detection.js.map +1 -0
- package/dist/checks/code-quality/typescript-type-safety.d.ts +31 -0
- package/dist/checks/code-quality/typescript-type-safety.d.ts.map +1 -0
- package/dist/checks/code-quality/typescript-type-safety.js +228 -0
- package/dist/checks/code-quality/typescript-type-safety.js.map +1 -0
- package/dist/checks/component-imports.d.ts +15 -0
- package/dist/checks/component-imports.d.ts.map +1 -0
- package/dist/checks/component-imports.js +227 -0
- package/dist/checks/component-imports.js.map +1 -0
- package/dist/checks/config/env-completeness.d.ts +20 -0
- package/dist/checks/config/env-completeness.d.ts.map +1 -0
- package/dist/checks/config/env-completeness.js +193 -0
- package/dist/checks/config/env-completeness.js.map +1 -0
- package/dist/checks/coverage-gap-analysis.d.ts +21 -0
- package/dist/checks/coverage-gap-analysis.d.ts.map +1 -0
- package/dist/checks/coverage-gap-analysis.js +779 -0
- package/dist/checks/coverage-gap-analysis.js.map +1 -0
- package/dist/checks/css/dead-css-detection.d.ts +14 -0
- package/dist/checks/css/dead-css-detection.d.ts.map +1 -0
- package/dist/checks/css/dead-css-detection.js +222 -0
- package/dist/checks/css/dead-css-detection.js.map +1 -0
- package/dist/checks/css/sticky-header-validation.d.ts +19 -0
- package/dist/checks/css/sticky-header-validation.d.ts.map +1 -0
- package/dist/checks/css/sticky-header-validation.js +256 -0
- package/dist/checks/css/sticky-header-validation.js.map +1 -0
- package/dist/checks/data-integrity/cart-data-integrity.d.ts +19 -0
- package/dist/checks/data-integrity/cart-data-integrity.d.ts.map +1 -0
- package/dist/checks/data-integrity/cart-data-integrity.js +235 -0
- package/dist/checks/data-integrity/cart-data-integrity.js.map +1 -0
- package/dist/checks/data-integrity/enum-special-chars-validation.d.ts +26 -0
- package/dist/checks/data-integrity/enum-special-chars-validation.d.ts.map +1 -0
- package/dist/checks/data-integrity/enum-special-chars-validation.js +94 -0
- package/dist/checks/data-integrity/enum-special-chars-validation.js.map +1 -0
- package/dist/checks/data-integrity/notification-template-alignment.d.ts +21 -0
- package/dist/checks/data-integrity/notification-template-alignment.d.ts.map +1 -0
- package/dist/checks/data-integrity/notification-template-alignment.js +372 -0
- package/dist/checks/data-integrity/notification-template-alignment.js.map +1 -0
- package/dist/checks/data-integrity/product-data-flow-validation.d.ts +21 -0
- package/dist/checks/data-integrity/product-data-flow-validation.d.ts.map +1 -0
- package/dist/checks/data-integrity/product-data-flow-validation.js +569 -0
- package/dist/checks/data-integrity/product-data-flow-validation.js.map +1 -0
- package/dist/checks/data-integrity/store-data-integrity.d.ts +18 -0
- package/dist/checks/data-integrity/store-data-integrity.d.ts.map +1 -0
- package/dist/checks/data-integrity/store-data-integrity.js +398 -0
- package/dist/checks/data-integrity/store-data-integrity.js.map +1 -0
- package/dist/checks/data-integrity/unwired-functionality.d.ts +22 -0
- package/dist/checks/data-integrity/unwired-functionality.d.ts.map +1 -0
- package/dist/checks/data-integrity/unwired-functionality.js +550 -0
- package/dist/checks/data-integrity/unwired-functionality.js.map +1 -0
- package/dist/checks/database/block-db-push.d.ts +29 -0
- package/dist/checks/database/block-db-push.d.ts.map +1 -0
- package/dist/checks/database/block-db-push.js +138 -0
- package/dist/checks/database/block-db-push.js.map +1 -0
- package/dist/checks/database/grade-integrity.d.ts +13 -0
- package/dist/checks/database/grade-integrity.d.ts.map +1 -0
- package/dist/checks/database/grade-integrity.js +131 -0
- package/dist/checks/database/grade-integrity.js.map +1 -0
- package/dist/checks/database/migration-integrity.d.ts +26 -0
- package/dist/checks/database/migration-integrity.d.ts.map +1 -0
- package/dist/checks/database/migration-integrity.js +239 -0
- package/dist/checks/database/migration-integrity.js.map +1 -0
- package/dist/checks/database/migration-reversibility.d.ts +25 -0
- package/dist/checks/database/migration-reversibility.d.ts.map +1 -0
- package/dist/checks/database/migration-reversibility.js +277 -0
- package/dist/checks/database/migration-reversibility.js.map +1 -0
- package/dist/checks/database/migration-safety.d.ts +27 -0
- package/dist/checks/database/migration-safety.d.ts.map +1 -0
- package/dist/checks/database/migration-safety.js +243 -0
- package/dist/checks/database/migration-safety.js.map +1 -0
- package/dist/checks/database/prisma-client-db-sync.d.ts +24 -0
- package/dist/checks/database/prisma-client-db-sync.d.ts.map +1 -0
- package/dist/checks/database/prisma-client-db-sync.js +226 -0
- package/dist/checks/database/prisma-client-db-sync.js.map +1 -0
- package/dist/checks/database/prisma-drift-prevention.d.ts +29 -0
- package/dist/checks/database/prisma-drift-prevention.d.ts.map +1 -0
- package/dist/checks/database/prisma-drift-prevention.js +614 -0
- package/dist/checks/database/prisma-drift-prevention.js.map +1 -0
- package/dist/checks/database/prisma-overfetch-detection.d.ts +26 -0
- package/dist/checks/database/prisma-overfetch-detection.d.ts.map +1 -0
- package/dist/checks/database/prisma-overfetch-detection.js +666 -0
- package/dist/checks/database/prisma-overfetch-detection.js.map +1 -0
- package/dist/checks/database/prisma-precommit-guard.d.ts +25 -0
- package/dist/checks/database/prisma-precommit-guard.d.ts.map +1 -0
- package/dist/checks/database/prisma-precommit-guard.js +188 -0
- package/dist/checks/database/prisma-precommit-guard.js.map +1 -0
- package/dist/checks/database/prisma-schema-syntax.d.ts +17 -0
- package/dist/checks/database/prisma-schema-syntax.d.ts.map +1 -0
- package/dist/checks/database/prisma-schema-syntax.js +50 -0
- package/dist/checks/database/prisma-schema-syntax.js.map +1 -0
- package/dist/checks/database/prod-db-guardrail.d.ts +20 -0
- package/dist/checks/database/prod-db-guardrail.d.ts.map +1 -0
- package/dist/checks/database/prod-db-guardrail.js +184 -0
- package/dist/checks/database/prod-db-guardrail.js.map +1 -0
- package/dist/checks/database/schema-best-practices.d.ts +24 -0
- package/dist/checks/database/schema-best-practices.d.ts.map +1 -0
- package/dist/checks/database/schema-best-practices.js +393 -0
- package/dist/checks/database/schema-best-practices.js.map +1 -0
- package/dist/checks/database/schema-migration-column-sync.d.ts +33 -0
- package/dist/checks/database/schema-migration-column-sync.d.ts.map +1 -0
- package/dist/checks/database/schema-migration-column-sync.js +561 -0
- package/dist/checks/database/schema-migration-column-sync.js.map +1 -0
- package/dist/checks/database/seed-coverage-validation.d.ts +29 -0
- package/dist/checks/database/seed-coverage-validation.d.ts.map +1 -0
- package/dist/checks/database/seed-coverage-validation.js +595 -0
- package/dist/checks/database/seed-coverage-validation.js.map +1 -0
- package/dist/checks/database/soft-delete-consistency.d.ts +24 -0
- package/dist/checks/database/soft-delete-consistency.d.ts.map +1 -0
- package/dist/checks/database/soft-delete-consistency.js +273 -0
- package/dist/checks/database/soft-delete-consistency.js.map +1 -0
- package/dist/checks/database/tcg-seed-validation.d.ts +29 -0
- package/dist/checks/database/tcg-seed-validation.d.ts.map +1 -0
- package/dist/checks/database/tcg-seed-validation.js +281 -0
- package/dist/checks/database/tcg-seed-validation.js.map +1 -0
- package/dist/checks/database/transaction-integrity.d.ts +25 -0
- package/dist/checks/database/transaction-integrity.d.ts.map +1 -0
- package/dist/checks/database/transaction-integrity.js +275 -0
- package/dist/checks/database/transaction-integrity.js.map +1 -0
- package/dist/checks/database/unused-schema-detection.d.ts +28 -0
- package/dist/checks/database/unused-schema-detection.d.ts.map +1 -0
- package/dist/checks/database/unused-schema-detection.js +624 -0
- package/dist/checks/database/unused-schema-detection.js.map +1 -0
- package/dist/checks/dependencies/deprecated-packages.d.ts +17 -0
- package/dist/checks/dependencies/deprecated-packages.d.ts.map +1 -0
- package/dist/checks/dependencies/deprecated-packages.js +220 -0
- package/dist/checks/dependencies/deprecated-packages.js.map +1 -0
- package/dist/checks/dependencies/weekly-stable-updates.d.ts +27 -0
- package/dist/checks/dependencies/weekly-stable-updates.d.ts.map +1 -0
- package/dist/checks/dependencies/weekly-stable-updates.js +490 -0
- package/dist/checks/dependencies/weekly-stable-updates.js.map +1 -0
- package/dist/checks/deployment/esm-import-extensions.d.ts +23 -0
- package/dist/checks/deployment/esm-import-extensions.d.ts.map +1 -0
- package/dist/checks/deployment/esm-import-extensions.js +183 -0
- package/dist/checks/deployment/esm-import-extensions.js.map +1 -0
- package/dist/checks/deployment/pre-production-checklist-quick.d.ts +15 -0
- package/dist/checks/deployment/pre-production-checklist-quick.d.ts.map +1 -0
- package/dist/checks/deployment/pre-production-checklist-quick.js +140 -0
- package/dist/checks/deployment/pre-production-checklist-quick.js.map +1 -0
- package/dist/checks/deployment/pre-production-checklist.d.ts +18 -0
- package/dist/checks/deployment/pre-production-checklist.d.ts.map +1 -0
- package/dist/checks/deployment/pre-production-checklist.js +219 -0
- package/dist/checks/deployment/pre-production-checklist.js.map +1 -0
- package/dist/checks/deployment/production-config.d.ts +36 -0
- package/dist/checks/deployment/production-config.d.ts.map +1 -0
- package/dist/checks/deployment/production-config.js +424 -0
- package/dist/checks/deployment/production-config.js.map +1 -0
- package/dist/checks/deployment/production-env-validation.d.ts +18 -0
- package/dist/checks/deployment/production-env-validation.d.ts.map +1 -0
- package/dist/checks/deployment/production-env-validation.js +162 -0
- package/dist/checks/deployment/production-env-validation.js.map +1 -0
- package/dist/checks/deployment/rollback-compatibility.d.ts +27 -0
- package/dist/checks/deployment/rollback-compatibility.d.ts.map +1 -0
- package/dist/checks/deployment/rollback-compatibility.js +327 -0
- package/dist/checks/deployment/rollback-compatibility.js.map +1 -0
- package/dist/checks/deprecated-api-usage.d.ts +86 -0
- package/dist/checks/deprecated-api-usage.d.ts.map +1 -0
- package/dist/checks/deprecated-api-usage.js +382 -0
- package/dist/checks/deprecated-api-usage.js.map +1 -0
- package/dist/checks/drift-prevention/api-contract-consistency.d.ts +18 -0
- package/dist/checks/drift-prevention/api-contract-consistency.d.ts.map +1 -0
- package/dist/checks/drift-prevention/api-contract-consistency.js +279 -0
- package/dist/checks/drift-prevention/api-contract-consistency.js.map +1 -0
- package/dist/checks/drift-prevention/breaking-change-detection.d.ts +28 -0
- package/dist/checks/drift-prevention/breaking-change-detection.d.ts.map +1 -0
- package/dist/checks/drift-prevention/breaking-change-detection.js +364 -0
- package/dist/checks/drift-prevention/breaking-change-detection.js.map +1 -0
- package/dist/checks/drift-prevention/component-prop-consistency.d.ts +18 -0
- package/dist/checks/drift-prevention/component-prop-consistency.d.ts.map +1 -0
- package/dist/checks/drift-prevention/component-prop-consistency.js +289 -0
- package/dist/checks/drift-prevention/component-prop-consistency.js.map +1 -0
- package/dist/checks/drift-prevention/database-query-patterns.d.ts +19 -0
- package/dist/checks/drift-prevention/database-query-patterns.d.ts.map +1 -0
- package/dist/checks/drift-prevention/database-query-patterns.js +340 -0
- package/dist/checks/drift-prevention/database-query-patterns.js.map +1 -0
- package/dist/checks/drift-prevention/design-system-consistency.d.ts +18 -0
- package/dist/checks/drift-prevention/design-system-consistency.d.ts.map +1 -0
- package/dist/checks/drift-prevention/design-system-consistency.js +419 -0
- package/dist/checks/drift-prevention/design-system-consistency.js.map +1 -0
- package/dist/checks/drift-prevention/empty-state-consistency.d.ts +17 -0
- package/dist/checks/drift-prevention/empty-state-consistency.d.ts.map +1 -0
- package/dist/checks/drift-prevention/empty-state-consistency.js +257 -0
- package/dist/checks/drift-prevention/empty-state-consistency.js.map +1 -0
- package/dist/checks/drift-prevention/performance-regression-detection.d.ts +18 -0
- package/dist/checks/drift-prevention/performance-regression-detection.d.ts.map +1 -0
- package/dist/checks/drift-prevention/performance-regression-detection.js +444 -0
- package/dist/checks/drift-prevention/performance-regression-detection.js.map +1 -0
- package/dist/checks/drift-prevention/size-convention-consistency.d.ts +40 -0
- package/dist/checks/drift-prevention/size-convention-consistency.d.ts.map +1 -0
- package/dist/checks/drift-prevention/size-convention-consistency.js +219 -0
- package/dist/checks/drift-prevention/size-convention-consistency.js.map +1 -0
- package/dist/checks/drift-prevention/state-management-patterns.d.ts +18 -0
- package/dist/checks/drift-prevention/state-management-patterns.d.ts.map +1 -0
- package/dist/checks/drift-prevention/state-management-patterns.js +240 -0
- package/dist/checks/drift-prevention/state-management-patterns.js.map +1 -0
- package/dist/checks/e2e/e2e-action-outcome-validator.d.ts +21 -0
- package/dist/checks/e2e/e2e-action-outcome-validator.d.ts.map +1 -0
- package/dist/checks/e2e/e2e-action-outcome-validator.js +292 -0
- package/dist/checks/e2e/e2e-action-outcome-validator.js.map +1 -0
- package/dist/checks/e2e/e2e-interaction-coverage-scan.d.ts +21 -0
- package/dist/checks/e2e/e2e-interaction-coverage-scan.d.ts.map +1 -0
- package/dist/checks/e2e/e2e-interaction-coverage-scan.js +1688 -0
- package/dist/checks/e2e/e2e-interaction-coverage-scan.js.map +1 -0
- package/dist/checks/e2e/e2e-interaction-regression.d.ts +19 -0
- package/dist/checks/e2e/e2e-interaction-regression.d.ts.map +1 -0
- package/dist/checks/e2e/e2e-interaction-regression.js +1039 -0
- package/dist/checks/e2e/e2e-interaction-regression.js.map +1 -0
- package/dist/checks/e2e/e2e-outcome-validation.d.ts +33 -0
- package/dist/checks/e2e/e2e-outcome-validation.d.ts.map +1 -0
- package/dist/checks/e2e/e2e-outcome-validation.js +610 -0
- package/dist/checks/e2e/e2e-outcome-validation.js.map +1 -0
- package/dist/checks/e2e/e2e-performance-baseline.d.ts +14 -0
- package/dist/checks/e2e/e2e-performance-baseline.d.ts.map +1 -0
- package/dist/checks/e2e/e2e-performance-baseline.js +289 -0
- package/dist/checks/e2e/e2e-performance-baseline.js.map +1 -0
- package/dist/checks/e2e/e2e-performance-patterns.d.ts +19 -0
- package/dist/checks/e2e/e2e-performance-patterns.d.ts.map +1 -0
- package/dist/checks/e2e/e2e-performance-patterns.js +464 -0
- package/dist/checks/e2e/e2e-performance-patterns.js.map +1 -0
- package/dist/checks/e2e/e2e-performance-regression.d.ts +18 -0
- package/dist/checks/e2e/e2e-performance-regression.d.ts.map +1 -0
- package/dist/checks/e2e/e2e-performance-regression.js +230 -0
- package/dist/checks/e2e/e2e-performance-regression.js.map +1 -0
- package/dist/checks/e2e/e2e-resource-monitoring.d.ts +17 -0
- package/dist/checks/e2e/e2e-resource-monitoring.d.ts.map +1 -0
- package/dist/checks/e2e/e2e-resource-monitoring.js +368 -0
- package/dist/checks/e2e/e2e-resource-monitoring.js.map +1 -0
- package/dist/checks/e2e/e2e-test-redundancy-scan.d.ts +27 -0
- package/dist/checks/e2e/e2e-test-redundancy-scan.d.ts.map +1 -0
- package/dist/checks/e2e/e2e-test-redundancy-scan.js +477 -0
- package/dist/checks/e2e/e2e-test-redundancy-scan.js.map +1 -0
- package/dist/checks/e2e/playwright-config-validator.d.ts +25 -0
- package/dist/checks/e2e/playwright-config-validator.d.ts.map +1 -0
- package/dist/checks/e2e/playwright-config-validator.js +558 -0
- package/dist/checks/e2e/playwright-config-validator.js.map +1 -0
- package/dist/checks/environment/env-duplicates.d.ts +16 -0
- package/dist/checks/environment/env-duplicates.d.ts.map +1 -0
- package/dist/checks/environment/env-duplicates.js +166 -0
- package/dist/checks/environment/env-duplicates.js.map +1 -0
- package/dist/checks/event-listener-cleanup.d.ts +18 -0
- package/dist/checks/event-listener-cleanup.d.ts.map +1 -0
- package/dist/checks/event-listener-cleanup.js +187 -0
- package/dist/checks/event-listener-cleanup.js.map +1 -0
- package/dist/checks/file-naming-conventions.d.ts +21 -0
- package/dist/checks/file-naming-conventions.d.ts.map +1 -0
- package/dist/checks/file-naming-conventions.js +1258 -0
- package/dist/checks/file-naming-conventions.js.map +1 -0
- package/dist/checks/framework/framework-compatibility.d.ts +35 -0
- package/dist/checks/framework/framework-compatibility.d.ts.map +1 -0
- package/dist/checks/framework/framework-compatibility.js +159 -0
- package/dist/checks/framework/framework-compatibility.js.map +1 -0
- package/dist/checks/framework/turbopack-enforcement.d.ts +22 -0
- package/dist/checks/framework/turbopack-enforcement.d.ts.map +1 -0
- package/dist/checks/framework/turbopack-enforcement.js +171 -0
- package/dist/checks/framework/turbopack-enforcement.js.map +1 -0
- package/dist/checks/governance/check-ui-uniformity.d.ts +18 -0
- package/dist/checks/governance/check-ui-uniformity.d.ts.map +1 -0
- package/dist/checks/governance/check-ui-uniformity.js +127 -0
- package/dist/checks/governance/check-ui-uniformity.js.map +1 -0
- package/dist/checks/governance/codeowners-coverage.d.ts +26 -0
- package/dist/checks/governance/codeowners-coverage.d.ts.map +1 -0
- package/dist/checks/governance/codeowners-coverage.js +290 -0
- package/dist/checks/governance/codeowners-coverage.js.map +1 -0
- package/dist/checks/governance/naming-conventions.d.ts +7 -0
- package/dist/checks/governance/naming-conventions.d.ts.map +1 -0
- package/dist/checks/governance/naming-conventions.js +115 -0
- package/dist/checks/governance/naming-conventions.js.map +1 -0
- package/dist/checks/governance/seller-store-naming-consistency.d.ts +32 -0
- package/dist/checks/governance/seller-store-naming-consistency.d.ts.map +1 -0
- package/dist/checks/governance/seller-store-naming-consistency.js +241 -0
- package/dist/checks/governance/seller-store-naming-consistency.js.map +1 -0
- package/dist/checks/governance/store-seller-route-names.d.ts +17 -0
- package/dist/checks/governance/store-seller-route-names.d.ts.map +1 -0
- package/dist/checks/governance/store-seller-route-names.js +170 -0
- package/dist/checks/governance/store-seller-route-names.js.map +1 -0
- package/dist/checks/grading-config-usage.d.ts +23 -0
- package/dist/checks/grading-config-usage.d.ts.map +1 -0
- package/dist/checks/grading-config-usage.js +197 -0
- package/dist/checks/grading-config-usage.js.map +1 -0
- package/dist/checks/help-center-features-validation.d.ts +21 -0
- package/dist/checks/help-center-features-validation.d.ts.map +1 -0
- package/dist/checks/help-center-features-validation.js +529 -0
- package/dist/checks/help-center-features-validation.js.map +1 -0
- package/dist/checks/help-center-validation.d.ts +21 -0
- package/dist/checks/help-center-validation.d.ts.map +1 -0
- package/dist/checks/help-center-validation.js +325 -0
- package/dist/checks/help-center-validation.js.map +1 -0
- package/dist/checks/image/card-edge-protection.d.ts +33 -0
- package/dist/checks/image/card-edge-protection.d.ts.map +1 -0
- package/dist/checks/image/card-edge-protection.js +230 -0
- package/dist/checks/image/card-edge-protection.js.map +1 -0
- package/dist/checks/image/card-orientation-validation.d.ts +34 -0
- package/dist/checks/image/card-orientation-validation.d.ts.map +1 -0
- package/dist/checks/image/card-orientation-validation.js +519 -0
- package/dist/checks/image/card-orientation-validation.js.map +1 -0
- package/dist/checks/integrations/integrations-consolidated.d.ts +76 -0
- package/dist/checks/integrations/integrations-consolidated.d.ts.map +1 -0
- package/dist/checks/integrations/integrations-consolidated.js +493 -0
- package/dist/checks/integrations/integrations-consolidated.js.map +1 -0
- package/dist/checks/integrations/platform-feed-integrity.d.ts +75 -0
- package/dist/checks/integrations/platform-feed-integrity.d.ts.map +1 -0
- package/dist/checks/integrations/platform-feed-integrity.js +487 -0
- package/dist/checks/integrations/platform-feed-integrity.js.map +1 -0
- package/dist/checks/master-preflight.d.ts +56 -0
- package/dist/checks/master-preflight.d.ts.map +1 -0
- package/dist/checks/master-preflight.js +254 -0
- package/dist/checks/master-preflight.js.map +1 -0
- package/dist/checks/nextjs/dynamic-route-exports.d.ts +28 -0
- package/dist/checks/nextjs/dynamic-route-exports.d.ts.map +1 -0
- package/dist/checks/nextjs/dynamic-route-exports.js +201 -0
- package/dist/checks/nextjs/dynamic-route-exports.js.map +1 -0
- package/dist/checks/nextjs/essential-files-validation.d.ts +23 -0
- package/dist/checks/nextjs/essential-files-validation.d.ts.map +1 -0
- package/dist/checks/nextjs/essential-files-validation.js +355 -0
- package/dist/checks/nextjs/essential-files-validation.js.map +1 -0
- package/dist/checks/nextjs/ignore-build-errors.d.ts +15 -0
- package/dist/checks/nextjs/ignore-build-errors.d.ts.map +1 -0
- package/dist/checks/nextjs/ignore-build-errors.js +120 -0
- package/dist/checks/nextjs/ignore-build-errors.js.map +1 -0
- package/dist/checks/nextjs/metadata-api-placement.d.ts +29 -0
- package/dist/checks/nextjs/metadata-api-placement.d.ts.map +1 -0
- package/dist/checks/nextjs/metadata-api-placement.js +274 -0
- package/dist/checks/nextjs/metadata-api-placement.js.map +1 -0
- package/dist/checks/nextjs/nextjs-image-validation.d.ts +52 -0
- package/dist/checks/nextjs/nextjs-image-validation.d.ts.map +1 -0
- package/dist/checks/nextjs/nextjs-image-validation.js +253 -0
- package/dist/checks/nextjs/nextjs-image-validation.js.map +1 -0
- package/dist/checks/nextjs/nextjs16-compatibility.d.ts +39 -0
- package/dist/checks/nextjs/nextjs16-compatibility.d.ts.map +1 -0
- package/dist/checks/nextjs/nextjs16-compatibility.js +1208 -0
- package/dist/checks/nextjs/nextjs16-compatibility.js.map +1 -0
- package/dist/checks/nextjs/static-generation-check.d.ts +25 -0
- package/dist/checks/nextjs/static-generation-check.d.ts.map +1 -0
- package/dist/checks/nextjs/static-generation-check.js +178 -0
- package/dist/checks/nextjs/static-generation-check.js.map +1 -0
- package/dist/checks/observability/centralized-logging-validation.d.ts +22 -0
- package/dist/checks/observability/centralized-logging-validation.d.ts.map +1 -0
- package/dist/checks/observability/centralized-logging-validation.js +285 -0
- package/dist/checks/observability/centralized-logging-validation.js.map +1 -0
- package/dist/checks/order-number-consistency.d.ts +23 -0
- package/dist/checks/order-number-consistency.d.ts.map +1 -0
- package/dist/checks/order-number-consistency.js +288 -0
- package/dist/checks/order-number-consistency.js.map +1 -0
- package/dist/checks/organization/agent-steering-validation.d.ts +16 -0
- package/dist/checks/organization/agent-steering-validation.d.ts.map +1 -0
- package/dist/checks/organization/agent-steering-validation.js +186 -0
- package/dist/checks/organization/agent-steering-validation.js.map +1 -0
- package/dist/checks/organization/api-route-consolidation.d.ts +23 -0
- package/dist/checks/organization/api-route-consolidation.d.ts.map +1 -0
- package/dist/checks/organization/api-route-consolidation.js +364 -0
- package/dist/checks/organization/api-route-consolidation.js.map +1 -0
- package/dist/checks/organization/api-route-naming-validation.d.ts +23 -0
- package/dist/checks/organization/api-route-naming-validation.d.ts.map +1 -0
- package/dist/checks/organization/api-route-naming-validation.js +491 -0
- package/dist/checks/organization/api-route-naming-validation.js.map +1 -0
- package/dist/checks/organization/file-organization-validation.d.ts +18 -0
- package/dist/checks/organization/file-organization-validation.d.ts.map +1 -0
- package/dist/checks/organization/file-organization-validation.js +562 -0
- package/dist/checks/organization/file-organization-validation.js.map +1 -0
- package/dist/checks/organization/npm-script-bloat-prevention.d.ts +40 -0
- package/dist/checks/organization/npm-script-bloat-prevention.d.ts.map +1 -0
- package/dist/checks/organization/npm-script-bloat-prevention.js +412 -0
- package/dist/checks/organization/npm-script-bloat-prevention.js.map +1 -0
- package/dist/checks/organization/preflight-env-check.d.ts +12 -0
- package/dist/checks/organization/preflight-env-check.d.ts.map +1 -0
- package/dist/checks/organization/preflight-env-check.js +157 -0
- package/dist/checks/organization/preflight-env-check.js.map +1 -0
- package/dist/checks/organization/preflight-progress-consistency.d.ts +25 -0
- package/dist/checks/organization/preflight-progress-consistency.d.ts.map +1 -0
- package/dist/checks/organization/preflight-progress-consistency.js +227 -0
- package/dist/checks/organization/preflight-progress-consistency.js.map +1 -0
- package/dist/checks/organization/preflight-system-validation.d.ts +19 -0
- package/dist/checks/organization/preflight-system-validation.d.ts.map +1 -0
- package/dist/checks/organization/preflight-system-validation.js +487 -0
- package/dist/checks/organization/preflight-system-validation.js.map +1 -0
- package/dist/checks/organization/preflight-typescript-validation.d.ts +14 -0
- package/dist/checks/organization/preflight-typescript-validation.d.ts.map +1 -0
- package/dist/checks/organization/preflight-typescript-validation.js +43 -0
- package/dist/checks/organization/preflight-typescript-validation.js.map +1 -0
- package/dist/checks/organization/route-structure-validation.d.ts +18 -0
- package/dist/checks/organization/route-structure-validation.d.ts.map +1 -0
- package/dist/checks/organization/route-structure-validation.js +235 -0
- package/dist/checks/organization/route-structure-validation.js.map +1 -0
- package/dist/checks/organization/steering-bloat-prevention.d.ts +88 -0
- package/dist/checks/organization/steering-bloat-prevention.d.ts.map +1 -0
- package/dist/checks/organization/steering-bloat-prevention.js +1197 -0
- package/dist/checks/organization/steering-bloat-prevention.js.map +1 -0
- package/dist/checks/performance/bundle-optimization-drift.d.ts +18 -0
- package/dist/checks/performance/bundle-optimization-drift.d.ts.map +1 -0
- package/dist/checks/performance/bundle-optimization-drift.js +260 -0
- package/dist/checks/performance/bundle-optimization-drift.js.map +1 -0
- package/dist/checks/performance/bundle-size-regression.d.ts +14 -0
- package/dist/checks/performance/bundle-size-regression.d.ts.map +1 -0
- package/dist/checks/performance/bundle-size-regression.js +236 -0
- package/dist/checks/performance/bundle-size-regression.js.map +1 -0
- package/dist/checks/performance/core-web-vitals.d.ts +39 -0
- package/dist/checks/performance/core-web-vitals.d.ts.map +1 -0
- package/dist/checks/performance/core-web-vitals.js +445 -0
- package/dist/checks/performance/core-web-vitals.js.map +1 -0
- package/dist/checks/performance/mobile-performance-budget.d.ts +29 -0
- package/dist/checks/performance/mobile-performance-budget.d.ts.map +1 -0
- package/dist/checks/performance/mobile-performance-budget.js +415 -0
- package/dist/checks/performance/mobile-performance-budget.js.map +1 -0
- package/dist/checks/performance/runtime-regression.d.ts +17 -0
- package/dist/checks/performance/runtime-regression.d.ts.map +1 -0
- package/dist/checks/performance/runtime-regression.js +425 -0
- package/dist/checks/performance/runtime-regression.js.map +1 -0
- package/dist/checks/performance/unused-preload-detection.d.ts +17 -0
- package/dist/checks/performance/unused-preload-detection.d.ts.map +1 -0
- package/dist/checks/performance/unused-preload-detection.js +185 -0
- package/dist/checks/performance/unused-preload-detection.js.map +1 -0
- package/dist/checks/prisma/prisma7-compatibility.d.ts +29 -0
- package/dist/checks/prisma/prisma7-compatibility.d.ts.map +1 -0
- package/dist/checks/prisma/prisma7-compatibility.js +440 -0
- package/dist/checks/prisma/prisma7-compatibility.js.map +1 -0
- package/dist/checks/quality/component-size.d.ts +13 -0
- package/dist/checks/quality/component-size.d.ts.map +1 -0
- package/dist/checks/quality/component-size.js +104 -0
- package/dist/checks/quality/component-size.js.map +1 -0
- package/dist/checks/quality/critical-type-imports.d.ts +23 -0
- package/dist/checks/quality/critical-type-imports.d.ts.map +1 -0
- package/dist/checks/quality/critical-type-imports.js +632 -0
- package/dist/checks/quality/critical-type-imports.js.map +1 -0
- package/dist/checks/quality/development.d.ts +13 -0
- package/dist/checks/quality/development.d.ts.map +1 -0
- package/dist/checks/quality/development.js +98 -0
- package/dist/checks/quality/development.js.map +1 -0
- package/dist/checks/quality/docs-code-sync.d.ts +27 -0
- package/dist/checks/quality/docs-code-sync.d.ts.map +1 -0
- package/dist/checks/quality/docs-code-sync.js +368 -0
- package/dist/checks/quality/docs-code-sync.js.map +1 -0
- package/dist/checks/quality/duplicate-jsx-attributes.d.ts +23 -0
- package/dist/checks/quality/duplicate-jsx-attributes.d.ts.map +1 -0
- package/dist/checks/quality/duplicate-jsx-attributes.js +201 -0
- package/dist/checks/quality/duplicate-jsx-attributes.js.map +1 -0
- package/dist/checks/quality/file-size.d.ts +13 -0
- package/dist/checks/quality/file-size.d.ts.map +1 -0
- package/dist/checks/quality/file-size.js +97 -0
- package/dist/checks/quality/file-size.js.map +1 -0
- package/dist/checks/quality/file-validation.d.ts +13 -0
- package/dist/checks/quality/file-validation.d.ts.map +1 -0
- package/dist/checks/quality/file-validation.js +103 -0
- package/dist/checks/quality/file-validation.js.map +1 -0
- package/dist/checks/quality/i18n-hardcoded-strings.d.ts +28 -0
- package/dist/checks/quality/i18n-hardcoded-strings.d.ts.map +1 -0
- package/dist/checks/quality/i18n-hardcoded-strings.js +336 -0
- package/dist/checks/quality/i18n-hardcoded-strings.js.map +1 -0
- package/dist/checks/quality/lint-preflight.d.ts +70 -0
- package/dist/checks/quality/lint-preflight.d.ts.map +1 -0
- package/dist/checks/quality/lint-preflight.js +477 -0
- package/dist/checks/quality/lint-preflight.js.map +1 -0
- package/dist/checks/quality/react-namespace-import.d.ts +27 -0
- package/dist/checks/quality/react-namespace-import.d.ts.map +1 -0
- package/dist/checks/quality/react-namespace-import.js +212 -0
- package/dist/checks/quality/react-namespace-import.js.map +1 -0
- package/dist/checks/quality/strict-lint.d.ts +13 -0
- package/dist/checks/quality/strict-lint.d.ts.map +1 -0
- package/dist/checks/quality/strict-lint.js +41 -0
- package/dist/checks/quality/strict-lint.js.map +1 -0
- package/dist/checks/quality/syntax.d.ts +13 -0
- package/dist/checks/quality/syntax.d.ts.map +1 -0
- package/dist/checks/quality/syntax.js +94 -0
- package/dist/checks/quality/syntax.js.map +1 -0
- package/dist/checks/quality/unused-imports.d.ts +14 -0
- package/dist/checks/quality/unused-imports.d.ts.map +1 -0
- package/dist/checks/quality/unused-imports.js +172 -0
- package/dist/checks/quality/unused-imports.js.map +1 -0
- package/dist/checks/react/component-best-practices.d.ts +23 -0
- package/dist/checks/react/component-best-practices.d.ts.map +1 -0
- package/dist/checks/react/component-best-practices.js +273 -0
- package/dist/checks/react/component-best-practices.js.map +1 -0
- package/dist/checks/react/error-boundary-coverage.d.ts +26 -0
- package/dist/checks/react/error-boundary-coverage.d.ts.map +1 -0
- package/dist/checks/react/error-boundary-coverage.js +304 -0
- package/dist/checks/react/error-boundary-coverage.js.map +1 -0
- package/dist/checks/react/memory-leak-detection.d.ts +22 -0
- package/dist/checks/react/memory-leak-detection.d.ts.map +1 -0
- package/dist/checks/react/memory-leak-detection.js +268 -0
- package/dist/checks/react/memory-leak-detection.js.map +1 -0
- package/dist/checks/react/memory-leak-patterns.d.ts +27 -0
- package/dist/checks/react/memory-leak-patterns.d.ts.map +1 -0
- package/dist/checks/react/memory-leak-patterns.js +324 -0
- package/dist/checks/react/memory-leak-patterns.js.map +1 -0
- package/dist/checks/react/react19-compatibility.d.ts +14 -0
- package/dist/checks/react/react19-compatibility.d.ts.map +1 -0
- package/dist/checks/react/react19-compatibility.js +433 -0
- package/dist/checks/react/react19-compatibility.js.map +1 -0
- package/dist/checks/react/useeffect-loop-detector.d.ts +25 -0
- package/dist/checks/react/useeffect-loop-detector.d.ts.map +1 -0
- package/dist/checks/react/useeffect-loop-detector.js +216 -0
- package/dist/checks/react/useeffect-loop-detector.js.map +1 -0
- package/dist/checks/runtime/client-process-env-usage.d.ts +28 -0
- package/dist/checks/runtime/client-process-env-usage.d.ts.map +1 -0
- package/dist/checks/runtime/client-process-env-usage.js +190 -0
- package/dist/checks/runtime/client-process-env-usage.js.map +1 -0
- package/dist/checks/runtime/client-runtime-errors.d.ts +34 -0
- package/dist/checks/runtime/client-runtime-errors.d.ts.map +1 -0
- package/dist/checks/runtime/client-runtime-errors.js +308 -0
- package/dist/checks/runtime/client-runtime-errors.js.map +1 -0
- package/dist/checks/runtime/dev-error-monitoring-system.d.ts +22 -0
- package/dist/checks/runtime/dev-error-monitoring-system.d.ts.map +1 -0
- package/dist/checks/runtime/dev-error-monitoring-system.js +209 -0
- package/dist/checks/runtime/dev-error-monitoring-system.js.map +1 -0
- package/dist/checks/runtime/gtm-installation.d.ts +21 -0
- package/dist/checks/runtime/gtm-installation.d.ts.map +1 -0
- package/dist/checks/runtime/gtm-installation.js +341 -0
- package/dist/checks/runtime/gtm-installation.js.map +1 -0
- package/dist/checks/runtime/json-parse-safety.d.ts +22 -0
- package/dist/checks/runtime/json-parse-safety.d.ts.map +1 -0
- package/dist/checks/runtime/json-parse-safety.js +179 -0
- package/dist/checks/runtime/json-parse-safety.js.map +1 -0
- package/dist/checks/runtime/missing-public-env-import.d.ts +26 -0
- package/dist/checks/runtime/missing-public-env-import.d.ts.map +1 -0
- package/dist/checks/runtime/missing-public-env-import.js +175 -0
- package/dist/checks/runtime/missing-public-env-import.js.map +1 -0
- package/dist/checks/runtime/node-deprecations.d.ts +22 -0
- package/dist/checks/runtime/node-deprecations.d.ts.map +1 -0
- package/dist/checks/runtime/node-deprecations.js +157 -0
- package/dist/checks/runtime/node-deprecations.js.map +1 -0
- package/dist/checks/runtime/node25-compatibility.d.ts +28 -0
- package/dist/checks/runtime/node25-compatibility.d.ts.map +1 -0
- package/dist/checks/runtime/node25-compatibility.js +200 -0
- package/dist/checks/runtime/node25-compatibility.js.map +1 -0
- package/dist/checks/runtime/process-stdio-usage.d.ts +26 -0
- package/dist/checks/runtime/process-stdio-usage.d.ts.map +1 -0
- package/dist/checks/runtime/process-stdio-usage.js +179 -0
- package/dist/checks/runtime/process-stdio-usage.js.map +1 -0
- package/dist/checks/runtime/server-client-decimal.d.ts +25 -0
- package/dist/checks/runtime/server-client-decimal.d.ts.map +1 -0
- package/dist/checks/runtime/server-client-decimal.js +243 -0
- package/dist/checks/runtime/server-client-decimal.js.map +1 -0
- package/dist/checks/security/csrf-protection.d.ts +20 -0
- package/dist/checks/security/csrf-protection.d.ts.map +1 -0
- package/dist/checks/security/csrf-protection.js +249 -0
- package/dist/checks/security/csrf-protection.js.map +1 -0
- package/dist/checks/security/dependency-audit.d.ts +25 -0
- package/dist/checks/security/dependency-audit.d.ts.map +1 -0
- package/dist/checks/security/dependency-audit.js +219 -0
- package/dist/checks/security/dependency-audit.js.map +1 -0
- package/dist/checks/security/env-value-leakage.d.ts +21 -0
- package/dist/checks/security/env-value-leakage.d.ts.map +1 -0
- package/dist/checks/security/env-value-leakage.js +285 -0
- package/dist/checks/security/env-value-leakage.js.map +1 -0
- package/dist/checks/security/no-tracked-env-files.d.ts +18 -0
- package/dist/checks/security/no-tracked-env-files.d.ts.map +1 -0
- package/dist/checks/security/no-tracked-env-files.js +247 -0
- package/dist/checks/security/no-tracked-env-files.js.map +1 -0
- package/dist/checks/security/open-redirect-prevention.d.ts +19 -0
- package/dist/checks/security/open-redirect-prevention.d.ts.map +1 -0
- package/dist/checks/security/open-redirect-prevention.js +238 -0
- package/dist/checks/security/open-redirect-prevention.js.map +1 -0
- package/dist/checks/security/path-traversal-prevention.d.ts +25 -0
- package/dist/checks/security/path-traversal-prevention.d.ts.map +1 -0
- package/dist/checks/security/path-traversal-prevention.js +246 -0
- package/dist/checks/security/path-traversal-prevention.js.map +1 -0
- package/dist/checks/security/permission-security-validation.d.ts +19 -0
- package/dist/checks/security/permission-security-validation.d.ts.map +1 -0
- package/dist/checks/security/permission-security-validation.js +319 -0
- package/dist/checks/security/permission-security-validation.js.map +1 -0
- package/dist/checks/security/prod-command-detection.d.ts +17 -0
- package/dist/checks/security/prod-command-detection.d.ts.map +1 -0
- package/dist/checks/security/prod-command-detection.js +222 -0
- package/dist/checks/security/prod-command-detection.js.map +1 -0
- package/dist/checks/security/rate-limiting-validation.d.ts +19 -0
- package/dist/checks/security/rate-limiting-validation.d.ts.map +1 -0
- package/dist/checks/security/rate-limiting-validation.js +260 -0
- package/dist/checks/security/rate-limiting-validation.js.map +1 -0
- package/dist/checks/security/security-sla-enforcement.d.ts +34 -0
- package/dist/checks/security/security-sla-enforcement.d.ts.map +1 -0
- package/dist/checks/security/security-sla-enforcement.js +349 -0
- package/dist/checks/security/security-sla-enforcement.js.map +1 -0
- package/dist/checks/security/sensitive-data-exposure.d.ts +36 -0
- package/dist/checks/security/sensitive-data-exposure.d.ts.map +1 -0
- package/dist/checks/security/sensitive-data-exposure.js +540 -0
- package/dist/checks/security/sensitive-data-exposure.js.map +1 -0
- package/dist/checks/security/sql-injection-prevention.d.ts +25 -0
- package/dist/checks/security/sql-injection-prevention.d.ts.map +1 -0
- package/dist/checks/security/sql-injection-prevention.js +216 -0
- package/dist/checks/security/sql-injection-prevention.js.map +1 -0
- package/dist/checks/security/turnstile-scope-validation.d.ts +21 -0
- package/dist/checks/security/turnstile-scope-validation.d.ts.map +1 -0
- package/dist/checks/security/turnstile-scope-validation.js +237 -0
- package/dist/checks/security/turnstile-scope-validation.js.map +1 -0
- package/dist/checks/security/unvalidated-route-params.d.ts +28 -0
- package/dist/checks/security/unvalidated-route-params.d.ts.map +1 -0
- package/dist/checks/security/unvalidated-route-params.js +246 -0
- package/dist/checks/security/unvalidated-route-params.js.map +1 -0
- package/dist/checks/security/webhook-security-validation.d.ts +19 -0
- package/dist/checks/security/webhook-security-validation.d.ts.map +1 -0
- package/dist/checks/security/webhook-security-validation.js +258 -0
- package/dist/checks/security/webhook-security-validation.js.map +1 -0
- package/dist/checks/seo/missing-metadata.d.ts +26 -0
- package/dist/checks/seo/missing-metadata.d.ts.map +1 -0
- package/dist/checks/seo/missing-metadata.js +189 -0
- package/dist/checks/seo/missing-metadata.js.map +1 -0
- package/dist/checks/storage-keys-validation.d.ts +25 -0
- package/dist/checks/storage-keys-validation.d.ts.map +1 -0
- package/dist/checks/storage-keys-validation.js +312 -0
- package/dist/checks/storage-keys-validation.js.map +1 -0
- package/dist/checks/store-order-numbers.d.ts +19 -0
- package/dist/checks/store-order-numbers.d.ts.map +1 -0
- package/dist/checks/store-order-numbers.js +238 -0
- package/dist/checks/store-order-numbers.js.map +1 -0
- package/dist/checks/system/analyze-consolidation-candidates.d.ts +17 -0
- package/dist/checks/system/analyze-consolidation-candidates.d.ts.map +1 -0
- package/dist/checks/system/analyze-consolidation-candidates.js +221 -0
- package/dist/checks/system/analyze-consolidation-candidates.js.map +1 -0
- package/dist/checks/system/apply-universal-progress.d.ts +15 -0
- package/dist/checks/system/apply-universal-progress.d.ts.map +1 -0
- package/dist/checks/system/apply-universal-progress.js +292 -0
- package/dist/checks/system/apply-universal-progress.js.map +1 -0
- package/dist/checks/system/broken-preflight-detection.d.ts +30 -0
- package/dist/checks/system/broken-preflight-detection.d.ts.map +1 -0
- package/dist/checks/system/broken-preflight-detection.js +565 -0
- package/dist/checks/system/broken-preflight-detection.js.map +1 -0
- package/dist/checks/system/find-orphaned-preflights.d.ts +19 -0
- package/dist/checks/system/find-orphaned-preflights.d.ts.map +1 -0
- package/dist/checks/system/find-orphaned-preflights.js +157 -0
- package/dist/checks/system/find-orphaned-preflights.js.map +1 -0
- package/dist/checks/system/lint-preflight-consistency.d.ts +25 -0
- package/dist/checks/system/lint-preflight-consistency.d.ts.map +1 -0
- package/dist/checks/system/lint-preflight-consistency.js +374 -0
- package/dist/checks/system/lint-preflight-consistency.js.map +1 -0
- package/dist/checks/system/orphaned-scripts-detection.d.ts +24 -0
- package/dist/checks/system/orphaned-scripts-detection.d.ts.map +1 -0
- package/dist/checks/system/orphaned-scripts-detection.js +335 -0
- package/dist/checks/system/orphaned-scripts-detection.js.map +1 -0
- package/dist/checks/system/preflight-command-validation.d.ts +32 -0
- package/dist/checks/system/preflight-command-validation.d.ts.map +1 -0
- package/dist/checks/system/preflight-command-validation.js +631 -0
- package/dist/checks/system/preflight-command-validation.js.map +1 -0
- package/dist/checks/system/preflight-concurrency-support.d.ts +18 -0
- package/dist/checks/system/preflight-concurrency-support.d.ts.map +1 -0
- package/dist/checks/system/preflight-concurrency-support.js +207 -0
- package/dist/checks/system/preflight-concurrency-support.js.map +1 -0
- package/dist/checks/system/preflight-consolidation-safety.d.ts +16 -0
- package/dist/checks/system/preflight-consolidation-safety.d.ts.map +1 -0
- package/dist/checks/system/preflight-consolidation-safety.js +250 -0
- package/dist/checks/system/preflight-consolidation-safety.js.map +1 -0
- package/dist/checks/system/preflight-coverage-map.d.ts +26 -0
- package/dist/checks/system/preflight-coverage-map.d.ts.map +1 -0
- package/dist/checks/system/preflight-coverage-map.js +295 -0
- package/dist/checks/system/preflight-coverage-map.js.map +1 -0
- package/dist/checks/system/preflight-drift-detector.d.ts +28 -0
- package/dist/checks/system/preflight-drift-detector.d.ts.map +1 -0
- package/dist/checks/system/preflight-drift-detector.js +380 -0
- package/dist/checks/system/preflight-drift-detector.js.map +1 -0
- package/dist/checks/system/preflight-env-var-documentation.d.ts +25 -0
- package/dist/checks/system/preflight-env-var-documentation.d.ts.map +1 -0
- package/dist/checks/system/preflight-env-var-documentation.js +333 -0
- package/dist/checks/system/preflight-env-var-documentation.js.map +1 -0
- package/dist/checks/system/preflight-exit-code-validator.d.ts +30 -0
- package/dist/checks/system/preflight-exit-code-validator.d.ts.map +1 -0
- package/dist/checks/system/preflight-exit-code-validator.js +298 -0
- package/dist/checks/system/preflight-exit-code-validator.js.map +1 -0
- package/dist/checks/system/preflight-false-positive-tracker.d.ts +25 -0
- package/dist/checks/system/preflight-false-positive-tracker.d.ts.map +1 -0
- package/dist/checks/system/preflight-false-positive-tracker.js +262 -0
- package/dist/checks/system/preflight-false-positive-tracker.js.map +1 -0
- package/dist/checks/system/preflight-metadata-validator.d.ts +28 -0
- package/dist/checks/system/preflight-metadata-validator.d.ts.map +1 -0
- package/dist/checks/system/preflight-metadata-validator.js +220 -0
- package/dist/checks/system/preflight-metadata-validator.js.map +1 -0
- package/dist/checks/system/preflight-organization.d.ts +15 -0
- package/dist/checks/system/preflight-organization.d.ts.map +1 -0
- package/dist/checks/system/preflight-organization.js +212 -0
- package/dist/checks/system/preflight-organization.js.map +1 -0
- package/dist/checks/system/preflight-performance-optimizer.d.ts +17 -0
- package/dist/checks/system/preflight-performance-optimizer.d.ts.map +1 -0
- package/dist/checks/system/preflight-performance-optimizer.js +375 -0
- package/dist/checks/system/preflight-performance-optimizer.js.map +1 -0
- package/dist/checks/system/preflight-redundancy-detection.d.ts +28 -0
- package/dist/checks/system/preflight-redundancy-detection.d.ts.map +1 -0
- package/dist/checks/system/preflight-redundancy-detection.js +1168 -0
- package/dist/checks/system/preflight-redundancy-detection.js.map +1 -0
- package/dist/checks/system/preflight-reporting-standards.d.ts +17 -0
- package/dist/checks/system/preflight-reporting-standards.d.ts.map +1 -0
- package/dist/checks/system/preflight-reporting-standards.js +315 -0
- package/dist/checks/system/preflight-reporting-standards.js.map +1 -0
- package/dist/checks/system/preflight-runtime-health.d.ts +29 -0
- package/dist/checks/system/preflight-runtime-health.d.ts.map +1 -0
- package/dist/checks/system/preflight-runtime-health.js +346 -0
- package/dist/checks/system/preflight-runtime-health.js.map +1 -0
- package/dist/checks/system/preflight-schema-validator.d.ts +23 -0
- package/dist/checks/system/preflight-schema-validator.d.ts.map +1 -0
- package/dist/checks/system/preflight-schema-validator.js +322 -0
- package/dist/checks/system/preflight-schema-validator.js.map +1 -0
- package/dist/checks/system/preflight-test-coverage.d.ts +24 -0
- package/dist/checks/system/preflight-test-coverage.d.ts.map +1 -0
- package/dist/checks/system/preflight-test-coverage.js +242 -0
- package/dist/checks/system/preflight-test-coverage.js.map +1 -0
- package/dist/checks/system/script-path-validation.d.ts +30 -0
- package/dist/checks/system/script-path-validation.d.ts.map +1 -0
- package/dist/checks/system/script-path-validation.js +351 -0
- package/dist/checks/system/script-path-validation.js.map +1 -0
- package/dist/checks/system/stale-preflight-detection.d.ts +15 -0
- package/dist/checks/system/stale-preflight-detection.d.ts.map +1 -0
- package/dist/checks/system/stale-preflight-detection.js +200 -0
- package/dist/checks/system/stale-preflight-detection.js.map +1 -0
- package/dist/checks/system/universal-progress-reporter.d.ts +92 -0
- package/dist/checks/system/universal-progress-reporter.d.ts.map +1 -0
- package/dist/checks/system/universal-progress-reporter.js +272 -0
- package/dist/checks/system/universal-progress-reporter.js.map +1 -0
- package/dist/checks/tailwind/tailwind4-compatibility.d.ts +31 -0
- package/dist/checks/tailwind/tailwind4-compatibility.d.ts.map +1 -0
- package/dist/checks/tailwind/tailwind4-compatibility.js +490 -0
- package/dist/checks/tailwind/tailwind4-compatibility.js.map +1 -0
- package/dist/checks/tanstack/tanstack-query-compatibility.d.ts +31 -0
- package/dist/checks/tanstack/tanstack-query-compatibility.d.ts.map +1 -0
- package/dist/checks/tanstack/tanstack-query-compatibility.js +434 -0
- package/dist/checks/tanstack/tanstack-query-compatibility.js.map +1 -0
- package/dist/checks/ui/accessibility-critical.d.ts +18 -0
- package/dist/checks/ui/accessibility-critical.d.ts.map +1 -0
- package/dist/checks/ui/accessibility-critical.js +357 -0
- package/dist/checks/ui/accessibility-critical.js.map +1 -0
- package/dist/checks/ui/alert-button-gap.d.ts +26 -0
- package/dist/checks/ui/alert-button-gap.d.ts.map +1 -0
- package/dist/checks/ui/alert-button-gap.js +215 -0
- package/dist/checks/ui/alert-button-gap.js.map +1 -0
- package/dist/checks/ui/breadcrumb-consistency.d.ts +18 -0
- package/dist/checks/ui/breadcrumb-consistency.d.ts.map +1 -0
- package/dist/checks/ui/breadcrumb-consistency.js +237 -0
- package/dist/checks/ui/breadcrumb-consistency.js.map +1 -0
- package/dist/checks/ui/button-group-gap.d.ts +22 -0
- package/dist/checks/ui/button-group-gap.d.ts.map +1 -0
- package/dist/checks/ui/button-group-gap.js +194 -0
- package/dist/checks/ui/button-group-gap.js.map +1 -0
- package/dist/checks/ui/button-icon-prop.d.ts +40 -0
- package/dist/checks/ui/button-icon-prop.d.ts.map +1 -0
- package/dist/checks/ui/button-icon-prop.js +248 -0
- package/dist/checks/ui/button-icon-prop.js.map +1 -0
- package/dist/checks/ui/card-section-content-spacing.d.ts +31 -0
- package/dist/checks/ui/card-section-content-spacing.d.ts.map +1 -0
- package/dist/checks/ui/card-section-content-spacing.js +260 -0
- package/dist/checks/ui/card-section-content-spacing.js.map +1 -0
- package/dist/checks/ui/color-check.d.ts +7 -0
- package/dist/checks/ui/color-check.d.ts.map +1 -0
- package/dist/checks/ui/color-check.js +105 -0
- package/dist/checks/ui/color-check.js.map +1 -0
- package/dist/checks/ui/component-library-quality.d.ts +19 -0
- package/dist/checks/ui/component-library-quality.d.ts.map +1 -0
- package/dist/checks/ui/component-library-quality.js +231 -0
- package/dist/checks/ui/component-library-quality.js.map +1 -0
- package/dist/checks/ui/component-prop-validation.d.ts +22 -0
- package/dist/checks/ui/component-prop-validation.d.ts.map +1 -0
- package/dist/checks/ui/component-prop-validation.js +271 -0
- package/dist/checks/ui/component-prop-validation.js.map +1 -0
- package/dist/checks/ui/console-log-check.d.ts +7 -0
- package/dist/checks/ui/console-log-check.d.ts.map +1 -0
- package/dist/checks/ui/console-log-check.js +126 -0
- package/dist/checks/ui/console-log-check.js.map +1 -0
- package/dist/checks/ui/css-grid-gap-check.d.ts +24 -0
- package/dist/checks/ui/css-grid-gap-check.d.ts.map +1 -0
- package/dist/checks/ui/css-grid-gap-check.js +314 -0
- package/dist/checks/ui/css-grid-gap-check.js.map +1 -0
- package/dist/checks/ui/css-token-syntax.d.ts +22 -0
- package/dist/checks/ui/css-token-syntax.d.ts.map +1 -0
- package/dist/checks/ui/css-token-syntax.js +386 -0
- package/dist/checks/ui/css-token-syntax.js.map +1 -0
- package/dist/checks/ui/dark-mode-support.d.ts +95 -0
- package/dist/checks/ui/dark-mode-support.d.ts.map +1 -0
- package/dist/checks/ui/dark-mode-support.js +702 -0
- package/dist/checks/ui/dark-mode-support.js.map +1 -0
- package/dist/checks/ui/dashboard-section-patterns.d.ts +85 -0
- package/dist/checks/ui/dashboard-section-patterns.d.ts.map +1 -0
- package/dist/checks/ui/dashboard-section-patterns.js +1751 -0
- package/dist/checks/ui/dashboard-section-patterns.js.map +1 -0
- package/dist/checks/ui/dashboard-ui.d.ts +28 -0
- package/dist/checks/ui/dashboard-ui.d.ts.map +1 -0
- package/dist/checks/ui/dashboard-ui.js +503 -0
- package/dist/checks/ui/dashboard-ui.js.map +1 -0
- package/dist/checks/ui/dead-action-detector.d.ts +24 -0
- package/dist/checks/ui/dead-action-detector.d.ts.map +1 -0
- package/dist/checks/ui/dead-action-detector.js +457 -0
- package/dist/checks/ui/dead-action-detector.js.map +1 -0
- package/dist/checks/ui/doubled-padding-check.d.ts +21 -0
- package/dist/checks/ui/doubled-padding-check.d.ts.map +1 -0
- package/dist/checks/ui/doubled-padding-check.js +233 -0
- package/dist/checks/ui/doubled-padding-check.js.map +1 -0
- package/dist/checks/ui/dropdown-positioning-check.d.ts +26 -0
- package/dist/checks/ui/dropdown-positioning-check.d.ts.map +1 -0
- package/dist/checks/ui/dropdown-positioning-check.js +283 -0
- package/dist/checks/ui/dropdown-positioning-check.js.map +1 -0
- package/dist/checks/ui/feature-page-hero-consistency.d.ts +29 -0
- package/dist/checks/ui/feature-page-hero-consistency.d.ts.map +1 -0
- package/dist/checks/ui/feature-page-hero-consistency.js +228 -0
- package/dist/checks/ui/feature-page-hero-consistency.js.map +1 -0
- package/dist/checks/ui/filter-loading-states.d.ts +19 -0
- package/dist/checks/ui/filter-loading-states.d.ts.map +1 -0
- package/dist/checks/ui/filter-loading-states.js +193 -0
- package/dist/checks/ui/filter-loading-states.js.map +1 -0
- package/dist/checks/ui/flex-icon-text-gap.d.ts +30 -0
- package/dist/checks/ui/flex-icon-text-gap.d.ts.map +1 -0
- package/dist/checks/ui/flex-icon-text-gap.js +371 -0
- package/dist/checks/ui/flex-icon-text-gap.js.map +1 -0
- package/dist/checks/ui/form-control-layout-check.d.ts +30 -0
- package/dist/checks/ui/form-control-layout-check.d.ts.map +1 -0
- package/dist/checks/ui/form-control-layout-check.js +287 -0
- package/dist/checks/ui/form-control-layout-check.js.map +1 -0
- package/dist/checks/ui/form-field-consistency.d.ts +29 -0
- package/dist/checks/ui/form-field-consistency.d.ts.map +1 -0
- package/dist/checks/ui/form-field-consistency.js +270 -0
- package/dist/checks/ui/form-field-consistency.js.map +1 -0
- package/dist/checks/ui/gap-spacing-consistency.d.ts +35 -0
- package/dist/checks/ui/gap-spacing-consistency.d.ts.map +1 -0
- package/dist/checks/ui/gap-spacing-consistency.js +316 -0
- package/dist/checks/ui/gap-spacing-consistency.js.map +1 -0
- package/dist/checks/ui/header-action-text-color.d.ts +19 -0
- package/dist/checks/ui/header-action-text-color.d.ts.map +1 -0
- package/dist/checks/ui/header-action-text-color.js +122 -0
- package/dist/checks/ui/header-action-text-color.js.map +1 -0
- package/dist/checks/ui/header-vertical-alignment.d.ts +33 -0
- package/dist/checks/ui/header-vertical-alignment.d.ts.map +1 -0
- package/dist/checks/ui/header-vertical-alignment.js +205 -0
- package/dist/checks/ui/header-vertical-alignment.js.map +1 -0
- package/dist/checks/ui/image-component-check.d.ts +7 -0
- package/dist/checks/ui/image-component-check.d.ts.map +1 -0
- package/dist/checks/ui/image-component-check.js +92 -0
- package/dist/checks/ui/image-component-check.js.map +1 -0
- package/dist/checks/ui/inline-flex-gap-check.d.ts +26 -0
- package/dist/checks/ui/inline-flex-gap-check.d.ts.map +1 -0
- package/dist/checks/ui/inline-flex-gap-check.js +196 -0
- package/dist/checks/ui/inline-flex-gap-check.js.map +1 -0
- package/dist/checks/ui/inline-to-tailwind-check.d.ts +47 -0
- package/dist/checks/ui/inline-to-tailwind-check.d.ts.map +1 -0
- package/dist/checks/ui/inline-to-tailwind-check.js +329 -0
- package/dist/checks/ui/inline-to-tailwind-check.js.map +1 -0
- package/dist/checks/ui/input-label-gap.d.ts +34 -0
- package/dist/checks/ui/input-label-gap.d.ts.map +1 -0
- package/dist/checks/ui/input-label-gap.js +347 -0
- package/dist/checks/ui/input-label-gap.js.map +1 -0
- package/dist/checks/ui/input-width-consistency.d.ts +53 -0
- package/dist/checks/ui/input-width-consistency.d.ts.map +1 -0
- package/dist/checks/ui/input-width-consistency.js +342 -0
- package/dist/checks/ui/input-width-consistency.js.map +1 -0
- package/dist/checks/ui/js-responsive-visibility.d.ts +31 -0
- package/dist/checks/ui/js-responsive-visibility.d.ts.map +1 -0
- package/dist/checks/ui/js-responsive-visibility.js +213 -0
- package/dist/checks/ui/js-responsive-visibility.js.map +1 -0
- package/dist/checks/ui/label-description-spacing.d.ts +30 -0
- package/dist/checks/ui/label-description-spacing.d.ts.map +1 -0
- package/dist/checks/ui/label-description-spacing.js +285 -0
- package/dist/checks/ui/label-description-spacing.js.map +1 -0
- package/dist/checks/ui/layout-shift-detection.d.ts +31 -0
- package/dist/checks/ui/layout-shift-detection.d.ts.map +1 -0
- package/dist/checks/ui/layout-shift-detection.js +398 -0
- package/dist/checks/ui/layout-shift-detection.js.map +1 -0
- package/dist/checks/ui/margin-in-gap-container.d.ts +25 -0
- package/dist/checks/ui/margin-in-gap-container.d.ts.map +1 -0
- package/dist/checks/ui/margin-in-gap-container.js +619 -0
- package/dist/checks/ui/margin-in-gap-container.js.map +1 -0
- package/dist/checks/ui/mega-menu-dropdown-position.d.ts +25 -0
- package/dist/checks/ui/mega-menu-dropdown-position.d.ts.map +1 -0
- package/dist/checks/ui/mega-menu-dropdown-position.js +230 -0
- package/dist/checks/ui/mega-menu-dropdown-position.js.map +1 -0
- package/dist/checks/ui/mega-menu-scrollbar-overlap.d.ts +24 -0
- package/dist/checks/ui/mega-menu-scrollbar-overlap.d.ts.map +1 -0
- package/dist/checks/ui/mega-menu-scrollbar-overlap.js +283 -0
- package/dist/checks/ui/mega-menu-scrollbar-overlap.js.map +1 -0
- package/dist/checks/ui/mega-menu-spacing-check.d.ts +21 -0
- package/dist/checks/ui/mega-menu-spacing-check.d.ts.map +1 -0
- package/dist/checks/ui/mega-menu-spacing-check.js +244 -0
- package/dist/checks/ui/mega-menu-spacing-check.js.map +1 -0
- package/dist/checks/ui/notification-feedback-check.d.ts +37 -0
- package/dist/checks/ui/notification-feedback-check.d.ts.map +1 -0
- package/dist/checks/ui/notification-feedback-check.js +552 -0
- package/dist/checks/ui/notification-feedback-check.js.map +1 -0
- package/dist/checks/ui/overflow-clipping-detection.d.ts +17 -0
- package/dist/checks/ui/overflow-clipping-detection.d.ts.map +1 -0
- package/dist/checks/ui/overflow-clipping-detection.js +198 -0
- package/dist/checks/ui/overflow-clipping-detection.js.map +1 -0
- package/dist/checks/ui/page-layout-spacing.d.ts +29 -0
- package/dist/checks/ui/page-layout-spacing.d.ts.map +1 -0
- package/dist/checks/ui/page-layout-spacing.js +604 -0
- package/dist/checks/ui/page-layout-spacing.js.map +1 -0
- package/dist/checks/ui/path-alias-check.d.ts +7 -0
- package/dist/checks/ui/path-alias-check.d.ts.map +1 -0
- package/dist/checks/ui/path-alias-check.js +95 -0
- package/dist/checks/ui/path-alias-check.js.map +1 -0
- package/dist/checks/ui/product-image-animations.d.ts +70 -0
- package/dist/checks/ui/product-image-animations.d.ts.map +1 -0
- package/dist/checks/ui/product-image-animations.js +332 -0
- package/dist/checks/ui/product-image-animations.js.map +1 -0
- package/dist/checks/ui/search-width-consistency.d.ts +53 -0
- package/dist/checks/ui/search-width-consistency.d.ts.map +1 -0
- package/dist/checks/ui/search-width-consistency.js +276 -0
- package/dist/checks/ui/search-width-consistency.js.map +1 -0
- package/dist/checks/ui/section-spacing-check.d.ts +30 -0
- package/dist/checks/ui/section-spacing-check.d.ts.map +1 -0
- package/dist/checks/ui/section-spacing-check.js +248 -0
- package/dist/checks/ui/section-spacing-check.js.map +1 -0
- package/dist/checks/ui/sibling-spacing-check.d.ts +25 -0
- package/dist/checks/ui/sibling-spacing-check.d.ts.map +1 -0
- package/dist/checks/ui/sibling-spacing-check.js +329 -0
- package/dist/checks/ui/sibling-spacing-check.js.map +1 -0
- package/dist/checks/ui/sidebar-layout-gap.d.ts +34 -0
- package/dist/checks/ui/sidebar-layout-gap.d.ts.map +1 -0
- package/dist/checks/ui/sidebar-layout-gap.js +200 -0
- package/dist/checks/ui/sidebar-layout-gap.js.map +1 -0
- package/dist/checks/ui/skeleton-size-consistency.d.ts +50 -0
- package/dist/checks/ui/skeleton-size-consistency.d.ts.map +1 -0
- package/dist/checks/ui/skeleton-size-consistency.js +1239 -0
- package/dist/checks/ui/skeleton-size-consistency.js.map +1 -0
- package/dist/checks/ui/spacing-check.d.ts +7 -0
- package/dist/checks/ui/spacing-check.d.ts.map +1 -0
- package/dist/checks/ui/spacing-check.js +100 -0
- package/dist/checks/ui/spacing-check.js.map +1 -0
- package/dist/checks/ui/styling-standards.d.ts +71 -0
- package/dist/checks/ui/styling-standards.d.ts.map +1 -0
- package/dist/checks/ui/styling-standards.js +567 -0
- package/dist/checks/ui/styling-standards.js.map +1 -0
- package/dist/checks/ui/tailwind-consistency.d.ts +26 -0
- package/dist/checks/ui/tailwind-consistency.d.ts.map +1 -0
- package/dist/checks/ui/tailwind-consistency.js +345 -0
- package/dist/checks/ui/tailwind-consistency.js.map +1 -0
- package/dist/checks/ui/tailwind-contrast-check.d.ts +44 -0
- package/dist/checks/ui/tailwind-contrast-check.d.ts.map +1 -0
- package/dist/checks/ui/tailwind-contrast-check.js +457 -0
- package/dist/checks/ui/tailwind-contrast-check.js.map +1 -0
- package/dist/checks/ui/text-button-group-gap.d.ts +29 -0
- package/dist/checks/ui/text-button-group-gap.d.ts.map +1 -0
- package/dist/checks/ui/text-button-group-gap.js +242 -0
- package/dist/checks/ui/text-button-group-gap.js.map +1 -0
- package/dist/checks/ui/typography-check.d.ts +7 -0
- package/dist/checks/ui/typography-check.d.ts.map +1 -0
- package/dist/checks/ui/typography-check.js +114 -0
- package/dist/checks/ui/typography-check.js.map +1 -0
- package/dist/checks/ui/z-index-check.d.ts +25 -0
- package/dist/checks/ui/z-index-check.d.ts.map +1 -0
- package/dist/checks/ui/z-index-check.js +663 -0
- package/dist/checks/ui/z-index-check.js.map +1 -0
- package/dist/checks/zod/zod4-compatibility.d.ts +31 -0
- package/dist/checks/zod/zod4-compatibility.d.ts.map +1 -0
- package/dist/checks/zod/zod4-compatibility.js +412 -0
- package/dist/checks/zod/zod4-compatibility.js.map +1 -0
- package/dist/core/categories.d.ts +40 -0
- package/dist/core/categories.d.ts.map +1 -0
- package/dist/core/categories.js +153 -0
- package/dist/core/categories.js.map +1 -0
- package/dist/core/config.d.ts +87 -0
- package/dist/core/config.d.ts.map +1 -0
- package/dist/core/config.js +176 -0
- package/dist/core/config.js.map +1 -0
- package/dist/core/types.d.ts +194 -0
- package/dist/core/types.d.ts.map +1 -0
- package/dist/core/types.js +24 -0
- package/dist/core/types.js.map +1 -0
- package/dist/index.d.ts +37 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +207 -0
- package/dist/index.js.map +1 -0
- package/dist/runner.d.ts +33 -0
- package/dist/runner.d.ts.map +1 -0
- package/dist/runner.js +457 -0
- package/dist/runner.js.map +1 -0
- package/dist/shared/concurrency-config.d.ts +57 -0
- package/dist/shared/concurrency-config.d.ts.map +1 -0
- package/dist/shared/concurrency-config.js +128 -0
- package/dist/shared/concurrency-config.js.map +1 -0
- package/dist/shared/design-tokens-config.d.ts +140 -0
- package/dist/shared/design-tokens-config.d.ts.map +1 -0
- package/dist/shared/design-tokens-config.js +290 -0
- package/dist/shared/design-tokens-config.js.map +1 -0
- package/dist/shared/design-tokens.d.ts +771 -0
- package/dist/shared/design-tokens.d.ts.map +1 -0
- package/dist/shared/design-tokens.js +873 -0
- package/dist/shared/design-tokens.js.map +1 -0
- package/dist/shared/file-cache.d.ts +379 -0
- package/dist/shared/file-cache.d.ts.map +1 -0
- package/dist/shared/file-cache.js +744 -0
- package/dist/shared/file-cache.js.map +1 -0
- package/dist/shared/glob-patterns.d.ts +200 -0
- package/dist/shared/glob-patterns.d.ts.map +1 -0
- package/dist/shared/glob-patterns.js +291 -0
- package/dist/shared/glob-patterns.js.map +1 -0
- package/dist/shared/layout-constants.d.ts +101 -0
- package/dist/shared/layout-constants.d.ts.map +1 -0
- package/dist/shared/layout-constants.js +172 -0
- package/dist/shared/layout-constants.js.map +1 -0
- package/dist/utils/config-loader.d.ts +34 -0
- package/dist/utils/config-loader.d.ts.map +1 -0
- package/dist/utils/config-loader.js +169 -0
- package/dist/utils/config-loader.js.map +1 -0
- package/dist/utils/console-chars.d.ts +388 -0
- package/dist/utils/console-chars.d.ts.map +1 -0
- package/dist/utils/console-chars.js +378 -0
- package/dist/utils/console-chars.js.map +1 -0
- package/dist/utils/file-scanner.d.ts +73 -0
- package/dist/utils/file-scanner.d.ts.map +1 -0
- package/dist/utils/file-scanner.js +203 -0
- package/dist/utils/file-scanner.js.map +1 -0
- package/dist/utils/findings-writer.d.ts +32 -0
- package/dist/utils/findings-writer.d.ts.map +1 -0
- package/dist/utils/findings-writer.js +69 -0
- package/dist/utils/findings-writer.js.map +1 -0
- package/dist/utils/plugin-loader.d.ts +76 -0
- package/dist/utils/plugin-loader.d.ts.map +1 -0
- package/dist/utils/plugin-loader.js +235 -0
- package/dist/utils/plugin-loader.js.map +1 -0
- package/dist/utils/preflight-runner.d.ts +29 -0
- package/dist/utils/preflight-runner.d.ts.map +1 -0
- package/dist/utils/preflight-runner.js +131 -0
- package/dist/utils/preflight-runner.js.map +1 -0
- package/dist/utils/progress-reporter.d.ts +92 -0
- package/dist/utils/progress-reporter.d.ts.map +1 -0
- package/dist/utils/progress-reporter.js +272 -0
- package/dist/utils/progress-reporter.js.map +1 -0
- package/package.json +78 -0
- package/templates/domain-specific/trading-card-system/tcg-seed-validation.ts +197 -0
- package/templates/new-check.ts.template +205 -0
- package/templates/preflight.config.ts.template +103 -0
|
@@ -0,0 +1,1751 @@
|
|
|
1
|
+
#!/usr/bin/env tsx
|
|
2
|
+
"use strict";
|
|
3
|
+
/**
|
|
4
|
+
* Dashboard Section Patterns Preflight - IRON-CLAD UI ENFORCEMENT
|
|
5
|
+
*
|
|
6
|
+
* Enforces consistent UI patterns across /store, /admin, and /account pages:
|
|
7
|
+
*
|
|
8
|
+
* GOLD STANDARD PATTERN (use CardSection component):
|
|
9
|
+
* ```tsx
|
|
10
|
+
* <CardSection
|
|
11
|
+
* title="Section Title"
|
|
12
|
+
* headerActions={<Button>Action</Button>}
|
|
13
|
+
* >
|
|
14
|
+
* // Content here
|
|
15
|
+
* </CardSection>
|
|
16
|
+
* ```
|
|
17
|
+
*
|
|
18
|
+
* Or manual pattern (for custom layouts):
|
|
19
|
+
* ```tsx
|
|
20
|
+
* <Card>
|
|
21
|
+
* <CardContent className="p-0">
|
|
22
|
+
* <Box className="px-4 pt-3 pb-0 min-h-[44px] flex items-center justify-between">
|
|
23
|
+
* <Typography variant="h6" fontWeight="bold">Section Title</Typography>
|
|
24
|
+
* </Box>
|
|
25
|
+
* <Divider />
|
|
26
|
+
* <Box className="p-4 pt-2">
|
|
27
|
+
* // Content here
|
|
28
|
+
* </Box>
|
|
29
|
+
* </CardContent>
|
|
30
|
+
* </Card>
|
|
31
|
+
* ```
|
|
32
|
+
*
|
|
33
|
+
* Rules enforced (19 total):
|
|
34
|
+
*
|
|
35
|
+
* STRUCTURE:
|
|
36
|
+
* 1. CARD PATTERN: Dashboard sections MUST use CardSection or Card > CardContent(p-0) > Box + Divider pattern
|
|
37
|
+
* 2. NO SECTIONCARD: SectionCard should be replaced with CardSection component
|
|
38
|
+
* 3. HEADER SPACING: Card headers MUST use min-h-[44px] for consistent height
|
|
39
|
+
* 4. CONTENT PADDING: Content after Divider MUST use p-4 pt-2
|
|
40
|
+
* 5. MIN-HEIGHT: Manual patterns MUST include min-h-[44px] for header consistency
|
|
41
|
+
*
|
|
42
|
+
* CARDS & GRIDS:
|
|
43
|
+
* 6. CARD GRIDS: Nested card grids MUST use SectionCardGrid with gap-4
|
|
44
|
+
* 7. NESTED CARDS: Cards inside SectionCardGrid MUST have elevation >= 2
|
|
45
|
+
* 8. CARD ELEVATION: Cards should have explicit elevation prop
|
|
46
|
+
* 9. GRID GAPS: Card grids MUST have gap-4 for proper spacing
|
|
47
|
+
*
|
|
48
|
+
* COMPONENTS:
|
|
49
|
+
* 10. INFO BOXES: Stat boxes with icon+label+value MUST use InfoBox (with shadow)
|
|
50
|
+
* 11. NESTED BOXES: Content boxes with bg-secondary/tertiary MUST have shadow-sm
|
|
51
|
+
* 12. EMPTY STATES: Empty content MUST use UnifiedEmptyState
|
|
52
|
+
* 13. STATUSCHIP COLOR: StatusChip MUST have explicit color prop
|
|
53
|
+
*
|
|
54
|
+
* TYPOGRAPHY:
|
|
55
|
+
* 14. BOLD HEADERS: Section headers (h6) MUST have fontWeight="bold"
|
|
56
|
+
* 15. TYPOGRAPHY VARIANTS: Use h6 for sections, h5 for card titles, body1/body2 for content
|
|
57
|
+
*
|
|
58
|
+
* IMPORTS & TOKENS:
|
|
59
|
+
* 16. DIVIDER IMPORT: Divider must be imported when used
|
|
60
|
+
* 17. HARDCODED SPACING: No p-[16px] - use Tailwind tokens (p-4)
|
|
61
|
+
*
|
|
62
|
+
* STYLING:
|
|
63
|
+
* 18. CARD BACKGROUNDS: Must use bg-[var(--bg-primary)] not bg-card
|
|
64
|
+
* 19. INLINE BORDERS: Cards must NOT use inline style={{ border: ... }}
|
|
65
|
+
*
|
|
66
|
+
* Usage:
|
|
67
|
+
* pnpm preflight:dashboard-sections # Check only (BLOCKING)
|
|
68
|
+
* pnpm preflight:dashboard-sections --verbose # Show detailed output
|
|
69
|
+
* pnpm preflight:dashboard-sections --warn # Warning mode (non-blocking)
|
|
70
|
+
* pnpm preflight:dashboard-sections --fix # Auto-fix violations where possible
|
|
71
|
+
* pnpm preflight:dashboard-sections --adoption # Show CardSection adoption stats
|
|
72
|
+
*
|
|
73
|
+
* Features:
|
|
74
|
+
* - Auto-fix: Adds missing min-h-[44px] flex items-center to header boxes
|
|
75
|
+
* - Adoption tracking: Reports files using CardSection correctly
|
|
76
|
+
* - Fixable indicators: Shows which violations can be auto-fixed
|
|
77
|
+
*
|
|
78
|
+
* Why: Prevents UI drift, ensures polished consistent appearance like /store/billing
|
|
79
|
+
*/
|
|
80
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
81
|
+
if (k2 === undefined) k2 = k;
|
|
82
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
83
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
84
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
85
|
+
}
|
|
86
|
+
Object.defineProperty(o, k2, desc);
|
|
87
|
+
}) : (function(o, m, k, k2) {
|
|
88
|
+
if (k2 === undefined) k2 = k;
|
|
89
|
+
o[k2] = m[k];
|
|
90
|
+
}));
|
|
91
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
92
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
93
|
+
}) : function(o, v) {
|
|
94
|
+
o["default"] = v;
|
|
95
|
+
});
|
|
96
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
97
|
+
var ownKeys = function(o) {
|
|
98
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
99
|
+
var ar = [];
|
|
100
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
101
|
+
return ar;
|
|
102
|
+
};
|
|
103
|
+
return ownKeys(o);
|
|
104
|
+
};
|
|
105
|
+
return function (mod) {
|
|
106
|
+
if (mod && mod.__esModule) return mod;
|
|
107
|
+
var result = {};
|
|
108
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
109
|
+
__setModuleDefault(result, mod);
|
|
110
|
+
return result;
|
|
111
|
+
};
|
|
112
|
+
})();
|
|
113
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
114
|
+
exports.tags = exports.description = exports.blocking = exports.category = exports.name = exports.id = void 0;
|
|
115
|
+
const fs = __importStar(require("fs"));
|
|
116
|
+
const glob_1 = require("glob");
|
|
117
|
+
const console_chars_1 = require("../../utils/console-chars");
|
|
118
|
+
const glob_patterns_1 = require("../../shared/glob-patterns");
|
|
119
|
+
// Check metadata
|
|
120
|
+
exports.id = "ui/dashboard-section-patterns";
|
|
121
|
+
exports.name = "Dashboard Section Patterns";
|
|
122
|
+
exports.category = "ui";
|
|
123
|
+
exports.blocking = true;
|
|
124
|
+
exports.description = "Dashboard Section Patterns Preflight - IRON-CLAD UI ENFORCEMENT";
|
|
125
|
+
exports.tags = ["ui"];
|
|
126
|
+
// CONFIGURATION
|
|
127
|
+
// Dashboard page patterns to check
|
|
128
|
+
const DASHBOARD_PATHS = ["app/store/**/*.tsx", "app/admin/**/*.tsx", "app/account/**/*.tsx"];
|
|
129
|
+
const EXCLUDED = [
|
|
130
|
+
...glob_patterns_1.STANDARD_EXCLUDES,
|
|
131
|
+
"**/*.test.tsx",
|
|
132
|
+
"**/*.spec.tsx",
|
|
133
|
+
"**/components/**", // Don't check component definitions
|
|
134
|
+
"**/loading.tsx",
|
|
135
|
+
"**/error.tsx",
|
|
136
|
+
"**/layout.tsx",
|
|
137
|
+
];
|
|
138
|
+
// HELPER FUNCTIONS
|
|
139
|
+
/**
|
|
140
|
+
* Check if preflight-ignore comment exists within the previous N lines
|
|
141
|
+
* This allows for comments on separate lines or inline with JSX comments
|
|
142
|
+
*/
|
|
143
|
+
function hasPreflightIgnore(lines, lineIndex, lookback = 8) {
|
|
144
|
+
const startLine = Math.max(0, lineIndex - lookback);
|
|
145
|
+
for (let j = startLine; j <= lineIndex; j++) {
|
|
146
|
+
if (lines[j].includes("preflight-ignore")) {
|
|
147
|
+
return true;
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
return false;
|
|
151
|
+
}
|
|
152
|
+
// PATTERN DETECTORS
|
|
153
|
+
/**
|
|
154
|
+
* Detect inline section headers that should use CardSection
|
|
155
|
+
* Pattern: Card > CardContent > Typography h5/h6 as section header
|
|
156
|
+
*/
|
|
157
|
+
function detectInlineSectionHeaders(content, lines, file) {
|
|
158
|
+
const violations = [];
|
|
159
|
+
// Skip if already using CardSection or CardSectionHeader
|
|
160
|
+
if (content.includes("CardSection") || content.includes("CardSectionHeader")) {
|
|
161
|
+
return violations;
|
|
162
|
+
}
|
|
163
|
+
// Look for Typography h5/h6 with fontWeight inside CardContent
|
|
164
|
+
const sectionHeaderPattern = /Typography[^>]*variant=["'](h5|h6)["'][^>]*(?:fontWeight|font-semibold|font-bold)/g;
|
|
165
|
+
let inCard = false;
|
|
166
|
+
let inCardContent = false;
|
|
167
|
+
let cardDepth = 0;
|
|
168
|
+
let hasCorrectCardPattern = false; // Track if current card uses correct pattern
|
|
169
|
+
for (let i = 0; i < lines.length; i++) {
|
|
170
|
+
const line = lines[i];
|
|
171
|
+
// Track Card boundaries
|
|
172
|
+
if (/<Card[^>]*>/.test(line) || /<Card\s/.test(line)) {
|
|
173
|
+
inCard = true;
|
|
174
|
+
cardDepth++;
|
|
175
|
+
hasCorrectCardPattern = false; // Reset for new card
|
|
176
|
+
}
|
|
177
|
+
if (/<\/Card>/.test(line)) {
|
|
178
|
+
cardDepth--;
|
|
179
|
+
if (cardDepth <= 0) {
|
|
180
|
+
inCard = false;
|
|
181
|
+
inCardContent = false;
|
|
182
|
+
hasCorrectCardPattern = false;
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
// Track CardContent with p-0 (correct pattern)
|
|
186
|
+
if (/<CardContent[^>]*className=["'][^"']*p-0/.test(line)) {
|
|
187
|
+
inCardContent = true;
|
|
188
|
+
hasCorrectCardPattern = true; // This card uses the correct pattern
|
|
189
|
+
}
|
|
190
|
+
else if (/<CardContent/.test(line)) {
|
|
191
|
+
inCardContent = true;
|
|
192
|
+
}
|
|
193
|
+
if (/<\/CardContent>/.test(line)) {
|
|
194
|
+
inCardContent = false;
|
|
195
|
+
}
|
|
196
|
+
// Skip if using SectionCard already
|
|
197
|
+
if (content.includes("SectionCard"))
|
|
198
|
+
continue;
|
|
199
|
+
// Check for section header pattern inside Card
|
|
200
|
+
if (inCard && inCardContent && sectionHeaderPattern.test(line)) {
|
|
201
|
+
// Skip if this card already uses the correct CardContent p-0 pattern
|
|
202
|
+
if (hasCorrectCardPattern) {
|
|
203
|
+
sectionHeaderPattern.lastIndex = 0;
|
|
204
|
+
continue;
|
|
205
|
+
}
|
|
206
|
+
// Skip if this is a data value display (preceded by caption label)
|
|
207
|
+
const prevLines = lines.slice(Math.max(0, i - 3), i).join("\n");
|
|
208
|
+
const isDataValue = /variant=["']caption["']/.test(prevLines);
|
|
209
|
+
if (isDataValue) {
|
|
210
|
+
sectionHeaderPattern.lastIndex = 0;
|
|
211
|
+
continue;
|
|
212
|
+
}
|
|
213
|
+
// Check if this looks like a section header (followed by content)
|
|
214
|
+
const nextLines = lines.slice(i + 1, i + 10).join("\n");
|
|
215
|
+
const looksLikeSectionHeader = /marginBottom|mb-\d|gap-\d/.test(line) || /<(Box|div|Grid|Stack)/.test(nextLines);
|
|
216
|
+
if (looksLikeSectionHeader) {
|
|
217
|
+
// Check for preflight-ignore within previous 3 lines
|
|
218
|
+
if (hasPreflightIgnore(lines, i))
|
|
219
|
+
continue;
|
|
220
|
+
violations.push({
|
|
221
|
+
file,
|
|
222
|
+
line: i + 1,
|
|
223
|
+
rule: "section-header",
|
|
224
|
+
message: "Section header inside Card should use CardSection component",
|
|
225
|
+
suggestion: 'Replace Card + Typography header with <CardSection title="..." headerActions={...}>',
|
|
226
|
+
code: line.trim().substring(0, 80),
|
|
227
|
+
});
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
// Reset pattern lastIndex
|
|
231
|
+
sectionHeaderPattern.lastIndex = 0;
|
|
232
|
+
}
|
|
233
|
+
return violations;
|
|
234
|
+
}
|
|
235
|
+
/**
|
|
236
|
+
* Detect inline info boxes that should use InfoBox component
|
|
237
|
+
* Pattern: Box with icon + Typography caption + Typography value
|
|
238
|
+
*/
|
|
239
|
+
function detectInlineInfoBoxes(content, lines, file) {
|
|
240
|
+
const violations = [];
|
|
241
|
+
// Skip if already using InfoBox
|
|
242
|
+
if (content.includes("InfoBox"))
|
|
243
|
+
return violations;
|
|
244
|
+
// Look for the pattern: Box with textAlign center, icon, caption, value
|
|
245
|
+
const infoBoxPattern = /textAlign:\s*["']center["']/;
|
|
246
|
+
for (let i = 0; i < lines.length; i++) {
|
|
247
|
+
const line = lines[i];
|
|
248
|
+
if (infoBoxPattern.test(line) && /<Box/.test(line)) {
|
|
249
|
+
// Look ahead for icon + caption + value pattern
|
|
250
|
+
const nextLines = lines.slice(i, Math.min(i + 15, lines.length)).join("\n");
|
|
251
|
+
const hasIcon = /size=\{?\d+\}?/.test(nextLines) && /lucide-react|Icon/.test(content);
|
|
252
|
+
const hasCaption = /variant=["']caption["']/.test(nextLines);
|
|
253
|
+
const hasValue = /variant=["']body[12]?["'][^>]*fontWeight/.test(nextLines);
|
|
254
|
+
const hasBgTertiary = /bg-tertiary|bg-\[var\(--bg-tertiary\)\]/.test(nextLines);
|
|
255
|
+
if (hasIcon && hasCaption && hasValue && hasBgTertiary) {
|
|
256
|
+
// Check for preflight-ignore
|
|
257
|
+
const prevLine = i > 0 ? lines[i - 1] : "";
|
|
258
|
+
if (prevLine.includes("preflight-ignore"))
|
|
259
|
+
continue;
|
|
260
|
+
violations.push({
|
|
261
|
+
file,
|
|
262
|
+
line: i + 1,
|
|
263
|
+
rule: "info-box",
|
|
264
|
+
message: "Info box pattern (icon + label + value) should use InfoBox component",
|
|
265
|
+
suggestion: 'Replace with <InfoBox icon={...} label="..." value="..." />',
|
|
266
|
+
code: line.trim().substring(0, 60),
|
|
267
|
+
});
|
|
268
|
+
}
|
|
269
|
+
}
|
|
270
|
+
}
|
|
271
|
+
return violations;
|
|
272
|
+
}
|
|
273
|
+
/**
|
|
274
|
+
* Detect missing empty states
|
|
275
|
+
* Pattern: Conditional rendering with length === 0 without UnifiedEmptyState
|
|
276
|
+
*/
|
|
277
|
+
function detectMissingEmptyStates(content, lines, file) {
|
|
278
|
+
const violations = [];
|
|
279
|
+
// Look for length === 0 checks
|
|
280
|
+
const emptyCheckPattern = /\.length\s*===?\s*0/;
|
|
281
|
+
for (let i = 0; i < lines.length; i++) {
|
|
282
|
+
const line = lines[i];
|
|
283
|
+
if (emptyCheckPattern.test(line)) {
|
|
284
|
+
// Look ahead for what's rendered in the empty case
|
|
285
|
+
const nextLines = lines.slice(i, Math.min(i + 20, lines.length)).join("\n");
|
|
286
|
+
// Check if UnifiedEmptyState is used
|
|
287
|
+
if (nextLines.includes("UnifiedEmptyState"))
|
|
288
|
+
continue;
|
|
289
|
+
// Check if it's a simple text message without proper empty state
|
|
290
|
+
const hasSimpleText = /<Typography[^>]*>[^<]*no\s|empty|yet|appear/i.test(nextLines);
|
|
291
|
+
const hasNoEmptyState = !nextLines.includes("EmptyState");
|
|
292
|
+
if (hasSimpleText && hasNoEmptyState) {
|
|
293
|
+
// Check for preflight-ignore in previous line or within the next few lines (for JSX comments)
|
|
294
|
+
const prevLine = i > 0 ? lines[i - 1] : "";
|
|
295
|
+
if (prevLine.includes("preflight-ignore"))
|
|
296
|
+
continue;
|
|
297
|
+
if (nextLines.includes("preflight-ignore"))
|
|
298
|
+
continue;
|
|
299
|
+
violations.push({
|
|
300
|
+
file,
|
|
301
|
+
line: i + 1,
|
|
302
|
+
rule: "empty-state",
|
|
303
|
+
message: "Empty state should use UnifiedEmptyState component",
|
|
304
|
+
suggestion: 'Replace with <UnifiedEmptyState variant="..." action={{...}} />',
|
|
305
|
+
code: line.trim().substring(0, 60),
|
|
306
|
+
});
|
|
307
|
+
}
|
|
308
|
+
}
|
|
309
|
+
}
|
|
310
|
+
return violations;
|
|
311
|
+
}
|
|
312
|
+
/**
|
|
313
|
+
* Detect ad-hoc card grids that should use SectionCardGrid
|
|
314
|
+
* Pattern: Grid with Cards inside SectionCard or similar context
|
|
315
|
+
*/
|
|
316
|
+
function detectAdHocCardGrids(content, lines, file) {
|
|
317
|
+
const violations = [];
|
|
318
|
+
// Skip if already using SectionCardGrid
|
|
319
|
+
if (content.includes("SectionCardGrid"))
|
|
320
|
+
return violations;
|
|
321
|
+
// Look for grid patterns with nested Cards
|
|
322
|
+
const gridPattern = /gridTemplateColumns:\s*["']repeat\(auto-fit/;
|
|
323
|
+
for (let i = 0; i < lines.length; i++) {
|
|
324
|
+
const line = lines[i];
|
|
325
|
+
if (gridPattern.test(line)) {
|
|
326
|
+
// Look ahead for Card children
|
|
327
|
+
const nextLines = lines.slice(i, Math.min(i + 30, lines.length)).join("\n");
|
|
328
|
+
// Count Card occurrences
|
|
329
|
+
const cardMatches = nextLines.match(/<Card[^>]*>/g);
|
|
330
|
+
const hasMultipleCards = cardMatches && cardMatches.length >= 2;
|
|
331
|
+
if (hasMultipleCards) {
|
|
332
|
+
// Check for preflight-ignore
|
|
333
|
+
const prevLine = i > 0 ? lines[i - 1] : "";
|
|
334
|
+
if (prevLine.includes("preflight-ignore"))
|
|
335
|
+
continue;
|
|
336
|
+
violations.push({
|
|
337
|
+
file,
|
|
338
|
+
line: i + 1,
|
|
339
|
+
rule: "card-grid",
|
|
340
|
+
message: "Card grid should use SectionCardGrid for consistent spacing",
|
|
341
|
+
suggestion: "Replace inline grid with <SectionCardGrid columns={...}>",
|
|
342
|
+
code: line.trim().substring(0, 60),
|
|
343
|
+
});
|
|
344
|
+
}
|
|
345
|
+
}
|
|
346
|
+
}
|
|
347
|
+
return violations;
|
|
348
|
+
}
|
|
349
|
+
/**
|
|
350
|
+
* Detect incorrect background color usage in card-like components
|
|
351
|
+
* Pattern: bg-card instead of bg-[var(--bg-primary)]
|
|
352
|
+
*
|
|
353
|
+
* bg-card is a Tailwind default that may not resolve correctly with our CSS variables.
|
|
354
|
+
* All card backgrounds should use bg-[var(--bg-primary)] for consistent theming.
|
|
355
|
+
*/
|
|
356
|
+
function detectIncorrectCardBackground(content, lines, file) {
|
|
357
|
+
const violations = [];
|
|
358
|
+
// Look for bg-card usage (incorrect)
|
|
359
|
+
const bgCardPattern = /\bbg-card\b/;
|
|
360
|
+
for (let i = 0; i < lines.length; i++) {
|
|
361
|
+
const line = lines[i];
|
|
362
|
+
if (bgCardPattern.test(line)) {
|
|
363
|
+
// Check for preflight-ignore
|
|
364
|
+
const prevLine = i > 0 ? lines[i - 1] : "";
|
|
365
|
+
if (prevLine.includes("preflight-ignore"))
|
|
366
|
+
continue;
|
|
367
|
+
violations.push({
|
|
368
|
+
file,
|
|
369
|
+
line: i + 1,
|
|
370
|
+
rule: "card-background",
|
|
371
|
+
message: "Use bg-[var(--bg-primary)] instead of bg-card for consistent theming",
|
|
372
|
+
suggestion: "Replace bg-card with bg-[var(--bg-primary)]",
|
|
373
|
+
code: line.trim().substring(0, 80),
|
|
374
|
+
});
|
|
375
|
+
}
|
|
376
|
+
}
|
|
377
|
+
return violations;
|
|
378
|
+
}
|
|
379
|
+
/**
|
|
380
|
+
* Detect inline border styles on Card components
|
|
381
|
+
* Pattern: <Card style={{ border: ... }}> or style={{ ...border... }}
|
|
382
|
+
*
|
|
383
|
+
* Inline border styles cause inconsistency across pages. Cards should use:
|
|
384
|
+
* - variant="outlined" for bordered cards (uses CSS variable --border-color)
|
|
385
|
+
* - variant="elevation" for shadow-only cards (no border)
|
|
386
|
+
* - Tailwind classes like border-2 border-[var(--color-primary)] for special cases
|
|
387
|
+
*/
|
|
388
|
+
function detectInlineBorderStyles(content, lines, file) {
|
|
389
|
+
const violations = [];
|
|
390
|
+
// Look for Card components with inline border styles
|
|
391
|
+
let inCardTag = false;
|
|
392
|
+
let cardStartLine = 0;
|
|
393
|
+
let bracketDepth = 0;
|
|
394
|
+
for (let i = 0; i < lines.length; i++) {
|
|
395
|
+
const line = lines[i];
|
|
396
|
+
// Track Card tag opening
|
|
397
|
+
if (/<Card\b/.test(line)) {
|
|
398
|
+
inCardTag = true;
|
|
399
|
+
cardStartLine = i;
|
|
400
|
+
bracketDepth = 0;
|
|
401
|
+
}
|
|
402
|
+
// Track style prop with inline border
|
|
403
|
+
if (inCardTag) {
|
|
404
|
+
// Count brackets to track style object
|
|
405
|
+
bracketDepth += (line.match(/\{/g) || []).length;
|
|
406
|
+
bracketDepth -= (line.match(/\}/g) || []).length;
|
|
407
|
+
// Check for inline border in style prop
|
|
408
|
+
const hasInlineBorder = /style=\{?\{[^}]*\bborder\b[^}]*\}/.test(line) ||
|
|
409
|
+
/style=\{?\{[^}]*\bborderColor\b[^}]*\}/.test(line) ||
|
|
410
|
+
/style=\{?\{[^}]*\bborderWidth\b[^}]*\}/.test(line) ||
|
|
411
|
+
/style=\{?\{[^}]*\bborderStyle\b[^}]*\}/.test(line);
|
|
412
|
+
// Also check for border in multi-line style objects
|
|
413
|
+
const hasStyleProp = /style=\{/.test(lines.slice(cardStartLine, i + 1).join("\n"));
|
|
414
|
+
const hasBorderInStyle = hasStyleProp && /\bborder\s*:/.test(line);
|
|
415
|
+
if (hasInlineBorder || hasBorderInStyle) {
|
|
416
|
+
// Check for preflight-ignore
|
|
417
|
+
const prevLine = i > 0 ? lines[i - 1] : "";
|
|
418
|
+
if (prevLine.includes("preflight-ignore"))
|
|
419
|
+
continue;
|
|
420
|
+
violations.push({
|
|
421
|
+
file,
|
|
422
|
+
line: i + 1,
|
|
423
|
+
rule: "inline-border-style",
|
|
424
|
+
message: "Card components should not use inline border styles",
|
|
425
|
+
suggestion: 'Use variant="outlined" or Tailwind classes like border-2 border-[var(--color-primary)]',
|
|
426
|
+
code: line.trim().substring(0, 80),
|
|
427
|
+
});
|
|
428
|
+
}
|
|
429
|
+
// End of Card tag
|
|
430
|
+
if (/>/.test(line) && bracketDepth <= 0) {
|
|
431
|
+
inCardTag = false;
|
|
432
|
+
}
|
|
433
|
+
}
|
|
434
|
+
}
|
|
435
|
+
return violations;
|
|
436
|
+
}
|
|
437
|
+
/**
|
|
438
|
+
* Detect unwrapped section patterns (Typography h5/h6 header + card grid without wrapper)
|
|
439
|
+
* Pattern: Box/div containing Typography h5/h6 + grid with Cards, not wrapped in SectionCard/ContentSection
|
|
440
|
+
*
|
|
441
|
+
* Category sections like "Marketplace", "Shipping" etc. that have:
|
|
442
|
+
* - A Typography h5/h6 header
|
|
443
|
+
* - A description Typography
|
|
444
|
+
* - A grid of Cards
|
|
445
|
+
*
|
|
446
|
+
* These MUST be wrapped in either:
|
|
447
|
+
* - SectionCard (if you want the outer card wrapper)
|
|
448
|
+
* - ContentSection (if you just want the header pattern without outer card)
|
|
449
|
+
*/
|
|
450
|
+
function detectUnwrappedSectionPatterns(content, lines, file) {
|
|
451
|
+
const violations = [];
|
|
452
|
+
// Skip if already using SectionCard or ContentSection
|
|
453
|
+
if (content.includes("SectionCard") || content.includes("ContentSection")) {
|
|
454
|
+
return violations;
|
|
455
|
+
}
|
|
456
|
+
// Look for Typography h5/h6 that's NOT inside a Card (standalone section headers)
|
|
457
|
+
for (let i = 0; i < lines.length; i++) {
|
|
458
|
+
const line = lines[i];
|
|
459
|
+
// Check for Typography opening tag
|
|
460
|
+
if (!/<Typography\b/.test(line))
|
|
461
|
+
continue;
|
|
462
|
+
// Get the full Typography element (may span multiple lines)
|
|
463
|
+
let typographyBlock = line;
|
|
464
|
+
let endLine = i;
|
|
465
|
+
if (!/>/.test(line)) {
|
|
466
|
+
// Multi-line Typography tag - collect until we find the closing >
|
|
467
|
+
for (let j = i + 1; j < Math.min(i + 10, lines.length); j++) {
|
|
468
|
+
typographyBlock += "\n" + lines[j];
|
|
469
|
+
endLine = j;
|
|
470
|
+
if (/>/.test(lines[j]))
|
|
471
|
+
break;
|
|
472
|
+
}
|
|
473
|
+
}
|
|
474
|
+
// Check if this is an h5 or h6 variant
|
|
475
|
+
const isTypographyHeader = /variant=["'](h5|h6)["']/.test(typographyBlock);
|
|
476
|
+
if (!isTypographyHeader)
|
|
477
|
+
continue;
|
|
478
|
+
// Look backwards to see if we're inside a Card (if so, skip - different rule handles that)
|
|
479
|
+
let insideCard = false;
|
|
480
|
+
let cardDepth = 0;
|
|
481
|
+
for (let j = i - 1; j >= Math.max(0, i - 30); j--) {
|
|
482
|
+
if (/<\/Card>/.test(lines[j]))
|
|
483
|
+
cardDepth++;
|
|
484
|
+
if (/<Card\b/.test(lines[j])) {
|
|
485
|
+
if (cardDepth > 0) {
|
|
486
|
+
cardDepth--;
|
|
487
|
+
}
|
|
488
|
+
else {
|
|
489
|
+
insideCard = true;
|
|
490
|
+
break;
|
|
491
|
+
}
|
|
492
|
+
}
|
|
493
|
+
}
|
|
494
|
+
if (insideCard)
|
|
495
|
+
continue;
|
|
496
|
+
// Look ahead for a grid with Cards pattern (within 40 lines from end of Typography)
|
|
497
|
+
// Need larger window because Cards may be inside .map() calls
|
|
498
|
+
const searchStart = endLine + 1;
|
|
499
|
+
const nextLines = lines.slice(searchStart, Math.min(searchStart + 45, lines.length)).join("\n");
|
|
500
|
+
// Check for grid pattern
|
|
501
|
+
const hasGridPattern = /gridTemplateColumns|grid-cols-|className="[^"]*grid\s/.test(nextLines);
|
|
502
|
+
// Check for Cards - either direct <Card or inside .map() that renders Cards
|
|
503
|
+
const cardMatches = nextLines.match(/<Card\b/g);
|
|
504
|
+
const hasCards = cardMatches && cardMatches.length >= 1;
|
|
505
|
+
// Also detect .map() patterns that likely render Cards
|
|
506
|
+
const hasMapWithCards = /\.map\([^)]*\)\s*=>\s*\(?[\s\S]*<Card\b/.test(nextLines);
|
|
507
|
+
if (hasGridPattern && (hasCards || hasMapWithCards)) {
|
|
508
|
+
// Check for preflight-ignore
|
|
509
|
+
const prevLine = i > 0 ? lines[i - 1] : "";
|
|
510
|
+
if (prevLine.includes("preflight-ignore"))
|
|
511
|
+
continue;
|
|
512
|
+
// Check if parent is a Box or div (not SectionCard/ContentSection)
|
|
513
|
+
const parentContext = lines.slice(Math.max(0, i - 5), i).join("\n");
|
|
514
|
+
const isInPlainContainer = /<(Box|div)\b/.test(parentContext);
|
|
515
|
+
if (isInPlainContainer) {
|
|
516
|
+
violations.push({
|
|
517
|
+
file,
|
|
518
|
+
line: i + 1,
|
|
519
|
+
rule: "unwrapped-section",
|
|
520
|
+
message: "Section with header + card grid should use SectionCard or ContentSection",
|
|
521
|
+
suggestion: 'Wrap with <SectionCard title="..." subtitle="..."> or <ContentSection title="..." subtitle="...">',
|
|
522
|
+
code: line.trim().substring(0, 80),
|
|
523
|
+
});
|
|
524
|
+
}
|
|
525
|
+
}
|
|
526
|
+
}
|
|
527
|
+
return violations;
|
|
528
|
+
}
|
|
529
|
+
/**
|
|
530
|
+
* Detect default border classes on dashboard cards
|
|
531
|
+
* Pattern: border border-border or border-[var(--border-color)] without explicit variant="outlined"
|
|
532
|
+
*
|
|
533
|
+
* Dashboard cards should use shadow-only styling (like /store/listings) not borders.
|
|
534
|
+
* Borders should only be used for:
|
|
535
|
+
* - Highlighted/recommended items (e.g., border-2 border-[var(--color-primary)])
|
|
536
|
+
* - Explicit outlined variants
|
|
537
|
+
*/
|
|
538
|
+
function detectDefaultBorderClasses(content, lines, file) {
|
|
539
|
+
const violations = [];
|
|
540
|
+
// Skip component definition files - they define the patterns
|
|
541
|
+
if (file.includes("/components/shared/") || file.includes("/components/ui/")) {
|
|
542
|
+
return violations;
|
|
543
|
+
}
|
|
544
|
+
// Look for Card with border border-border or similar default border patterns
|
|
545
|
+
for (let i = 0; i < lines.length; i++) {
|
|
546
|
+
const line = lines[i];
|
|
547
|
+
// Check for Card with default border classes (not highlighted borders)
|
|
548
|
+
if (/<Card\b/.test(line)) {
|
|
549
|
+
// Look at this line and next few lines for className with border
|
|
550
|
+
const cardContext = lines.slice(i, Math.min(i + 5, lines.length)).join(" ");
|
|
551
|
+
// Check for default border patterns (not highlighted/primary borders)
|
|
552
|
+
const hasDefaultBorder = /className=[^>]*\bborder\s+border-border\b/.test(cardContext) ||
|
|
553
|
+
/className=[^>]*\bborder\s+border-\[var\(--border-color\)\]/.test(cardContext);
|
|
554
|
+
// Skip if it's a highlighted border (primary color, etc.)
|
|
555
|
+
const isHighlightedBorder = /border-\[var\(--color-primary\)\]/.test(cardContext) || /border-primary/.test(cardContext);
|
|
556
|
+
if (hasDefaultBorder && !isHighlightedBorder) {
|
|
557
|
+
// Check for preflight-ignore
|
|
558
|
+
const prevLine = i > 0 ? lines[i - 1] : "";
|
|
559
|
+
if (prevLine.includes("preflight-ignore"))
|
|
560
|
+
continue;
|
|
561
|
+
violations.push({
|
|
562
|
+
file,
|
|
563
|
+
line: i + 1,
|
|
564
|
+
rule: "default-border-class",
|
|
565
|
+
message: "Dashboard cards should use shadow-only styling, not default borders",
|
|
566
|
+
suggestion: "Remove 'border border-border' class - use shadow for card separation",
|
|
567
|
+
code: line.trim().substring(0, 80),
|
|
568
|
+
});
|
|
569
|
+
}
|
|
570
|
+
}
|
|
571
|
+
}
|
|
572
|
+
return violations;
|
|
573
|
+
}
|
|
574
|
+
/**
|
|
575
|
+
* Detect SectionCard usage that should be migrated to Card pattern
|
|
576
|
+
*
|
|
577
|
+
* GOLD STANDARD (from /store/disputes, /store/billing):
|
|
578
|
+
* ```tsx
|
|
579
|
+
* <Card>
|
|
580
|
+
* <CardContent className="p-0">
|
|
581
|
+
* <Box className="px-4 py-3">
|
|
582
|
+
* <Typography variant="h6" fontWeight="bold">Section Title</Typography>
|
|
583
|
+
* </Box>
|
|
584
|
+
* <Divider />
|
|
585
|
+
* // Content here
|
|
586
|
+
* </CardContent>
|
|
587
|
+
* </Card>
|
|
588
|
+
* ```
|
|
589
|
+
*
|
|
590
|
+
* SectionCard was a convenience wrapper but creates inconsistency.
|
|
591
|
+
* All dashboard sections should use the explicit Card pattern for uniformity.
|
|
592
|
+
*/
|
|
593
|
+
function detectSectionCardUsage(content, lines, file) {
|
|
594
|
+
const violations = [];
|
|
595
|
+
// Skip component definition files
|
|
596
|
+
if (file.includes("/components/shared/") || file.includes("/components/ui/")) {
|
|
597
|
+
return violations;
|
|
598
|
+
}
|
|
599
|
+
// Look for SectionCard usage
|
|
600
|
+
for (let i = 0; i < lines.length; i++) {
|
|
601
|
+
const line = lines[i];
|
|
602
|
+
if (/<SectionCard\b/.test(line)) {
|
|
603
|
+
// Check for preflight-ignore
|
|
604
|
+
const prevLine = i > 0 ? lines[i - 1] : "";
|
|
605
|
+
if (prevLine.includes("preflight-ignore"))
|
|
606
|
+
continue;
|
|
607
|
+
violations.push({
|
|
608
|
+
file,
|
|
609
|
+
line: i + 1,
|
|
610
|
+
rule: "sectioncard-usage",
|
|
611
|
+
message: "SectionCard should be replaced with Card > CardContent(p-0) > Box + Divider pattern",
|
|
612
|
+
suggestion: 'Use <Card><CardContent className="p-0"><Box className="px-4 py-3">...<Divider />',
|
|
613
|
+
code: line.trim().substring(0, 80),
|
|
614
|
+
});
|
|
615
|
+
}
|
|
616
|
+
}
|
|
617
|
+
return violations;
|
|
618
|
+
}
|
|
619
|
+
/**
|
|
620
|
+
* Detect missing Card pattern in dashboard pages
|
|
621
|
+
*
|
|
622
|
+
* GOLD STANDARD PATTERN (use CardSection component):
|
|
623
|
+
* ```tsx
|
|
624
|
+
* <CardSection
|
|
625
|
+
* title="Section Title"
|
|
626
|
+
* headerActions={<Button>Action</Button>}
|
|
627
|
+
* >
|
|
628
|
+
* {children}
|
|
629
|
+
* </CardSection>
|
|
630
|
+
* ```
|
|
631
|
+
*
|
|
632
|
+
* Or manual pattern:
|
|
633
|
+
* ```tsx
|
|
634
|
+
* <Card>
|
|
635
|
+
* <CardContent className="p-0">
|
|
636
|
+
* <Box className="px-4 pt-3 pb-0 min-h-[44px] flex items-center">
|
|
637
|
+
* <Typography variant="h6" fontWeight="bold">Section Title</Typography>
|
|
638
|
+
* </Box>
|
|
639
|
+
* <Divider />
|
|
640
|
+
* <Box className="p-4 pt-2">
|
|
641
|
+
* {children}
|
|
642
|
+
* </Box>
|
|
643
|
+
* </CardContent>
|
|
644
|
+
* </Card>
|
|
645
|
+
* ```
|
|
646
|
+
*
|
|
647
|
+
* Dashboard pages should use CardSection for consistent header heights.
|
|
648
|
+
* This checks for Typography h6 headers that are NOT inside the proper structure.
|
|
649
|
+
*/
|
|
650
|
+
function detectMissingCardPattern(content, lines, file) {
|
|
651
|
+
const violations = [];
|
|
652
|
+
// Skip if file doesn't have Typography h6 headers
|
|
653
|
+
if (!content.includes('variant="h6"') && !content.includes("variant='h6'")) {
|
|
654
|
+
return violations;
|
|
655
|
+
}
|
|
656
|
+
// Skip component definition files
|
|
657
|
+
if (file.includes("/components/shared/") || file.includes("/components/ui/")) {
|
|
658
|
+
return violations;
|
|
659
|
+
}
|
|
660
|
+
// Skip if already using CardSection
|
|
661
|
+
if (content.includes("CardSection")) {
|
|
662
|
+
return violations;
|
|
663
|
+
}
|
|
664
|
+
// Look for Typography h6 that's not in the proper Card > CardContent(p-0) > Box > Divider structure
|
|
665
|
+
for (let i = 0; i < lines.length; i++) {
|
|
666
|
+
const line = lines[i];
|
|
667
|
+
// Check for Typography h6 with fontWeight bold (section header pattern)
|
|
668
|
+
if (/<Typography[^>]*variant=["']h6["'][^>]*fontWeight/.test(line) ||
|
|
669
|
+
/<Typography[^>]*fontWeight[^>]*variant=["']h6["']/.test(line)) {
|
|
670
|
+
// Skip if this is a data value display (preceded by caption label)
|
|
671
|
+
const prevLines = lines.slice(Math.max(0, i - 3), i).join("\n");
|
|
672
|
+
const isDataValue = /variant=["']caption["']/.test(prevLines);
|
|
673
|
+
if (isDataValue)
|
|
674
|
+
continue;
|
|
675
|
+
// Look backwards to check if we're in the correct structure
|
|
676
|
+
const contextLines = lines.slice(Math.max(0, i - 10), i + 1).join("\n");
|
|
677
|
+
// Look forward to check for Divider after the header Box
|
|
678
|
+
const forwardLines = lines.slice(i, Math.min(i + 5, lines.length)).join("\n");
|
|
679
|
+
// Check for the gold standard pattern: CardContent with p-0 and Divider after header
|
|
680
|
+
const hasCorrectPattern = /CardContent[^>]*className=["'][^"']*p-0/.test(contextLines) &&
|
|
681
|
+
/<Divider/.test(forwardLines);
|
|
682
|
+
// Also check if inside SectionCard (will be caught by other rule)
|
|
683
|
+
const insideSectionCard = /SectionCard/.test(contextLines);
|
|
684
|
+
// Check for min-h-[44px] for consistent header height
|
|
685
|
+
const hasConsistentHeight = /min-h-\[44px\]/.test(contextLines);
|
|
686
|
+
if (!hasCorrectPattern && !insideSectionCard) {
|
|
687
|
+
// Check for preflight-ignore within previous 3 lines
|
|
688
|
+
if (hasPreflightIgnore(lines, i))
|
|
689
|
+
continue;
|
|
690
|
+
violations.push({
|
|
691
|
+
file,
|
|
692
|
+
line: i + 1,
|
|
693
|
+
rule: "missing-card-pattern",
|
|
694
|
+
message: "Section header should use CardSection component for consistent header heights",
|
|
695
|
+
suggestion: 'Use <CardSection title="..." headerActions={...}> or <CardSectionHeader title="..." />',
|
|
696
|
+
code: line.trim().substring(0, 80),
|
|
697
|
+
});
|
|
698
|
+
}
|
|
699
|
+
}
|
|
700
|
+
}
|
|
701
|
+
return violations;
|
|
702
|
+
}
|
|
703
|
+
/**
|
|
704
|
+
* Detect incorrect card header spacing
|
|
705
|
+
*
|
|
706
|
+
* GOLD STANDARD: Use CardSection component for consistent header heights
|
|
707
|
+
*
|
|
708
|
+
* If using manual pattern, header box should use:
|
|
709
|
+
* - px-4 pt-3 pb-0 for padding
|
|
710
|
+
* - min-h-[44px] for consistent height regardless of buttons
|
|
711
|
+
* - flex items-center for vertical centering
|
|
712
|
+
*
|
|
713
|
+
* Common mistakes:
|
|
714
|
+
* - py-2, py-3 (equal top/bottom padding looks unbalanced)
|
|
715
|
+
* - Missing min-h-[44px] (headers with buttons are taller)
|
|
716
|
+
* - Missing flex items-center (text not vertically centered)
|
|
717
|
+
*/
|
|
718
|
+
function detectIncorrectHeaderSpacing(content, lines, file) {
|
|
719
|
+
const violations = [];
|
|
720
|
+
// Skip component definition files
|
|
721
|
+
if (file.includes("/components/shared/") || file.includes("/components/ui/")) {
|
|
722
|
+
return violations;
|
|
723
|
+
}
|
|
724
|
+
// Skip if using CardSection (it handles this correctly)
|
|
725
|
+
if (content.includes("CardSection")) {
|
|
726
|
+
return violations;
|
|
727
|
+
}
|
|
728
|
+
// Look for Box elements that contain Typography h6 headers (section headers)
|
|
729
|
+
for (let i = 0; i < lines.length; i++) {
|
|
730
|
+
const line = lines[i];
|
|
731
|
+
// Check for Box with px-4 that's a header container
|
|
732
|
+
if (/<Box[^>]*className=["'][^"']*px-4/.test(line)) {
|
|
733
|
+
// Look ahead to see if this contains a Typography h6
|
|
734
|
+
const nextLines = lines.slice(i, Math.min(i + 5, lines.length)).join("\n");
|
|
735
|
+
const hasTypographyH6 = /<Typography[^>]*variant=["']h6["']/.test(nextLines);
|
|
736
|
+
if (hasTypographyH6) {
|
|
737
|
+
// Check if it has the correct spacing pattern
|
|
738
|
+
const hasCorrectSpacing = /pt-3\s+pb-0|pt-3[^p]*pb-0/.test(line);
|
|
739
|
+
const hasIncorrectPy = /\bpy-\d/.test(line); // py-X is incorrect for headers
|
|
740
|
+
const hasMinHeight = /min-h-\[44px\]/.test(line);
|
|
741
|
+
const hasFlexCenter = /flex[^"']*items-center/.test(line);
|
|
742
|
+
// Check if header has action buttons (needs consistent height)
|
|
743
|
+
const hasHeaderActions = /justify-between/.test(line) || /<Button/.test(nextLines);
|
|
744
|
+
if (!hasCorrectSpacing || hasIncorrectPy) {
|
|
745
|
+
// Check for preflight-ignore within previous 3 lines
|
|
746
|
+
if (hasPreflightIgnore(lines, i))
|
|
747
|
+
continue;
|
|
748
|
+
violations.push({
|
|
749
|
+
file,
|
|
750
|
+
line: i + 1,
|
|
751
|
+
rule: "header-spacing",
|
|
752
|
+
message: "Card header should use CardSection component for consistent heights",
|
|
753
|
+
suggestion: 'Use <CardSection title="..." headerActions={...}> or add min-h-[44px] flex items-center',
|
|
754
|
+
code: line.trim().substring(0, 80),
|
|
755
|
+
});
|
|
756
|
+
}
|
|
757
|
+
else if (hasHeaderActions && (!hasMinHeight || !hasFlexCenter)) {
|
|
758
|
+
// Header with actions but missing consistent height
|
|
759
|
+
if (hasPreflightIgnore(lines, i))
|
|
760
|
+
continue;
|
|
761
|
+
violations.push({
|
|
762
|
+
file,
|
|
763
|
+
line: i + 1,
|
|
764
|
+
rule: "header-height-inconsistent",
|
|
765
|
+
message: "Card header with actions needs min-h-[44px] for consistent height",
|
|
766
|
+
suggestion: 'Use <CardSection> or add className="px-4 pt-3 pb-0 min-h-[44px] flex items-center justify-between"',
|
|
767
|
+
code: line.trim().substring(0, 80),
|
|
768
|
+
});
|
|
769
|
+
}
|
|
770
|
+
}
|
|
771
|
+
}
|
|
772
|
+
}
|
|
773
|
+
return violations;
|
|
774
|
+
}
|
|
775
|
+
/**
|
|
776
|
+
* Detect nested boxes/cards missing shadow
|
|
777
|
+
*
|
|
778
|
+
* Nested content boxes (like "Listing Usage" stats box) should have shadow for depth.
|
|
779
|
+
* Pattern: Box with bg-[var(--bg-secondary)] or bg-[var(--bg-tertiary)] should have shadow-[var(--shadow-sm)]
|
|
780
|
+
*/
|
|
781
|
+
function detectMissingShadowOnNestedBoxes(content, lines, file) {
|
|
782
|
+
const violations = [];
|
|
783
|
+
// Skip component definition files
|
|
784
|
+
if (file.includes("/components/shared/") || file.includes("/components/ui/")) {
|
|
785
|
+
return violations;
|
|
786
|
+
}
|
|
787
|
+
// Look for Box elements with secondary/tertiary background
|
|
788
|
+
for (let i = 0; i < lines.length; i++) {
|
|
789
|
+
const line = lines[i];
|
|
790
|
+
// Check for Box with bg-secondary or bg-tertiary
|
|
791
|
+
const hasBgSecondary = /bg-\[var\(--bg-secondary\)\]/.test(line);
|
|
792
|
+
const hasBgTertiary = /bg-\[var\(--bg-tertiary\)\]/.test(line);
|
|
793
|
+
if ((hasBgSecondary || hasBgTertiary) && /<Box/.test(line)) {
|
|
794
|
+
// Check if it has shadow
|
|
795
|
+
const hasShadow = /shadow-\[var\(--shadow/.test(line);
|
|
796
|
+
// Check if it's a small inline element (skip those)
|
|
797
|
+
const isSmallElement = /w-\d|h-\d|size-\d/.test(line) && !/rounded-\[var\(--radius-lg\)\]/.test(line);
|
|
798
|
+
if (!hasShadow && !isSmallElement) {
|
|
799
|
+
// Look at context - is this a content box (has rounded corners, padding)?
|
|
800
|
+
const isContentBox = /rounded-\[var\(--radius/.test(line) && /\bp-\d/.test(line);
|
|
801
|
+
if (isContentBox) {
|
|
802
|
+
// Check for preflight-ignore
|
|
803
|
+
const prevLine = i > 0 ? lines[i - 1] : "";
|
|
804
|
+
if (prevLine.includes("preflight-ignore"))
|
|
805
|
+
continue;
|
|
806
|
+
violations.push({
|
|
807
|
+
file,
|
|
808
|
+
line: i + 1,
|
|
809
|
+
rule: "missing-shadow",
|
|
810
|
+
message: "Nested content boxes should have shadow for visual depth",
|
|
811
|
+
suggestion: "Add shadow-[var(--shadow-sm)] to the className",
|
|
812
|
+
code: line.trim().substring(0, 80),
|
|
813
|
+
});
|
|
814
|
+
}
|
|
815
|
+
}
|
|
816
|
+
}
|
|
817
|
+
}
|
|
818
|
+
return violations;
|
|
819
|
+
}
|
|
820
|
+
/**
|
|
821
|
+
* Detect card grids without proper gap spacing
|
|
822
|
+
*
|
|
823
|
+
* Card grids should use gap-4 (16px) for proper visual separation between cards.
|
|
824
|
+
* SectionCardGrid provides this automatically, but inline grids may miss it.
|
|
825
|
+
*/
|
|
826
|
+
function detectMissingGridGap(content, lines, file) {
|
|
827
|
+
const violations = [];
|
|
828
|
+
// Skip if using SectionCardGrid (it handles gaps correctly)
|
|
829
|
+
if (content.includes("SectionCardGrid"))
|
|
830
|
+
return violations;
|
|
831
|
+
// Skip component definition files
|
|
832
|
+
if (file.includes("/components/shared/") || file.includes("/components/ui/")) {
|
|
833
|
+
return violations;
|
|
834
|
+
}
|
|
835
|
+
// Look for grid patterns
|
|
836
|
+
for (let i = 0; i < lines.length; i++) {
|
|
837
|
+
const line = lines[i];
|
|
838
|
+
// Check for grid class
|
|
839
|
+
if (/className=["'][^"']*\bgrid\b/.test(line)) {
|
|
840
|
+
// Look ahead to see if this contains Cards
|
|
841
|
+
const nextLines = lines.slice(i, Math.min(i + 20, lines.length)).join("\n");
|
|
842
|
+
const hasCards = /<Card\b/.test(nextLines);
|
|
843
|
+
if (hasCards) {
|
|
844
|
+
// Check for proper gap
|
|
845
|
+
const hasGap4 = /\bgap-4\b/.test(line);
|
|
846
|
+
const hasGap3 = /\bgap-3\b/.test(line); // gap-3 is acceptable but gap-4 preferred
|
|
847
|
+
const hasNoGap = !/\bgap-\d/.test(line);
|
|
848
|
+
if (hasNoGap) {
|
|
849
|
+
// Check for preflight-ignore
|
|
850
|
+
const prevLine = i > 0 ? lines[i - 1] : "";
|
|
851
|
+
if (prevLine.includes("preflight-ignore"))
|
|
852
|
+
continue;
|
|
853
|
+
violations.push({
|
|
854
|
+
file,
|
|
855
|
+
line: i + 1,
|
|
856
|
+
rule: "missing-grid-gap",
|
|
857
|
+
message: "Card grids should have gap-4 for proper spacing between cards",
|
|
858
|
+
suggestion: "Add gap-4 to the grid className, or use SectionCardGrid component",
|
|
859
|
+
code: line.trim().substring(0, 80),
|
|
860
|
+
});
|
|
861
|
+
}
|
|
862
|
+
}
|
|
863
|
+
}
|
|
864
|
+
}
|
|
865
|
+
return violations;
|
|
866
|
+
}
|
|
867
|
+
/**
|
|
868
|
+
* Detect missing spacing between Box and SectionCardGrid siblings
|
|
869
|
+
*
|
|
870
|
+
* When a styled Box (like a stats/usage box) is followed by SectionCardGrid,
|
|
871
|
+
* there needs to be margin-top on the grid for visual separation.
|
|
872
|
+
* Additionally, mt and gap values should match for consistent spacing.
|
|
873
|
+
*
|
|
874
|
+
* Pattern: </Box> followed by <SectionCardGrid without mt-* class
|
|
875
|
+
* Pattern: SectionCardGrid with mt-4 but no gap-4 (inconsistent spacing)
|
|
876
|
+
*/
|
|
877
|
+
function detectBoxToSectionCardGridGap(content, lines, file) {
|
|
878
|
+
const violations = [];
|
|
879
|
+
// Only check files that use SectionCardGrid
|
|
880
|
+
if (!content.includes("SectionCardGrid"))
|
|
881
|
+
return violations;
|
|
882
|
+
// Skip component definition files
|
|
883
|
+
if (file.includes("/components/shared/") || file.includes("/components/ui/")) {
|
|
884
|
+
return violations;
|
|
885
|
+
}
|
|
886
|
+
for (let i = 0; i < lines.length; i++) {
|
|
887
|
+
const line = lines[i];
|
|
888
|
+
// Look for SectionCardGrid
|
|
889
|
+
if (/<SectionCardGrid/.test(line)) {
|
|
890
|
+
// Check for preflight-ignore
|
|
891
|
+
const prevLine = i > 0 ? lines[i - 1] : "";
|
|
892
|
+
if (prevLine.includes("preflight-ignore"))
|
|
893
|
+
continue;
|
|
894
|
+
// Extract mt value if present
|
|
895
|
+
const mtMatch = line.match(/\bmt-(\d+)/);
|
|
896
|
+
const hasMarginTop = mtMatch !== null || /\bmy-\d/.test(line);
|
|
897
|
+
// Check if it has a gap override
|
|
898
|
+
const gapMatch = line.match(/\bgap-(\d+)/);
|
|
899
|
+
// Look back to see if preceded by a closing Box tag (within 3 lines)
|
|
900
|
+
let foundClosingBox = false;
|
|
901
|
+
for (let j = i - 1; j >= Math.max(0, i - 3); j--) {
|
|
902
|
+
const prevContent = lines[j].trim();
|
|
903
|
+
// Skip empty lines and comments
|
|
904
|
+
if (prevContent === "" || prevContent.startsWith("//") || prevContent.startsWith("{/*"))
|
|
905
|
+
continue;
|
|
906
|
+
// Check for closing Box
|
|
907
|
+
if (/<\/Box>/.test(prevContent)) {
|
|
908
|
+
foundClosingBox = true;
|
|
909
|
+
break;
|
|
910
|
+
}
|
|
911
|
+
// If we hit something else, stop looking
|
|
912
|
+
if (prevContent.length > 0)
|
|
913
|
+
break;
|
|
914
|
+
}
|
|
915
|
+
if (foundClosingBox) {
|
|
916
|
+
if (!hasMarginTop) {
|
|
917
|
+
violations.push({
|
|
918
|
+
file,
|
|
919
|
+
line: i + 1,
|
|
920
|
+
rule: "box-to-sectioncardgrid-gap",
|
|
921
|
+
message: "SectionCardGrid after Box sibling needs mt-4 for visual separation",
|
|
922
|
+
suggestion: 'Add className="mt-4 gap-4" to SectionCardGrid for consistent spacing',
|
|
923
|
+
code: line.trim().substring(0, 80),
|
|
924
|
+
});
|
|
925
|
+
}
|
|
926
|
+
else if (mtMatch && !gapMatch) {
|
|
927
|
+
// Has mt but no gap override - spacing will be inconsistent
|
|
928
|
+
const mtValue = mtMatch[1];
|
|
929
|
+
violations.push({
|
|
930
|
+
file,
|
|
931
|
+
line: i + 1,
|
|
932
|
+
rule: "sectioncardgrid-inconsistent-spacing",
|
|
933
|
+
message: `SectionCardGrid has mt-${mtValue} but no matching gap-${mtValue} - horizontal/vertical spacing will differ`,
|
|
934
|
+
suggestion: `Add gap-${mtValue} to match mt-${mtValue} for consistent spacing in all directions`,
|
|
935
|
+
code: line.trim().substring(0, 80),
|
|
936
|
+
});
|
|
937
|
+
}
|
|
938
|
+
}
|
|
939
|
+
}
|
|
940
|
+
}
|
|
941
|
+
return violations;
|
|
942
|
+
}
|
|
943
|
+
/**
|
|
944
|
+
* Detect SectionCardGrid with large cards that need wider gap
|
|
945
|
+
*
|
|
946
|
+
* When SectionCardGrid contains full Card components (not InfoBox), the default
|
|
947
|
+
* gap-3 is too tight. Cards with CardContent, pricing, or plan details need gap-6.
|
|
948
|
+
*
|
|
949
|
+
* Pattern: SectionCardGrid containing <Card> elements without gap-4/gap-6 override
|
|
950
|
+
*/
|
|
951
|
+
function detectLargeCardGridTightGap(content, lines, file) {
|
|
952
|
+
const violations = [];
|
|
953
|
+
// Only check files that use SectionCardGrid
|
|
954
|
+
if (!content.includes("SectionCardGrid"))
|
|
955
|
+
return violations;
|
|
956
|
+
// Skip component definition files
|
|
957
|
+
if (file.includes("/components/shared/") || file.includes("/components/ui/")) {
|
|
958
|
+
return violations;
|
|
959
|
+
}
|
|
960
|
+
for (let i = 0; i < lines.length; i++) {
|
|
961
|
+
const line = lines[i];
|
|
962
|
+
// Look for SectionCardGrid
|
|
963
|
+
if (/<SectionCardGrid/.test(line)) {
|
|
964
|
+
// Check for preflight-ignore
|
|
965
|
+
const prevLine = i > 0 ? lines[i - 1] : "";
|
|
966
|
+
if (prevLine.includes("preflight-ignore"))
|
|
967
|
+
continue;
|
|
968
|
+
// Check if it already has a wider gap override
|
|
969
|
+
const hasWiderGap = /gap-[456789]|gap-1[0-9]/.test(line);
|
|
970
|
+
if (hasWiderGap)
|
|
971
|
+
continue;
|
|
972
|
+
// Look ahead to see if this contains full Card components (not just InfoBox)
|
|
973
|
+
const nextLines = lines.slice(i, Math.min(i + 30, lines.length)).join("\n");
|
|
974
|
+
const hasFullCards = /<Card\b/.test(nextLines) && /<CardContent/.test(nextLines);
|
|
975
|
+
const hasInfoBoxOnly = /<InfoBox/.test(nextLines) && !/<Card\b/.test(nextLines);
|
|
976
|
+
// If it has full Cards (not just InfoBox), it needs wider gap
|
|
977
|
+
if (hasFullCards && !hasInfoBoxOnly) {
|
|
978
|
+
violations.push({
|
|
979
|
+
file,
|
|
980
|
+
line: i + 1,
|
|
981
|
+
rule: "large-card-grid-tight-gap",
|
|
982
|
+
message: "SectionCardGrid with full Card components needs gap-6 for proper visual separation",
|
|
983
|
+
suggestion: 'Add className="gap-6" to SectionCardGrid when containing Card components with CardContent',
|
|
984
|
+
code: line.trim().substring(0, 80),
|
|
985
|
+
});
|
|
986
|
+
}
|
|
987
|
+
}
|
|
988
|
+
}
|
|
989
|
+
return violations;
|
|
990
|
+
}
|
|
991
|
+
/**
|
|
992
|
+
*
|
|
993
|
+
* Cards nested inside other cards (card-in-card pattern) need higher elevation
|
|
994
|
+
* for visual depth. Default elevation=1 is too subtle when nested.
|
|
995
|
+
*
|
|
996
|
+
* Pattern: Card inside SectionCardGrid or inside another Card should have elevation >= 2
|
|
997
|
+
*/
|
|
998
|
+
function detectNestedCardLowElevation(content, lines, file) {
|
|
999
|
+
const violations = [];
|
|
1000
|
+
// Skip component definition files
|
|
1001
|
+
if (file.includes("/components/shared/") || file.includes("/components/ui/")) {
|
|
1002
|
+
return violations;
|
|
1003
|
+
}
|
|
1004
|
+
// Skip if no SectionCardGrid (no nested card pattern)
|
|
1005
|
+
if (!content.includes("SectionCardGrid"))
|
|
1006
|
+
return violations;
|
|
1007
|
+
// Track if we're inside a SectionCardGrid
|
|
1008
|
+
let inSectionCardGrid = false;
|
|
1009
|
+
let gridDepth = 0;
|
|
1010
|
+
for (let i = 0; i < lines.length; i++) {
|
|
1011
|
+
const line = lines[i];
|
|
1012
|
+
// Track SectionCardGrid boundaries
|
|
1013
|
+
if (/<SectionCardGrid/.test(line)) {
|
|
1014
|
+
inSectionCardGrid = true;
|
|
1015
|
+
gridDepth++;
|
|
1016
|
+
}
|
|
1017
|
+
if (/<\/SectionCardGrid>/.test(line)) {
|
|
1018
|
+
gridDepth--;
|
|
1019
|
+
if (gridDepth <= 0) {
|
|
1020
|
+
inSectionCardGrid = false;
|
|
1021
|
+
}
|
|
1022
|
+
}
|
|
1023
|
+
// Check for Card inside SectionCardGrid
|
|
1024
|
+
if (inSectionCardGrid && /<Card\b/.test(line)) {
|
|
1025
|
+
// Get the full Card tag (may span multiple lines)
|
|
1026
|
+
let cardTag = line;
|
|
1027
|
+
let endLine = i;
|
|
1028
|
+
if (!/>/.test(line)) {
|
|
1029
|
+
for (let j = i + 1; j < Math.min(i + 5, lines.length); j++) {
|
|
1030
|
+
cardTag += " " + lines[j];
|
|
1031
|
+
endLine = j;
|
|
1032
|
+
if (/>/.test(lines[j]))
|
|
1033
|
+
break;
|
|
1034
|
+
}
|
|
1035
|
+
}
|
|
1036
|
+
// Check elevation - should be >= 2 for nested cards
|
|
1037
|
+
const elevationMatch = cardTag.match(/elevation=\{?(\d+)\}?/);
|
|
1038
|
+
const elevation = elevationMatch ? parseInt(elevationMatch[1], 10) : 1; // default is 1
|
|
1039
|
+
if (elevation < 2) {
|
|
1040
|
+
// Check for preflight-ignore
|
|
1041
|
+
const prevLine = i > 0 ? lines[i - 1] : "";
|
|
1042
|
+
if (prevLine.includes("preflight-ignore"))
|
|
1043
|
+
continue;
|
|
1044
|
+
violations.push({
|
|
1045
|
+
file,
|
|
1046
|
+
line: i + 1,
|
|
1047
|
+
rule: "nested-card-elevation",
|
|
1048
|
+
message: "Nested cards (card-in-card) should have elevation >= 2 for visual depth",
|
|
1049
|
+
suggestion: "Add elevation={2} or higher to the Card component",
|
|
1050
|
+
code: line.trim().substring(0, 80),
|
|
1051
|
+
});
|
|
1052
|
+
}
|
|
1053
|
+
}
|
|
1054
|
+
}
|
|
1055
|
+
return violations;
|
|
1056
|
+
}
|
|
1057
|
+
/**
|
|
1058
|
+
* Detect section headers without fontWeight="bold"
|
|
1059
|
+
*
|
|
1060
|
+
* Section headers (Typography h6 in card headers) should always be bold for consistency.
|
|
1061
|
+
*/
|
|
1062
|
+
function detectUnboldSectionHeaders(content, lines, file) {
|
|
1063
|
+
const violations = [];
|
|
1064
|
+
// Skip component definition files
|
|
1065
|
+
if (file.includes("/components/shared/") || file.includes("/components/ui/")) {
|
|
1066
|
+
return violations;
|
|
1067
|
+
}
|
|
1068
|
+
for (let i = 0; i < lines.length; i++) {
|
|
1069
|
+
const line = lines[i];
|
|
1070
|
+
// Check for Typography h6 that might be a section header
|
|
1071
|
+
if (/<Typography[^>]*variant=["']h6["']/.test(line)) {
|
|
1072
|
+
// Get the full Typography tag
|
|
1073
|
+
let typographyTag = line;
|
|
1074
|
+
if (!/>/.test(line)) {
|
|
1075
|
+
for (let j = i + 1; j < Math.min(i + 3, lines.length); j++) {
|
|
1076
|
+
typographyTag += " " + lines[j];
|
|
1077
|
+
if (/>/.test(lines[j]))
|
|
1078
|
+
break;
|
|
1079
|
+
}
|
|
1080
|
+
}
|
|
1081
|
+
// Check if it has fontWeight
|
|
1082
|
+
const hasFontWeight = /fontWeight/.test(typographyTag);
|
|
1083
|
+
const hasBoldClass = /font-bold|font-semibold/.test(typographyTag);
|
|
1084
|
+
if (!hasFontWeight && !hasBoldClass) {
|
|
1085
|
+
// Check context - is this inside a card header pattern?
|
|
1086
|
+
const contextLines = lines.slice(Math.max(0, i - 5), i).join("\n");
|
|
1087
|
+
const isInCardHeader = /CardContent[^>]*p-0|px-4\s+pt-3/.test(contextLines);
|
|
1088
|
+
if (isInCardHeader) {
|
|
1089
|
+
// Check for preflight-ignore
|
|
1090
|
+
const prevLine = i > 0 ? lines[i - 1] : "";
|
|
1091
|
+
if (prevLine.includes("preflight-ignore"))
|
|
1092
|
+
continue;
|
|
1093
|
+
violations.push({
|
|
1094
|
+
file,
|
|
1095
|
+
line: i + 1,
|
|
1096
|
+
rule: "unbold-section-header",
|
|
1097
|
+
message: 'Section headers (Typography h6) should have fontWeight="bold"',
|
|
1098
|
+
suggestion: 'Add fontWeight="bold" to the Typography component',
|
|
1099
|
+
code: line.trim().substring(0, 80),
|
|
1100
|
+
});
|
|
1101
|
+
}
|
|
1102
|
+
}
|
|
1103
|
+
}
|
|
1104
|
+
}
|
|
1105
|
+
return violations;
|
|
1106
|
+
}
|
|
1107
|
+
/**
|
|
1108
|
+
* Detect missing Divider import when Divider is used
|
|
1109
|
+
*
|
|
1110
|
+
* Prevents runtime errors from using <Divider /> without importing it.
|
|
1111
|
+
*/
|
|
1112
|
+
function detectMissingDividerImport(content, lines, file) {
|
|
1113
|
+
const violations = [];
|
|
1114
|
+
// Check if Divider is used
|
|
1115
|
+
const usesDivider = /<Divider\s*\/?>/.test(content);
|
|
1116
|
+
if (!usesDivider)
|
|
1117
|
+
return violations;
|
|
1118
|
+
// Check if Divider is imported
|
|
1119
|
+
const hasDividerImport = /import\s*\{[^}]*Divider[^}]*\}\s*from/.test(content);
|
|
1120
|
+
if (!hasDividerImport) {
|
|
1121
|
+
// Find the first usage of Divider
|
|
1122
|
+
for (let i = 0; i < lines.length; i++) {
|
|
1123
|
+
if (/<Divider\s*\/?>/.test(lines[i])) {
|
|
1124
|
+
violations.push({
|
|
1125
|
+
file,
|
|
1126
|
+
line: i + 1,
|
|
1127
|
+
rule: "missing-divider-import",
|
|
1128
|
+
message: "Divider is used but not imported - will cause runtime error",
|
|
1129
|
+
suggestion: 'Add Divider to imports: import { Divider } from "@/components/ui"',
|
|
1130
|
+
code: lines[i].trim().substring(0, 80),
|
|
1131
|
+
});
|
|
1132
|
+
break; // Only report once per file
|
|
1133
|
+
}
|
|
1134
|
+
}
|
|
1135
|
+
}
|
|
1136
|
+
return violations;
|
|
1137
|
+
}
|
|
1138
|
+
/**
|
|
1139
|
+
* Detect hardcoded spacing values instead of Tailwind tokens
|
|
1140
|
+
*
|
|
1141
|
+
* Catches patterns like p-[16px], gap-[12px], m-[8px] that should use
|
|
1142
|
+
* standard Tailwind classes like p-4, gap-3, m-2.
|
|
1143
|
+
*/
|
|
1144
|
+
function detectHardcodedSpacing(content, lines, file) {
|
|
1145
|
+
const violations = [];
|
|
1146
|
+
// Skip component definition files
|
|
1147
|
+
if (file.includes("/components/shared/") || file.includes("/components/ui/")) {
|
|
1148
|
+
return violations;
|
|
1149
|
+
}
|
|
1150
|
+
// Pattern for hardcoded pixel values in spacing classes
|
|
1151
|
+
const hardcodedPattern = /\b(p|px|py|pt|pb|pl|pr|m|mx|my|mt|mb|ml|mr|gap)-\[\d+px\]/g;
|
|
1152
|
+
for (let i = 0; i < lines.length; i++) {
|
|
1153
|
+
const line = lines[i];
|
|
1154
|
+
const matches = line.match(hardcodedPattern);
|
|
1155
|
+
if (matches) {
|
|
1156
|
+
// Check for preflight-ignore
|
|
1157
|
+
const prevLine = i > 0 ? lines[i - 1] : "";
|
|
1158
|
+
if (prevLine.includes("preflight-ignore"))
|
|
1159
|
+
continue;
|
|
1160
|
+
violations.push({
|
|
1161
|
+
file,
|
|
1162
|
+
line: i + 1,
|
|
1163
|
+
rule: "hardcoded-spacing",
|
|
1164
|
+
message: `Hardcoded spacing (${matches.join(", ")}) - use Tailwind tokens instead`,
|
|
1165
|
+
suggestion: "Use standard classes: p-4 (16px), p-3 (12px), p-2 (8px), gap-4, gap-3, etc.",
|
|
1166
|
+
code: line.trim().substring(0, 80),
|
|
1167
|
+
});
|
|
1168
|
+
}
|
|
1169
|
+
}
|
|
1170
|
+
return violations;
|
|
1171
|
+
}
|
|
1172
|
+
/**
|
|
1173
|
+
* Detect inconsistent content padding after Divider
|
|
1174
|
+
*
|
|
1175
|
+
* Content after Divider in card pattern should use p-4 pt-2 for consistency.
|
|
1176
|
+
*/
|
|
1177
|
+
function detectInconsistentContentPadding(content, lines, file) {
|
|
1178
|
+
const violations = [];
|
|
1179
|
+
// Skip component definition files
|
|
1180
|
+
if (file.includes("/components/shared/") || file.includes("/components/ui/")) {
|
|
1181
|
+
return violations;
|
|
1182
|
+
}
|
|
1183
|
+
// Skip if no Divider usage
|
|
1184
|
+
if (!content.includes("<Divider"))
|
|
1185
|
+
return violations;
|
|
1186
|
+
for (let i = 0; i < lines.length; i++) {
|
|
1187
|
+
const line = lines[i];
|
|
1188
|
+
// Check for Divider
|
|
1189
|
+
if (/<Divider\s*\/?>/.test(line)) {
|
|
1190
|
+
// Look at the next Box after Divider
|
|
1191
|
+
for (let j = i + 1; j < Math.min(i + 5, lines.length); j++) {
|
|
1192
|
+
const nextLine = lines[j];
|
|
1193
|
+
if (/<Box[^>]*className=/.test(nextLine)) {
|
|
1194
|
+
// Check if it has the correct padding pattern
|
|
1195
|
+
const hasCorrectPadding = /p-4\s+pt-2|p-4\s+pt-3/.test(nextLine);
|
|
1196
|
+
const hasP4Only = /\bp-4\b/.test(nextLine) && !/pt-\d/.test(nextLine);
|
|
1197
|
+
const hasOtherPadding = /\bp-[^4]|\bpt-[^23]/.test(nextLine);
|
|
1198
|
+
// Skip if it's an empty state or special container
|
|
1199
|
+
if (/UnifiedEmptyState|TableContainer/.test(lines.slice(j, j + 3).join("\n"))) {
|
|
1200
|
+
break;
|
|
1201
|
+
}
|
|
1202
|
+
if (hasP4Only || hasOtherPadding) {
|
|
1203
|
+
// Check for preflight-ignore
|
|
1204
|
+
const prevLine = j > 0 ? lines[j - 1] : "";
|
|
1205
|
+
if (prevLine.includes("preflight-ignore"))
|
|
1206
|
+
break;
|
|
1207
|
+
violations.push({
|
|
1208
|
+
file,
|
|
1209
|
+
line: j + 1,
|
|
1210
|
+
rule: "content-padding",
|
|
1211
|
+
message: "Content after Divider should use 'p-4 pt-2' for consistent spacing",
|
|
1212
|
+
suggestion: 'Change to className="p-4 pt-2" for proper content padding',
|
|
1213
|
+
code: nextLine.trim().substring(0, 80),
|
|
1214
|
+
});
|
|
1215
|
+
}
|
|
1216
|
+
break;
|
|
1217
|
+
}
|
|
1218
|
+
}
|
|
1219
|
+
}
|
|
1220
|
+
}
|
|
1221
|
+
return violations;
|
|
1222
|
+
}
|
|
1223
|
+
/**
|
|
1224
|
+
* Detect StatusChip without proper color prop
|
|
1225
|
+
*
|
|
1226
|
+
* StatusChip should always have an explicit color prop for consistency.
|
|
1227
|
+
*/
|
|
1228
|
+
function detectStatusChipWithoutColor(content, lines, file) {
|
|
1229
|
+
const violations = [];
|
|
1230
|
+
// Skip if no StatusChip usage
|
|
1231
|
+
if (!content.includes("StatusChip"))
|
|
1232
|
+
return violations;
|
|
1233
|
+
// Skip component definition files
|
|
1234
|
+
if (file.includes("/components/shared/") || file.includes("/components/ui/")) {
|
|
1235
|
+
return violations;
|
|
1236
|
+
}
|
|
1237
|
+
for (let i = 0; i < lines.length; i++) {
|
|
1238
|
+
const line = lines[i];
|
|
1239
|
+
if (/<StatusChip\b/.test(line)) {
|
|
1240
|
+
// Get the full StatusChip tag - look up to 15 lines for multi-line props
|
|
1241
|
+
let chipTag = line;
|
|
1242
|
+
let depth = 0; // Track nested JSX depth
|
|
1243
|
+
let foundEnd = false;
|
|
1244
|
+
// Check if StatusChip closes on same line (simple case)
|
|
1245
|
+
if (/<StatusChip[^>]*\/>/.test(line) ||
|
|
1246
|
+
(/<StatusChip[^>]*>/.test(line) && /<\/StatusChip>/.test(line))) {
|
|
1247
|
+
foundEnd = true;
|
|
1248
|
+
}
|
|
1249
|
+
if (!foundEnd) {
|
|
1250
|
+
// Count opening < and closing /> or > to track nesting
|
|
1251
|
+
for (let j = i; j < Math.min(i + 15, lines.length); j++) {
|
|
1252
|
+
const currentLine = j === i ? line : lines[j];
|
|
1253
|
+
chipTag += j === i ? "" : " " + currentLine;
|
|
1254
|
+
// Check for StatusChip self-closing tag (handles multi-line)
|
|
1255
|
+
if (j > i && /^\s*\/>/.test(currentLine)) {
|
|
1256
|
+
// This line starts with /> - likely closing the StatusChip
|
|
1257
|
+
foundEnd = true;
|
|
1258
|
+
break;
|
|
1259
|
+
}
|
|
1260
|
+
// Check for explicit </StatusChip> closing tag
|
|
1261
|
+
if (/<\/StatusChip>/.test(currentLine)) {
|
|
1262
|
+
foundEnd = true;
|
|
1263
|
+
break;
|
|
1264
|
+
}
|
|
1265
|
+
// Check if we have a complete self-closing StatusChip tag
|
|
1266
|
+
// by looking for /> that's not inside a nested component
|
|
1267
|
+
const tagSoFar = chipTag;
|
|
1268
|
+
// Remove nested self-closing tags (like <Icon />) to check if StatusChip is closed
|
|
1269
|
+
const withoutNestedSelfClosing = tagSoFar.replace(/<[A-Z][a-zA-Z]*[^>]*\/>/g, "");
|
|
1270
|
+
if (/<StatusChip[^>]*\/>/.test(withoutNestedSelfClosing)) {
|
|
1271
|
+
foundEnd = true;
|
|
1272
|
+
break;
|
|
1273
|
+
}
|
|
1274
|
+
}
|
|
1275
|
+
}
|
|
1276
|
+
// Check if it has color prop
|
|
1277
|
+
const hasColor = /\bcolor=/.test(chipTag);
|
|
1278
|
+
if (!hasColor) {
|
|
1279
|
+
// Check for preflight-ignore
|
|
1280
|
+
if (hasPreflightIgnore(lines, i))
|
|
1281
|
+
continue;
|
|
1282
|
+
violations.push({
|
|
1283
|
+
file,
|
|
1284
|
+
line: i + 1,
|
|
1285
|
+
rule: "statuschip-color",
|
|
1286
|
+
message: "StatusChip should have explicit color prop for consistency",
|
|
1287
|
+
suggestion: 'Add color="success" | "warning" | "error" | "info" | "default"',
|
|
1288
|
+
code: line.trim().substring(0, 80),
|
|
1289
|
+
});
|
|
1290
|
+
}
|
|
1291
|
+
}
|
|
1292
|
+
}
|
|
1293
|
+
return violations;
|
|
1294
|
+
}
|
|
1295
|
+
/**
|
|
1296
|
+
* Detect Card without explicit elevation in dashboard pages
|
|
1297
|
+
*
|
|
1298
|
+
* Cards in dashboard pages should have explicit elevation for clarity.
|
|
1299
|
+
*/
|
|
1300
|
+
function detectCardWithoutElevation(content, lines, file) {
|
|
1301
|
+
const violations = [];
|
|
1302
|
+
// Skip component definition files
|
|
1303
|
+
if (file.includes("/components/shared/") || file.includes("/components/ui/")) {
|
|
1304
|
+
return violations;
|
|
1305
|
+
}
|
|
1306
|
+
// Only check dashboard pages
|
|
1307
|
+
if (!file.includes("/store/") && !file.includes("/admin/") && !file.includes("/account/")) {
|
|
1308
|
+
return violations;
|
|
1309
|
+
}
|
|
1310
|
+
for (let i = 0; i < lines.length; i++) {
|
|
1311
|
+
const line = lines[i];
|
|
1312
|
+
if (/<Card\b/.test(line) && !/<Card\s*>/.test(line)) {
|
|
1313
|
+
// Get the full Card tag
|
|
1314
|
+
let cardTag = line;
|
|
1315
|
+
if (!/>/.test(line)) {
|
|
1316
|
+
for (let j = i + 1; j < Math.min(i + 5, lines.length); j++) {
|
|
1317
|
+
cardTag += " " + lines[j];
|
|
1318
|
+
if (/>/.test(lines[j]))
|
|
1319
|
+
break;
|
|
1320
|
+
}
|
|
1321
|
+
}
|
|
1322
|
+
// Check if it has elevation prop
|
|
1323
|
+
const hasElevation = /\belevation=/.test(cardTag);
|
|
1324
|
+
// Skip if it's a simple <Card> (section wrapper - uses default)
|
|
1325
|
+
if (/<Card\s*>/.test(cardTag))
|
|
1326
|
+
continue;
|
|
1327
|
+
if (!hasElevation) {
|
|
1328
|
+
// Check for preflight-ignore
|
|
1329
|
+
const prevLine = i > 0 ? lines[i - 1] : "";
|
|
1330
|
+
if (prevLine.includes("preflight-ignore"))
|
|
1331
|
+
continue;
|
|
1332
|
+
violations.push({
|
|
1333
|
+
file,
|
|
1334
|
+
line: i + 1,
|
|
1335
|
+
rule: "card-elevation",
|
|
1336
|
+
message: "Card should have explicit elevation prop for clarity",
|
|
1337
|
+
suggestion: "Add elevation={1} for default, elevation={2} for nested cards",
|
|
1338
|
+
code: line.trim().substring(0, 80),
|
|
1339
|
+
});
|
|
1340
|
+
}
|
|
1341
|
+
}
|
|
1342
|
+
}
|
|
1343
|
+
return violations;
|
|
1344
|
+
}
|
|
1345
|
+
/**
|
|
1346
|
+
* Detect Typography variant misuse
|
|
1347
|
+
*
|
|
1348
|
+
* - h6 should be used for section headers
|
|
1349
|
+
* - body1/body2 for content
|
|
1350
|
+
* - h5 for card titles within nested cards
|
|
1351
|
+
*/
|
|
1352
|
+
function detectTypographyVariantMisuse(content, lines, file) {
|
|
1353
|
+
const violations = [];
|
|
1354
|
+
// Skip component definition files
|
|
1355
|
+
if (file.includes("/components/shared/") || file.includes("/components/ui/")) {
|
|
1356
|
+
return violations;
|
|
1357
|
+
}
|
|
1358
|
+
for (let i = 0; i < lines.length; i++) {
|
|
1359
|
+
const line = lines[i];
|
|
1360
|
+
// Check for h1-h4 in dashboard pages (should typically be h5 or h6)
|
|
1361
|
+
if (/<Typography[^>]*variant=["'](h1|h2|h3|h4)["']/.test(line)) {
|
|
1362
|
+
// Check context - is this in a dashboard page?
|
|
1363
|
+
if (file.includes("/store/") || file.includes("/admin/") || file.includes("/account/")) {
|
|
1364
|
+
// Skip if it's in UnifiedHeader or page title context
|
|
1365
|
+
const contextLines = lines.slice(Math.max(0, i - 3), i).join("\n");
|
|
1366
|
+
if (/UnifiedHeader|PageHeader|page.*title/i.test(contextLines))
|
|
1367
|
+
continue;
|
|
1368
|
+
// Check for preflight-ignore
|
|
1369
|
+
const prevLine = i > 0 ? lines[i - 1] : "";
|
|
1370
|
+
if (prevLine.includes("preflight-ignore"))
|
|
1371
|
+
continue;
|
|
1372
|
+
const match = line.match(/variant=["'](h[1-4])["']/);
|
|
1373
|
+
violations.push({
|
|
1374
|
+
file,
|
|
1375
|
+
line: i + 1,
|
|
1376
|
+
rule: "typography-variant",
|
|
1377
|
+
message: `Typography ${match?.[1]} is unusual in dashboard - use h5/h6 for sections, body1/body2 for content`,
|
|
1378
|
+
suggestion: "Use h6 for section headers, h5 for card titles, body1/body2 for content",
|
|
1379
|
+
code: line.trim().substring(0, 80),
|
|
1380
|
+
});
|
|
1381
|
+
}
|
|
1382
|
+
}
|
|
1383
|
+
}
|
|
1384
|
+
return violations;
|
|
1385
|
+
}
|
|
1386
|
+
// ADOPTION TRACKING
|
|
1387
|
+
/**
|
|
1388
|
+
* Track CardSection adoption across files
|
|
1389
|
+
* Reports files that ARE using CardSection correctly (positive detection)
|
|
1390
|
+
*/
|
|
1391
|
+
function trackCardSectionAdoption(content, lines, file) {
|
|
1392
|
+
let cardSectionCount = 0;
|
|
1393
|
+
let cardSectionHeaderCount = 0;
|
|
1394
|
+
let manualPatternCount = 0;
|
|
1395
|
+
for (let i = 0; i < lines.length; i++) {
|
|
1396
|
+
const line = lines[i];
|
|
1397
|
+
// Count CardSection usage
|
|
1398
|
+
if (/<CardSection\b/.test(line)) {
|
|
1399
|
+
cardSectionCount++;
|
|
1400
|
+
}
|
|
1401
|
+
// Count CardSectionHeader usage
|
|
1402
|
+
if (/<CardSectionHeader\b/.test(line)) {
|
|
1403
|
+
cardSectionHeaderCount++;
|
|
1404
|
+
}
|
|
1405
|
+
// Count manual pattern usage (CardContent p-0 + min-h-[44px])
|
|
1406
|
+
if (/<CardContent[^>]*className=["'][^"']*p-0/.test(line)) {
|
|
1407
|
+
// Look ahead for min-h-[44px] pattern
|
|
1408
|
+
const nextLines = lines.slice(i, Math.min(i + 5, lines.length)).join("\n");
|
|
1409
|
+
if (/min-h-\[44px\]/.test(nextLines)) {
|
|
1410
|
+
manualPatternCount++;
|
|
1411
|
+
}
|
|
1412
|
+
}
|
|
1413
|
+
}
|
|
1414
|
+
if (cardSectionCount > 0 || cardSectionHeaderCount > 0 || manualPatternCount > 0) {
|
|
1415
|
+
return {
|
|
1416
|
+
file,
|
|
1417
|
+
cardSectionCount,
|
|
1418
|
+
cardSectionHeaderCount,
|
|
1419
|
+
manualPatternCount,
|
|
1420
|
+
};
|
|
1421
|
+
}
|
|
1422
|
+
return null;
|
|
1423
|
+
}
|
|
1424
|
+
// MISSING MIN-HEIGHT DETECTION
|
|
1425
|
+
/**
|
|
1426
|
+
* Detect manual card patterns missing min-h-[44px] for consistent header height
|
|
1427
|
+
*
|
|
1428
|
+
* Files using the manual pattern (CardContent p-0 + Divider) should still have
|
|
1429
|
+
* min-h-[44px] on the header Box for consistency with CardSection.
|
|
1430
|
+
*/
|
|
1431
|
+
function detectMissingMinHeight(content, lines, file) {
|
|
1432
|
+
const violations = [];
|
|
1433
|
+
// Skip component definition files
|
|
1434
|
+
if (file.includes("/components/shared/") || file.includes("/components/ui/")) {
|
|
1435
|
+
return violations;
|
|
1436
|
+
}
|
|
1437
|
+
// Skip if using CardSection (it handles this correctly)
|
|
1438
|
+
if (content.includes("CardSection")) {
|
|
1439
|
+
return violations;
|
|
1440
|
+
}
|
|
1441
|
+
// Only check files using the manual pattern
|
|
1442
|
+
if (!content.includes('className="p-0"') && !content.includes("className='p-0'")) {
|
|
1443
|
+
return violations;
|
|
1444
|
+
}
|
|
1445
|
+
let inCardContentP0 = false;
|
|
1446
|
+
for (let i = 0; i < lines.length; i++) {
|
|
1447
|
+
const line = lines[i];
|
|
1448
|
+
// Track CardContent with p-0
|
|
1449
|
+
if (/<CardContent[^>]*className=["'][^"']*p-0/.test(line)) {
|
|
1450
|
+
inCardContentP0 = true;
|
|
1451
|
+
}
|
|
1452
|
+
if (/<\/CardContent>/.test(line)) {
|
|
1453
|
+
inCardContentP0 = false;
|
|
1454
|
+
}
|
|
1455
|
+
// Check for header Box inside CardContent p-0
|
|
1456
|
+
if (inCardContentP0 && /<Box[^>]*className=["'][^"']*px-4[^"']*pt-3/.test(line)) {
|
|
1457
|
+
const hasMinHeight = /min-h-\[44px\]/.test(line);
|
|
1458
|
+
const hasFlexCenter = /flex[^"']*items-center/.test(line);
|
|
1459
|
+
// Look ahead to see if this has action buttons
|
|
1460
|
+
const nextLines = lines.slice(i, Math.min(i + 5, lines.length)).join("\n");
|
|
1461
|
+
const hasHeaderActions = /justify-between/.test(line) || /<Button/.test(nextLines);
|
|
1462
|
+
if (!hasMinHeight) {
|
|
1463
|
+
// Check for preflight-ignore
|
|
1464
|
+
if (hasPreflightIgnore(lines, i))
|
|
1465
|
+
continue;
|
|
1466
|
+
violations.push({
|
|
1467
|
+
file,
|
|
1468
|
+
line: i + 1,
|
|
1469
|
+
rule: "missing-min-height",
|
|
1470
|
+
message: "Manual card header pattern should include min-h-[44px] for consistent height",
|
|
1471
|
+
suggestion: hasHeaderActions
|
|
1472
|
+
? "Add min-h-[44px] flex items-center justify-between to the header Box className"
|
|
1473
|
+
: "Add min-h-[44px] flex items-center to the header Box className",
|
|
1474
|
+
code: line.trim().substring(0, 80),
|
|
1475
|
+
fixable: true,
|
|
1476
|
+
});
|
|
1477
|
+
}
|
|
1478
|
+
else if (hasHeaderActions && !hasFlexCenter) {
|
|
1479
|
+
// Has min-height but missing flex center
|
|
1480
|
+
if (hasPreflightIgnore(lines, i))
|
|
1481
|
+
continue;
|
|
1482
|
+
violations.push({
|
|
1483
|
+
file,
|
|
1484
|
+
line: i + 1,
|
|
1485
|
+
rule: "missing-flex-center",
|
|
1486
|
+
message: "Header with min-h-[44px] should also have flex items-center for vertical centering",
|
|
1487
|
+
suggestion: "Add flex items-center to the header Box className",
|
|
1488
|
+
code: line.trim().substring(0, 80),
|
|
1489
|
+
fixable: true,
|
|
1490
|
+
});
|
|
1491
|
+
}
|
|
1492
|
+
}
|
|
1493
|
+
}
|
|
1494
|
+
return violations;
|
|
1495
|
+
}
|
|
1496
|
+
// AUTO-FIX FUNCTIONS
|
|
1497
|
+
/**
|
|
1498
|
+
* Auto-fix simple Card patterns to use CardSection
|
|
1499
|
+
*
|
|
1500
|
+
* Converts:
|
|
1501
|
+
* ```tsx
|
|
1502
|
+
* <Card>
|
|
1503
|
+
* <CardContent className="p-0">
|
|
1504
|
+
* <Box className="px-4 pt-3 pb-0">
|
|
1505
|
+
* <Typography variant="h6" fontWeight="bold">Title</Typography>
|
|
1506
|
+
* </Box>
|
|
1507
|
+
* <Divider />
|
|
1508
|
+
* <Box className="p-4 pt-2">
|
|
1509
|
+
* {children}
|
|
1510
|
+
* </Box>
|
|
1511
|
+
* </CardContent>
|
|
1512
|
+
* </Card>
|
|
1513
|
+
* ```
|
|
1514
|
+
*
|
|
1515
|
+
* To:
|
|
1516
|
+
* ```tsx
|
|
1517
|
+
* <CardSection title="Title">
|
|
1518
|
+
* {children}
|
|
1519
|
+
* </CardSection>
|
|
1520
|
+
* ```
|
|
1521
|
+
*/
|
|
1522
|
+
function autoFixCardPatterns(file, content, lines) {
|
|
1523
|
+
const results = [];
|
|
1524
|
+
let modified = content;
|
|
1525
|
+
let fixCount = 0;
|
|
1526
|
+
// Pattern 1: Add missing min-h-[44px] to header boxes
|
|
1527
|
+
const headerBoxPattern = /(<Box[^>]*className=["'])([^"']*px-4[^"']*pt-3[^"']*pb-0)([^"']*["'])/g;
|
|
1528
|
+
modified = modified.replace(headerBoxPattern, (match, prefix, classes, suffix) => {
|
|
1529
|
+
// Skip if already has min-h-[44px]
|
|
1530
|
+
if (classes.includes("min-h-[44px]")) {
|
|
1531
|
+
return match;
|
|
1532
|
+
}
|
|
1533
|
+
// Add min-h-[44px] and flex items-center if not present
|
|
1534
|
+
let newClasses = classes;
|
|
1535
|
+
if (!newClasses.includes("min-h-[44px]")) {
|
|
1536
|
+
newClasses = newClasses.replace(/px-4/, "px-4 min-h-[44px]");
|
|
1537
|
+
}
|
|
1538
|
+
if (!newClasses.includes("flex")) {
|
|
1539
|
+
newClasses = newClasses.replace(/min-h-\[44px\]/, "min-h-[44px] flex items-center");
|
|
1540
|
+
}
|
|
1541
|
+
fixCount++;
|
|
1542
|
+
return prefix + newClasses + suffix;
|
|
1543
|
+
});
|
|
1544
|
+
// Pattern 2: Add CardSection import if not present and we made fixes
|
|
1545
|
+
if (fixCount > 0 && !modified.includes("CardSection")) {
|
|
1546
|
+
// Check if there's a shared import we can add to
|
|
1547
|
+
const sharedImportMatch = modified.match(/(import\s*\{[^}]*\}\s*from\s*["']@\/components\/shared["'];?)/);
|
|
1548
|
+
if (sharedImportMatch) {
|
|
1549
|
+
const existingImport = sharedImportMatch[1];
|
|
1550
|
+
// Add CardSection to existing import
|
|
1551
|
+
const newImport = existingImport.replace(/\}/, ", CardSection }");
|
|
1552
|
+
modified = modified.replace(existingImport, newImport);
|
|
1553
|
+
}
|
|
1554
|
+
}
|
|
1555
|
+
if (modified !== content) {
|
|
1556
|
+
fs.writeFileSync(file, modified, "utf8");
|
|
1557
|
+
results.push({
|
|
1558
|
+
file,
|
|
1559
|
+
line: 0,
|
|
1560
|
+
rule: "auto-fix",
|
|
1561
|
+
fixed: true,
|
|
1562
|
+
message: `Fixed ${fixCount} header box pattern(s) - added min-h-[44px] flex items-center`,
|
|
1563
|
+
});
|
|
1564
|
+
}
|
|
1565
|
+
return results;
|
|
1566
|
+
}
|
|
1567
|
+
/**
|
|
1568
|
+
* Add missing min-h-[44px] to header boxes
|
|
1569
|
+
*/
|
|
1570
|
+
function fixMissingMinHeight(file, content) {
|
|
1571
|
+
const results = [];
|
|
1572
|
+
let modified = content;
|
|
1573
|
+
let fixCount = 0;
|
|
1574
|
+
// Find header boxes with px-4 pt-3 pb-0 but missing min-h-[44px]
|
|
1575
|
+
const headerBoxPattern = /(<Box[^>]*className=["'])([^"']*px-4[^"']*pt-3[^"']*pb-0)([^"']*["'][^>]*>)/g;
|
|
1576
|
+
modified = modified.replace(headerBoxPattern, (match, prefix, classes, suffix) => {
|
|
1577
|
+
// Skip if already has min-h-[44px]
|
|
1578
|
+
if (classes.includes("min-h-[44px]")) {
|
|
1579
|
+
return match;
|
|
1580
|
+
}
|
|
1581
|
+
// Add min-h-[44px] flex items-center
|
|
1582
|
+
let newClasses = classes;
|
|
1583
|
+
// Insert after px-4
|
|
1584
|
+
if (!newClasses.includes("min-h-[44px]")) {
|
|
1585
|
+
newClasses = newClasses.replace(/px-4/, "px-4 min-h-[44px]");
|
|
1586
|
+
}
|
|
1587
|
+
// Add flex items-center if not present
|
|
1588
|
+
if (!newClasses.includes("flex")) {
|
|
1589
|
+
newClasses = newClasses.replace(/min-h-\[44px\]/, "min-h-[44px] flex items-center");
|
|
1590
|
+
}
|
|
1591
|
+
fixCount++;
|
|
1592
|
+
return prefix + newClasses + suffix;
|
|
1593
|
+
});
|
|
1594
|
+
if (modified !== content) {
|
|
1595
|
+
fs.writeFileSync(file, modified, "utf8");
|
|
1596
|
+
results.push({
|
|
1597
|
+
file,
|
|
1598
|
+
line: 0,
|
|
1599
|
+
rule: "missing-min-height",
|
|
1600
|
+
fixed: true,
|
|
1601
|
+
message: `Added min-h-[44px] flex items-center to ${fixCount} header box(es)`,
|
|
1602
|
+
});
|
|
1603
|
+
}
|
|
1604
|
+
return results;
|
|
1605
|
+
}
|
|
1606
|
+
// MAIN
|
|
1607
|
+
async function main() {
|
|
1608
|
+
const args = process.argv.slice(2);
|
|
1609
|
+
const verbose = args.includes("--verbose") || args.includes("-v");
|
|
1610
|
+
const warnOnly = args.includes("--warn");
|
|
1611
|
+
const showAdoption = args.includes("--adoption") || args.includes("-a");
|
|
1612
|
+
const autoFix = args.includes("--fix");
|
|
1613
|
+
console.log("\n[CHECK] DASHBOARD SECTION PATTERNS PREFLIGHT");
|
|
1614
|
+
console.log("=".repeat(70));
|
|
1615
|
+
console.log("Enforces consistent UI patterns across /store, /admin, /account pages");
|
|
1616
|
+
if (autoFix) {
|
|
1617
|
+
console.log("MODE: Auto-fix enabled - will attempt to fix violations");
|
|
1618
|
+
}
|
|
1619
|
+
console.log("=".repeat(70));
|
|
1620
|
+
const allViolations = [];
|
|
1621
|
+
const adoptionStats = [];
|
|
1622
|
+
const fixResults = [];
|
|
1623
|
+
// Get files from dashboard paths
|
|
1624
|
+
const files = [];
|
|
1625
|
+
for (const pattern of DASHBOARD_PATHS) {
|
|
1626
|
+
const matches = await (0, glob_1.glob)(pattern, { ignore: EXCLUDED });
|
|
1627
|
+
files.push(...matches);
|
|
1628
|
+
}
|
|
1629
|
+
console.log(`\nScanning ${files.length} dashboard page files...\n`);
|
|
1630
|
+
for (const file of files) {
|
|
1631
|
+
const content = fs.readFileSync(file, "utf8");
|
|
1632
|
+
const lines = content.split("\n");
|
|
1633
|
+
// Track adoption (positive detection)
|
|
1634
|
+
const adoption = trackCardSectionAdoption(content, lines, file);
|
|
1635
|
+
if (adoption) {
|
|
1636
|
+
adoptionStats.push(adoption);
|
|
1637
|
+
}
|
|
1638
|
+
// Run all pattern checks
|
|
1639
|
+
allViolations.push(...detectSectionCardUsage(content, lines, file));
|
|
1640
|
+
allViolations.push(...detectMissingCardPattern(content, lines, file));
|
|
1641
|
+
allViolations.push(...detectIncorrectHeaderSpacing(content, lines, file));
|
|
1642
|
+
allViolations.push(...detectMissingMinHeight(content, lines, file)); // NEW
|
|
1643
|
+
allViolations.push(...detectMissingShadowOnNestedBoxes(content, lines, file));
|
|
1644
|
+
allViolations.push(...detectMissingGridGap(content, lines, file));
|
|
1645
|
+
allViolations.push(...detectBoxToSectionCardGridGap(content, lines, file));
|
|
1646
|
+
allViolations.push(...detectLargeCardGridTightGap(content, lines, file));
|
|
1647
|
+
allViolations.push(...detectNestedCardLowElevation(content, lines, file));
|
|
1648
|
+
allViolations.push(...detectUnboldSectionHeaders(content, lines, file));
|
|
1649
|
+
allViolations.push(...detectMissingDividerImport(content, lines, file));
|
|
1650
|
+
allViolations.push(...detectHardcodedSpacing(content, lines, file));
|
|
1651
|
+
allViolations.push(...detectInconsistentContentPadding(content, lines, file));
|
|
1652
|
+
allViolations.push(...detectStatusChipWithoutColor(content, lines, file));
|
|
1653
|
+
allViolations.push(...detectCardWithoutElevation(content, lines, file));
|
|
1654
|
+
allViolations.push(...detectTypographyVariantMisuse(content, lines, file));
|
|
1655
|
+
allViolations.push(...detectInlineSectionHeaders(content, lines, file));
|
|
1656
|
+
allViolations.push(...detectInlineInfoBoxes(content, lines, file));
|
|
1657
|
+
allViolations.push(...detectMissingEmptyStates(content, lines, file));
|
|
1658
|
+
allViolations.push(...detectAdHocCardGrids(content, lines, file));
|
|
1659
|
+
allViolations.push(...detectIncorrectCardBackground(content, lines, file));
|
|
1660
|
+
allViolations.push(...detectInlineBorderStyles(content, lines, file));
|
|
1661
|
+
allViolations.push(...detectUnwrappedSectionPatterns(content, lines, file));
|
|
1662
|
+
// Auto-fix if enabled
|
|
1663
|
+
if (autoFix) {
|
|
1664
|
+
const freshContent = fs.readFileSync(file, "utf8");
|
|
1665
|
+
fixResults.push(...fixMissingMinHeight(file, freshContent));
|
|
1666
|
+
}
|
|
1667
|
+
}
|
|
1668
|
+
// Show adoption stats if requested
|
|
1669
|
+
if (showAdoption) {
|
|
1670
|
+
console.log("\n[ADOPTION] CardSection Usage Statistics");
|
|
1671
|
+
console.log("-".repeat(70));
|
|
1672
|
+
const totalCardSection = adoptionStats.reduce((sum, s) => sum + s.cardSectionCount, 0);
|
|
1673
|
+
const totalCardSectionHeader = adoptionStats.reduce((sum, s) => sum + s.cardSectionHeaderCount, 0);
|
|
1674
|
+
const totalManualPattern = adoptionStats.reduce((sum, s) => sum + s.manualPatternCount, 0);
|
|
1675
|
+
const filesUsingCardSection = adoptionStats.filter((s) => s.cardSectionCount > 0).length;
|
|
1676
|
+
const filesUsingManual = adoptionStats.filter((s) => s.manualPatternCount > 0 && s.cardSectionCount === 0).length;
|
|
1677
|
+
console.log(`\n CardSection component: ${totalCardSection} usages in ${filesUsingCardSection} files`);
|
|
1678
|
+
console.log(` CardSectionHeader: ${totalCardSectionHeader} usages`);
|
|
1679
|
+
console.log(` Manual pattern (p-0): ${totalManualPattern} usages in ${filesUsingManual} files`);
|
|
1680
|
+
console.log(` Total files with pattern: ${adoptionStats.length}`);
|
|
1681
|
+
if (verbose) {
|
|
1682
|
+
console.log("\n Files using CardSection:");
|
|
1683
|
+
for (const stat of adoptionStats.filter((s) => s.cardSectionCount > 0)) {
|
|
1684
|
+
console.log(` ${stat.file}: ${stat.cardSectionCount} CardSection, ${stat.cardSectionHeaderCount} CardSectionHeader`);
|
|
1685
|
+
}
|
|
1686
|
+
if (filesUsingManual > 0) {
|
|
1687
|
+
console.log("\n Files using manual pattern (candidates for migration):");
|
|
1688
|
+
for (const stat of adoptionStats.filter((s) => s.manualPatternCount > 0 && s.cardSectionCount === 0)) {
|
|
1689
|
+
console.log(` ${stat.file}: ${stat.manualPatternCount} manual pattern(s)`);
|
|
1690
|
+
}
|
|
1691
|
+
}
|
|
1692
|
+
}
|
|
1693
|
+
console.log("");
|
|
1694
|
+
}
|
|
1695
|
+
// Show fix results if auto-fix was enabled
|
|
1696
|
+
if (autoFix && fixResults.length > 0) {
|
|
1697
|
+
console.log("\n[FIX] Auto-fix Results");
|
|
1698
|
+
console.log("-".repeat(70));
|
|
1699
|
+
for (const result of fixResults) {
|
|
1700
|
+
console.log(` ${result.fixed ? `${console_chars_1.chars.check}` : `${console_chars_1.chars.cross}`} ${result.file}`);
|
|
1701
|
+
console.log(` ${result.message}`);
|
|
1702
|
+
}
|
|
1703
|
+
console.log("");
|
|
1704
|
+
}
|
|
1705
|
+
if (allViolations.length === 0) {
|
|
1706
|
+
console.log("[OK] All dashboard pages follow UI patterns correctly\n");
|
|
1707
|
+
process.exit(0);
|
|
1708
|
+
}
|
|
1709
|
+
// Group by rule
|
|
1710
|
+
const byRule = new Map();
|
|
1711
|
+
for (const v of allViolations) {
|
|
1712
|
+
const existing = byRule.get(v.rule) || [];
|
|
1713
|
+
existing.push(v);
|
|
1714
|
+
byRule.set(v.rule, existing);
|
|
1715
|
+
}
|
|
1716
|
+
// Count fixable violations
|
|
1717
|
+
const fixableCount = allViolations.filter((v) => v.fixable).length;
|
|
1718
|
+
console.log(`[${warnOnly ? "WARN" : "FAIL"}] Found ${allViolations.length} UI pattern violation(s)${fixableCount > 0 ? ` (${fixableCount} auto-fixable)` : ""}:\n`);
|
|
1719
|
+
for (const [rule, violations] of byRule) {
|
|
1720
|
+
const fixableInRule = violations.filter((v) => v.fixable).length;
|
|
1721
|
+
const fixableLabel = fixableInRule > 0 ? ` [${fixableInRule} fixable]` : "";
|
|
1722
|
+
console.log(`--- ${rule.toUpperCase()} (${violations.length})${fixableLabel} ---`);
|
|
1723
|
+
const toShow = verbose ? violations : violations.slice(0, 5);
|
|
1724
|
+
for (const v of toShow) {
|
|
1725
|
+
console.log(`\n ${v.file}:${v.line}`);
|
|
1726
|
+
console.log(` ${v.message}`);
|
|
1727
|
+
console.log(` -> ${v.suggestion}`);
|
|
1728
|
+
if (v.code && verbose) {
|
|
1729
|
+
console.log(` Code: ${v.code}`);
|
|
1730
|
+
}
|
|
1731
|
+
}
|
|
1732
|
+
if (!verbose && violations.length > 5) {
|
|
1733
|
+
console.log(`\n ... and ${violations.length - 5} more (use --verbose to see all)`);
|
|
1734
|
+
}
|
|
1735
|
+
console.log("");
|
|
1736
|
+
}
|
|
1737
|
+
console.log("=".repeat(70));
|
|
1738
|
+
console.log(`[${warnOnly ? "WARN" : "FAIL"}] ${allViolations.length} UI pattern violation(s)`);
|
|
1739
|
+
console.log("\nOptions:");
|
|
1740
|
+
console.log(" --fix Auto-fix violations where possible");
|
|
1741
|
+
console.log(" --adoption Show CardSection adoption statistics");
|
|
1742
|
+
console.log(" --verbose Show all violations with code snippets");
|
|
1743
|
+
console.log(" --warn Warning mode (non-blocking)");
|
|
1744
|
+
console.log("\nTo ignore specific cases, add '// preflight-ignore' above the line");
|
|
1745
|
+
console.log("=".repeat(70));
|
|
1746
|
+
if (!warnOnly) {
|
|
1747
|
+
process.exit(1);
|
|
1748
|
+
}
|
|
1749
|
+
}
|
|
1750
|
+
main().catch(console.error);
|
|
1751
|
+
//# sourceMappingURL=dashboard-section-patterns.js.map
|