Commits
Click on a commit to change the comparison rangefix(linter): prevent integer underflow in count_comment_lines for JSX comments
When processing JSX inline comments like `{/* comment */}` with the
eslint/max-lines rule using skipComments: true, the count_comment_lines
function would calculate start_line > end_line, causing integer underflow.
This resulted in:
- Debug mode: panic with "attempt to subtract with overflow"
- Release mode: wrapping to usize::MAX, incorrect line count
Fix by using saturating_sub which:
- Prevents panic in all build modes
- Returns 0 for inline comments (logically correct)
- Maintains correct behavior for multi-line comments
Added test case to prevent regression. clippy fix, improve test coverage