Document that package.json aliases may target only direct subfolders of src #21

Merged
temeddix merged 27 commits from alias-targets into main 2026-10-18 14:37:50 +00:00
2 changed files with 14 additions and 11 deletions
Showing only changes of commit 627458fb5f - Show all commits
+3 -1
View File
@@ -27,7 +27,9 @@ convention, see the last section):
area (`./a/one.ts`, `no-relative-bypass`; `./b/f.ts` to a file alias,
`prefer-alias-import`, fixed to the alias) are bypasses.
- **Inside an area, relative imports of siblings and subfolders are free.**
- **`../` is banned in every file**, owned or not (`no-parent-import`).
- **A `../` import is banned in every file**, owned or not (`no-parent-import`).
Runtime file URLs (`new URL("../prompt.md", import.meta.url)`) are not
imports and are allowed.
Anything above a file needs an alias.
- **Files no alias owns** need no `index.ts` and no alias, and import `./`
siblings and subfolders freely.
+11 -10
View File
@@ -29,16 +29,17 @@ below it; an alias to any other file owns only that file. No overlap: no file
may be owned by 2 aliases, so no alias inside another alias's area and no 2
aliases with the same target. Outside an area, only the exact alias reaches
it; a deeper alias specifier or a relative path into the area is a bypass.
Inside an area, relative imports of siblings and subfolders are free. `../`
is banned in every file, owned or not
(`import/no-relative-parent-imports`). Files no alias owns need no `index.ts`
and no alias, and import `./` siblings and subfolders freely. The one alias
is `#testing` (`./src/testing/index.ts`): tests that use its helpers import
it by alias, and `tests/` reaches `src/` only through it. Local convention, stricter than the
general rule above: in this repo, aliases point only at a direct subfolder of
`src/` (`"#helpers": "./src/helpers/index.ts"`), and code outside `src/` uses
`./` relative imports. `scripts/` is flat: one file per
tool, no subfolders and no `index.ts`, imported directly by file path
Inside an area, relative imports of siblings and subfolders are free. A `../`
import is banned in every file, owned or not
Outdated
Review

This new rule says ../ is banned in every file, but it remains in tests/entrypoints.test.ts, tests/workflow.test.ts, and src/run.ts; the listed import rule does not check URL strings. Remove those traversals or narrow and enforce the rule to match its actual scope.

Profile: codex · gpt-5.6-terra

This new rule says `../` is banned in every file, but it remains in `tests/entrypoints.test.ts`, `tests/workflow.test.ts`, and `src/run.ts`; the listed import rule does not check URL strings. Remove those traversals or narrow and enforce the rule to match its actual scope. > Profile: `codex` · `gpt-5.6-terra`
(`import/no-relative-parent-imports`); runtime file URLs such as
`new URL("../prompt.md", import.meta.url)` are paths, not imports, and stay.
Files no alias owns need no `index.ts` and no alias, and import `./` siblings
Outdated
Review

AGENTS.md says every test imports #testing, but src/credentials.test.ts, src/opencode.test.ts, and src/profiles.test.ts do not. Limit this to tests/ (or make the statement true) so the alias policy stays accurate.

Profile: codex · gpt-5.6-terra

`AGENTS.md` says every test imports `#testing`, but `src/credentials.test.ts`, `src/opencode.test.ts`, and `src/profiles.test.ts` do not. Limit this to `tests/` (or make the statement true) so the alias policy stays accurate. > Profile: `codex` · `gpt-5.6-terra`
and subfolders freely. The one alias is `#testing` (`./src/testing/index.ts`):
tests that use its helpers import it by alias, and `tests/` imports `src/`
only through it. Local convention, stricter than the general rule above: in
this repo, aliases point only at a direct subfolder of `src/`
(`"#helpers": "./src/helpers/index.ts"`), and code outside `src/` uses `./`
relative imports. `scripts/` is flat: one file per tool, no subfolders and no `index.ts`, imported directly by file path
([.agents/memory/imports-aliases-barrels.md](.agents/memory/imports-aliases-barrels.md)).
The only config files are `package.json`, `tsconfig.json`, and