Document that scripts is flat with no subfolders or index files
Check / check (pull_request) Successful in 39s
Check / check (pull_request) Successful in 39s
This commit is contained in:
@@ -55,3 +55,20 @@ so they never reach package consumers.
|
||||
|
||||
Relative imports inside one directory (`./sibling.ts`) are fine, with the
|
||||
`.ts` extension written out.
|
||||
|
||||
## `scripts/` is flat (user rule, 2026-10-16)
|
||||
|
||||
- `scripts/` has no subfolders and no `index.ts`. Barrels and `index.ts`
|
||||
entries exist only inside `src/`; delete any `index.ts` outside it.
|
||||
- Each tool is one file, `scripts/<name>.ts`, imported directly by file:
|
||||
`import { decorators } from "./scripts/decorators.ts";` in
|
||||
`vite.config.ts`.
|
||||
- Code in a former `scripts/<tool>/` folder is merged or renamed into flat
|
||||
`scripts/<name>.ts` files. Non-TS assets (HTML, images, fixtures) move to
|
||||
where they belong (next to the tool's output, `.agents/`, or a gitignored
|
||||
scratch dir). A subfolder that is really an app moves under `src/` as an
|
||||
aliased folder.
|
||||
- import-check 0.10.0+ checks folder layout only where the importer or the
|
||||
target sits in a `#`-aliased folder, so `vite.config.ts` →
|
||||
`./scripts/x.ts` passes without any override. Remove overrides that only
|
||||
dodged import-check.
|
||||
|
||||
@@ -11,7 +11,9 @@ practice.
|
||||
off for `src/rules/index.ts`, the rule registry, which must import every
|
||||
rule. It is not a precedent for apps.
|
||||
- **`scripts/**`:** a narrow override is allowed when a tooling script truly
|
||||
needs it, e.g. `no-console` in a CLI script.
|
||||
needs it, e.g. `no-console` in a CLI script. Never one that only dodges
|
||||
import-check (e.g. `no-relative-bypass` for `vite.config.ts`); import-check
|
||||
ignores folders no `#` alias owns.
|
||||
- **Generated files:** list them in `ignorePatterns`, never `overrides`.
|
||||
- **Anything else needs the user's approval first.** When the user is away,
|
||||
don't add it: refactor, or leave the violation failing and log the question.
|
||||
|
||||
@@ -40,6 +40,9 @@ with everything.
|
||||
- [ ] Decorators stay standard with `accessor`; add `scripts/decorators.ts`
|
||||
if the repo has any. Lit repos: `scripts/lit-check.ts` + `npm run
|
||||
lit-check`.
|
||||
- [ ] `scripts/` is flat: no subfolders, no `index.ts` (barrels live only in
|
||||
`src/`); `vite.config.ts` imports `./scripts/<name>.ts` directly. A
|
||||
scripts subfolder that is really an app moves under `src/`.
|
||||
|
||||
**Lint**
|
||||
|
||||
|
||||
Reference in New Issue
Block a user