#12028·biome

`noExcessiveLinesPerFile` does not count the lines inside a block comment

Author: marcospgpCreated Sep 29, 2026Updated Sep 30, 2026
LabelsS-Needs repro

Environment

Biome 2.5.14 (bunx @biomejs/[email protected]), macOS.

What happened

noExcessiveLinesPerFile does not count the lines inside a block comment. A 550-line file passes a 500-line limit when 150 of its lines are one block comment.

biome.json:

json
{
  "root": true,
  "linter": {
    "rules": {
      "recommended": false,
      "style": {
        "noExcessiveLinesPerFile": { "level": "error", "options": { "maxLines": 500, "skipBlankLines": false } }
      }
    }
  }
}

Two files, generated with:

bash
python3 - <<'PY'
code = [f"export const value{i} = {i};" for i in range(400)]
comment = ["/*"] + [f" * comment line {i}" for i in range(148)] + [" */"]
open("with-comment.ts", "w").write("\n".join(code[:200] + comment + code[200:]) + "\n")
open("without-comment.ts", "w").write("\n".join(f"export const value{i} = {i};" for i in range(550)) + "\n")
PY

Both files are 550 lines long (wc -l). biome lint with-comment.ts without-comment.ts reports only without-comment.ts.

Expected result

Both files are reported. The rule's page says it restricts "the number of lines in a file", and its only option that excludes lines is skipBlankLines.