Verification · Static analysis · Linting
Custom lint rules
Repository-specific rules written as plugins or pattern rules for mistakes that recur in review.
How to build it
- Pick a recurring review comment and write the pattern it describes as a rule.
- Write the rule as an ESLint plugin rule or a Semgrep pattern stored in the repository.
- Add a test file for the rule with a failing example and a passing example.
Signals in a repository
- A local ESLint plugin directory or an eslint-plugin-* dependency with custom rules.
- A .semgrep.yml file or .semgrep/ directory with rules and matching test fixtures.
In practice
117 repositories run a tool for this check in the scanned set.
eslint· 107 repossemgrep· 15 repos
Examples
-
freeCodeCamp/freeCodeCamp ·
eslinteslint --max-warnings 0 -
nousresearch/hermes-agent ·
eslinteslint {staged_files} -
iptv-org/iptv ·
eslinteslint scripts/**/*.{ts,js} tests/**/*.{ts,js} -
vercel/next.js ·
eslinteslint --config eslint.cli.config.mjs -
facebook/react-native ·
eslinteslint --max-warnings 0 .