Skip to Content
Vektos
Anecdotes

No files found to lint

A linter that checked zero files reported zero problems, and a new grader flagged our own docs.

What happened

Two small surprises came out of the page-graders block.

1. The lint grader passed because it linted nothing. The first version ran oxlint on the scratch folder apps/web/.bench/<id>/. It printed:

No files found to lint. Please check your paths and ignore patterns.
{ "diagnostics": [], "number_of_files": 0, ... }

An empty list of diagnostics. Read naively, a clean page. Two things hid the folder from oxlint: the folder is gitignored (so it never ends up in the repo), and its name starts with a dot. A run with a type error, an unused variable and a missing key would have scored "0 lint problems" on every model and every context.

2. The new components grader flagged our own code. Its first run on the repo's self-grade test reported two native-element violations in packages/ds/src/docs/token-table.tsx: the Storybook docs page that lists every token uses a plain <table>. The design system had a Table and its own documentation did not use it.

What we learned

A grader that finds nothing to check must say so. "No violations" and "nothing was inspected" look identical in a table of zeros. The fix was cheap: pass the files to oxlint by name, and treat any output that is not the JSON report as an error instead of as a clean result. The same rule now applies to the browser check: a page that renders nothing is a violation (empty-page), not a pass.

The second one is the rule working, not failing. The docs table is styled by Storybook's docs theme, and swapping in the design system's Table would restyle it. It is a real, intentional exception. That is what vektos-ignore is for: the comment says why, and the grader reports it as ignored instead of hiding it.

What it means for Vektos

  • Every grader has a "did it look at anything" path. The runner will fail a check that cannot run (no Chrome, no tsc, no files) rather than count it as clean. Zeros in a report must mean "looked and found nothing".
  • Dogfooding is a test. Grading our own design system and web app with every new grader is how a rule gets its first false-positive check. It stays in grade.test.ts.
  • Intentional exceptions leave a trail. vektos-ignore: <reason> in our own code shows agents the sanctioned way to deviate, and a report can count how often it is used.

Follow-ups

  • Show the number of ignored violations per run in the CLI table (it is in result.json already).
  • Consider a files checked count in RunResult, so an empty check is visible in the report and not only in an error.

On this page