Code quality scanning tool for JavaScript/TypeScript projects. Detects dead code, unused imports, stale dependencies, and duplicate logic.
npm install -g sweepstacx# Scan your project
sweepstacx scan
# View the report
sweepstacx report
# Generate patches for issues
sweepstacx patch
# Apply patches automatically
sweepstacx patch --applyScan your codebase for issues.
sweepstacx scan [options]
Options:
--path <path> Path to scan (default: ".")
--lang <lang> Language hint: js, ts (default: "js")
--config <file> Config file (.sweeperc.json)Generate or display scan reports.
sweepstacx report [options]
Options:
--out <base> Basename for outputs (default: "sweepstacx-report")
--json Output JSON to stdout
--md Output Markdown to stdoutGenerate and optionally apply patches.
sweepstacx patch [options]
Options:
--apply Apply generated patches with git applyCI-friendly stats-only mode.
sweepstacx check [options]
Options:
--path <path> Path to scan (default: ".")
--config <file> Config file (.sweeperc.json)lint- Run ESLint on your codedeps- Analyze dependencies with depcheckdupes- Find duplicate code blockscomplexity- Analyze code complexityfuzz- Fuzz test JavaScript files
Create a .sweeperc.json in your project root:
{
"complexity": {
"maxFunction": 15,
"maxAverage": 10,
"minMaintainability": 65
},
"duplication": {
"maxLines": 10,
"maxPercent": 8
},
"deps": {
"unused": 0,
"missing": 0
},
"ignore": [
"node_modules/**",
"dist/**",
"coverage/**",
".git/**"
]
}name: Code Quality
on: [pull_request]
jobs:
quality:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '20.x'
- run: npm install -g sweepstacx
- run: sweepstacx scan
- run: sweepstacx check- Node.js >= 18.17
- npm or pnpm
git clone https://github.com/1devteam/SweepstacX.git
cd SweepstacX
npm install
npm testnpm test # Run all tests
npm run test:watch # Watch mode
npm run lint # Run linterMIT © 1devteam