A static code analysis tool for JavaScript/TypeScript snippets in various file types.
npm install aidp-script-analyzerA static code analysis tool for JavaScript/TypeScript snippets in various file types (js, ts, jsx, tsx, vue, html).
- Scans directories recursively for source files.
- Supports extracting and linting scripts within HTML files.
- Checks for syntax errors, unused variables, and undefined variables.
- Uses ESLint under the hood with tailored configurations for different file types.
``bash`
npm install aidp-script-analyzer
You can use the CLI to scan a directory:
`bash`
npx aidp-script-analyzer /path/to/your/project
Or if installed globally:
`bash`
aidp-script-analyzer /path/to/your/project
You can also use the core CodeChecker class in your own Node.js applications.
`typescript
import { CodeChecker } from 'aidp-script-analyzer';
async function main() {
const checker = new CodeChecker();
const code = const a = 1;;
const issues = await checker.check(code, 'js');
console.log(issues);
}
main();
``
ISC