fix(linter/plugins): include executing selectors in JS plugin rule timings (#27111)

Follow-on after #26415.

That PR added timings for JS plugins.

Add one tweak - include matching selectors within the timings. If rules use complex selectors, this time can be significant, and should be included in the measured cost of the rule.
This commit is contained in:
overlookmotel committed 2026-09-27 22:52:36 +00:00
1 parent a5290a690b
commit 611e4ed894
1 file changed
+2 -4
+2 -4
View File
@@ -349,10 +349,8 @@ export function addVisitorToCompiled(visitor: VisitorObject, timing?: RuleTiming
visitProp.specificity |= selector.specificity;
if (selector.isComplex) {
const timedVisitFn = visitProp.fn;
debugAssertIsNonNull(timedVisitFn);
typeAssertIs<VisitFn>(timedVisitFn);
visitProp.fn = wrapVisitFnWithSelectorMatch(timedVisitFn, selector.esquerySelector);
visitProp.fn = wrapVisitFnWithSelectorMatch(visitFn, selector.esquerySelector);
if (timing !== undefined) visitProp.fn = wrapTimedFunction(visitProp.fn, timing);
}
const { typeIds } = selector;