react-auditor 0.1.6

A blazing-fast Rust CLI to scan JS/TS/React code for best practices, quality, and security issues.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
pub mod compact;
pub mod json;
pub mod stylish;

use crate::scanner::ScanResult;

pub trait Formatter {
    fn format(&self, results: &[ScanResult], quiet: bool) -> String;
}

pub fn get_formatter(name: &str) -> Box<dyn Formatter> {
    match name {
        "json" => Box::new(json::JsonFormatter),
        "compact" => Box::new(compact::CompactFormatter),
        _ => Box::new(stylish::StylishFormatter),
    }
}