All files / packages/sds-customization-compliance/src/config ignoredSelectors.ts

100% Statements 1/1
100% Branches 0/0
100% Functions 0/0
100% Lines 1/1

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35                                                    4x                
/**
 * Per-component exclusion list for the regression-based compliance checks.
 *
 * A component's "legacy" CSS occasionally declares rules whose selector
 * belongs to a *different* component (e.g. the legacy `icon.css` styles
 * `.slds-input__icon`, which structurally owns by the `input` component).
 * When the new CSS drops or relocates those rules, the regression audit
 * correctly emits `hook-selector-moved` / `property-removed` flags — but
 * they aren't regressions of the component under test. They're cleanup
 * of cross-component baggage that never should have lived there.
 *
 * Entries here filter those flags out of the regression check
 * (`no-unintended-visual-changes`) without touching the raw
 * `regression.flags` array in the report; the
 * underlying data stays queryable for anyone who wants to inspect it,
 * only the row-level score/offender-list is affected.
 *
 * Match is performed against the flag's normalized selector key (see
 * `selectorKey()` in `audit/extract.ts`), so whitespace and comma
 * ordering between the entry and the source CSS don't matter.
 *
 * To add an entry: confirm the selector genuinely belongs to a different
 * component (not a real regression of this one), append it with a short
 * inline comment pointing to the other component. Keep the list minimal —
 * anything here is "silent to the reviewer" and should survive a `git blame`.
 */
export const IGNORED_SELECTORS: Readonly<Record<string, readonly string[]>> = {
  icon: [
    // `.slds-input__icon` is an input-component selector. The legacy
    // `icon.css` historically styled it; the new icon CSS nests it under
    // `.slds-icon .slds-input__icon` (input still owns the selector).
    '.slds-input__icon',
  ],
};