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:
| Violations | Word count | density | rawScore | Score |
|---|---|---|---|---|
| 1 | 100 | (1/100) * 100 = 1.0 | 100 - 1.0 * 10 = 90 | 9.0 |
| 1 | 1,000 | (1/1000) * 100 = 0.1 | 100 - 0.1 * 10 = 99 | 9.9 |
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