Why it exists
A raw issue count treats every document the same. One banned phrase in a 100-word release note and the same phrase in a 1,000-word spec would lose the same points. Density scoring measures issues per 100 words instead, so an error weighs more in a short document than in a long one. The score reflects proportional quality, not absolute count.How it works
VectorLint calculates error density (violations per 100 words) then subtracts a penalty scaled by that density and the rule’s strictness:strictness is a multiplier (default 10) set in the rule’s frontmatter. See Strictness.
Key properties
With the defaultstrictness = 10, one violation scores differently depending on document length:
The same error costs more in the short document because it represents a higher proportion of the content.
A score below 10 means VectorLint found at least one issue. It reports the score at the rule’s configured severity; a severity of
error causes a non-zero exit code and fails CI.
Constraints
A score of 0 meansrawScore was clamped at the floor. The error density was high enough to exhaust the entire penalty budget.
Related
- Rubric scoring: the method used when reviewing quality on a spectrum instead of counting issues
- Strictness: the multiplier in the formula and how to set it