On this page
JavaScript and TypeScript linter using tree-sitter AST parsing to detect library boundary violations such as forbidden imports and logging.
#rlsbl.lint.npm_ast
#rlsbl.lint.npm_ast
JavaScript and TypeScript linter using tree-sitter AST parsing to detect library boundary violations such as forbidden imports and logging.
#_lang_for_ext
def _lang_for_ext(ext)Select the tree-sitter language based on file extension.
#_node_line
def _node_line(node)Return 1-based line number for a tree-sitter node.
#_extract_string
def _extract_string(node)Extract text content from a string/string_fragment node.
#_collect_all_imports
def _collect_all_imports(tree, filepath)Walk AST and collect all imported package names.
Returns a set of (package_name, file_path, line_number) tuples.
#_check_forbidden_imports
def _check_forbidden_imports(tree, filepath, config)Walk AST for import/require/export nodes.
#_check_stdout
def _check_stdout(tree, filepath, config)Detect console.log/warn/error/info calls.
#_check_entry_points
def _check_entry_points(project_path, config)Check package.json for 'bin' field.
#NpmAstLinter
npm (JS/TS) linter using tree-sitter AST analysis.
#lint
def lint(self, project_path: str, config: LanguageLintConfig) -> list[LintResult]#scan_imports
def scan_imports(self, project_path: str) -> set[tuple[str, str, int]]Collect all imported package names from JS/TS files.
Returns a set of (package_name, file_path, line_number) tuples.