An import names the file it is written in
What it finds
A module that imports itself gets its own exports, possibly before they are initialized, and gains nothing it could not refer to directly. It is usually left behind when code is moved between files.
An import or re-export is reported when its source is ./ followed by the file's own name, with or without its extension, or with the .js extension that TypeScript files are imported by.
From the rule's source, self_import.rs.
Turn it on, off or suppress it
The rule runs in every tier. To turn it off for a project, set its level in tx0.toml:
[rules]
"tx0/ts:self-import" = "off"To keep one finding, suppress it with a reason. tx0 suppress ID --reason "..." writes the comment on the line before the code:
// tx0: ignore[tx0/ts:self-import] reason="..."tx0 explain tx0/ts:self-import shows the same in the terminal. Found a false positive? Report it.