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 underroot, 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/andtests/e2e/both run first-party code for real; a test file undertests/outside them isunknown-tierrather than silently unscanned. - find_
unit_ violations - Every unit-isolation violation under
root— a runtime import that isn’tvi.mock()-ed — sorted by(file, line). A file that cannot be read or parsed is an error. - is_
type_ only_ module truewhensource(a module atpath) 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 bothfalse: the presence rule keeps a module it couldn’t read as a subject.- same_
code truewhenbaseandhead— the module atpathbefore 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.