arhus is a local-first security scanner for TypeScript & JavaScript.
git clone https://github.com/sudoeren/arhus.git
cd arhus
bun install
bun link# Interactive mode
arhus
# Scan the project itself
arhus scan .
# Run all tests
bun test
# Run tests in watch mode
bun test --watch
# Build for Node.js
bun run build- Create a new file in
src/rules/<rule-name>.ts - Implement the
Ruleinterface:import { Severity } from '../types'; import type { Rule } from '../types'; export const myRule: Rule = { id: 'my-rule-id', name: 'My Rule', description: 'What it detects', severity: Severity.High, check(context) { // Walk context.sourceFile AST with visitor pattern // Return Finding[] for each match }, };
- Register it in
src/rules/index.ts:import { registerRule } from '../rule'; import { myRule } from './my-rule'; registerRule(myRule);
- Write tests in
tests/rules/my-rule.test.ts - Run
bun testto verify
This project follows Conventional Commits:
feat:- new featurefix:- bug fixchore:- maintenancedocs:- documentationtest:- testsci:- CI/CD changes