aidp-script-analyzer
v0.1.1-beta
Published
A static code analysis tool for JavaScript/TypeScript snippets in various file types.
Readme
aidp-script-analyzer
A static code analysis tool for JavaScript/TypeScript snippets in various file types (js, ts, jsx, tsx, vue, html).
Features
- 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.
Installation
npm install aidp-script-analyzerCLI Usage
You can use the CLI to scan a directory:
npx aidp-script-analyzer /path/to/your/projectOr if installed globally:
aidp-script-analyzer /path/to/your/projectAPI Usage
You can also use the core CodeChecker class in your own Node.js applications.
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();License
ISC
