Skip to main content

Module ts

Module ts 

Source
Expand description

TypeScript isolation analysis, parsed with oxc — the counterpart to the Python crate::lint module. Each *.test.{ts,tsx,mts,cts} file is parsed and walked, and its specifiers are classify-ed first-party / Node-builtin / third-party.

Enums§

Origin
Where a module specifier resolves, for isolation purposes.

Functions§

classify
Classify a module specifier, resolution-free: a relative or absolute path is first-party, a node: prefix or a built-in head segment is a built-in, and every other bare specifier is a third-party package.
find_integration_violations
Every integration-isolation violation in the *.test.{ts,tsx,mts,cts} files under root, sorted by (file, line). A file that cannot be read or parsed is an error.
find_suite_violations
Every integration-isolation violation in package_root’s suite tiers, sorted by (file, line). tests/integration/ and tests/e2e/ both run first-party code for real; a test file under tests/ outside them is unknown-tier rather than silently unscanned.
find_unit_violations
Every unit-isolation violation under root — a runtime import that isn’t vi.mock()-ed — sorted by (file, line). A file that cannot be read or parsed is an error.
is_type_only_module
true when source (a module at path) declares something and compiles to zero runtime JavaScript, so it has no behavior to unit-test. An empty module and one that fails to parse are both false: the presence rule keeps a module it couldn’t read as a subject.
same_code
true when base and head — the module at path before and after an edit — compile to the same JavaScript. A side that fails to parse is not equal: co-change then holds the file to its colocated test rather than skip a module it couldn’t read.