mirror of
https://github.com/pbakaus/impeccable.git
synced 2026-09-13 06:36:26 +03:00
Recover joined URL arguments without splitting local paths, derive advisory behavior from registry severity across consumers, inspect readable linked CSS in URL scans, and report only the dominant primary font. AI assistance disclosure: Implemented and verified with Codex under maintainer direction.
19 lines
780 B
JavaScript
19 lines
780 B
JavaScript
import { getAntipattern, isAdvisoryRule } from './registry/antipatterns.mjs';
|
|
|
|
function getAP(id) {
|
|
return getAntipattern(id);
|
|
}
|
|
|
|
function finding(id, filePath, snippet, line = 0) {
|
|
const ap = getAP(id);
|
|
const base = { antipattern: id, name: ap.name, description: ap.description, severity: ap.severity || 'warning', category: ap.category || null, file: filePath, line, snippet };
|
|
// Advisory findings are detected but reported separately and never counted as
|
|
// failures. Carry the flag on the finding so every consumer (CLI, JSON, hook)
|
|
// can partition without a registry lookup. Only stamped when true to keep the
|
|
// finding shape stable for the vast majority of rules.
|
|
if (isAdvisoryRule(id)) base.advisory = true;
|
|
return base;
|
|
}
|
|
|
|
export { getAP, finding };
|