glinter/ffi_usage
Values
pub fn check_ffi_files(
directories: List(String),
project_prefix: String,
) -> #(List(rule.LintResult), List(#(String, String)))
Discover .mjs files in the given directories and lint them. Returns both lint results and the source texts (needed by the reporter to translate byte offsets back to line numbers).
pub fn check_source(
file_path: String,
source: String,
) -> List(rule.LintResult)
Check a single source string for FFI anti-patterns. Returns LintResults with proper byte-offset locations.
NOTE: Detection uses string.contains against line text, which may produce
false positives when pattern names appear inside string literals or comments
(e.g. let s = "makeError()" would flag). In practice, references to
Gleam’s internal runtime APIs are rare in normal code, so the false-positive
rate is low.