purgecode
Version:
A safe, smart code-cleaning utility for JavaScript/TypeScript projects
53 lines (42 loc) • 1.42 kB
Markdown
`purgecode` uses a `purgecode.config.json` file to store your project settings.
```json
{
"include": ["src/**/*.{ts,tsx,js,jsx}"],
"exclude": ["node_modules/**", "dist/**"],
"entryPoints": ["src/index.ts"],
"dryRun": true,
"reportFormat": "markdown",
"git": {
"respectGitignore": true,
"skipTrackedFiles": false
},
"analysis": {
"followDynamicImports": true,
"checkBarrelExports": true,
"scanConfigFiles": true
}
}
```
Array of glob patterns to include in the scan.
*Default:* `["src/**/*.{ts,tsx,js,jsx}"]`
Array of glob patterns to exclude from the scan.
*Default:* `["node_modules/**", "dist/**", ...]`
Array of file paths that are considered the "roots" of your application. All used code must be reachable from these files.
*Default:* Auto-detected from `package.json` or common patterns.
If `true`, no files will be modified or deleted by default.
*Default:* `true`
Git integration settings.
- `respectGitignore`: Whether to ignore files listed in `.gitignore`.
- `skipTrackedFiles`: If `true`, skips files that have uncommitted changes (modified/staged).
### `analysis`
Advanced analysis settings.
- `followDynamicImports`: Whether to resolve `import()` expressions.
- `checkBarrelExports`: Whether to handle index files (barrel files) correctly.