feat: local rules shim, ARCH-010, and parallel file discovery#86
Merged
Conversation
Rules files no longer need node_modules or package.json. The CLI
generates an ambient .archgate/rules.d.ts on init/check so .rules.ts
files get full editor IntelliSense via triple-slash references.
- Remove defineRules() function and ./rules npm export
- Generate ambient rules.d.ts (declare types, no export) on every check
- Rule files use plain `export default { rules: {...} } satisfies RuleSet`
- Scaffold companion .rules.ts on `adr create --rules`
- Add .archgate/rules.d.ts to .gitignore during init
- Missing companion files now throw instead of warning
- Migrate all project rule files, tests, and docs to new pattern
- archgate init detects .oxlintrc.json and .eslintrc.json and adds an override to disable triple-slash-reference for .archgate/adrs/ - Add ARCH-010: prefer Bun.file().json() over JSON.parse()
- Replace JSON.parse(content) with Bun.file().json() in claude-settings - Extend ARCH-010 rule to catch two-line pattern (Bun.file().text() assigned to variable then passed to JSON.parse)
Replace sequential await-in-loop patterns with Promise.all for independent file reads in loader, context, and adr-writer. Removes all no-await-in-loop lint suppressions from these files.
Remove no-await-in-loop suppressions from ARCH-010 and GEN-002 rule files and git-files.ts by replacing sequential loops with Promise.all.
Deploying archgate-cli with
|
| Latest commit: |
d9ae092
|
| Status: | ✅ Deploy successful! |
| Preview URL: | https://d7e77a2a.archgate-cli.pages.dev |
| Branch Preview URL: | https://worktree-zesty-shimmying-rab.archgate-cli.pages.dev |
Merged
rhuanbarreto
added a commit
that referenced
this pull request
Mar 20, 2026
* feat: generate local rules.d.ts shim, remove archgate/rules npm export
Rules files no longer need node_modules or package.json. The CLI
generates an ambient .archgate/rules.d.ts on init/check so .rules.ts
files get full editor IntelliSense via triple-slash references.
- Remove defineRules() function and ./rules npm export
- Generate ambient rules.d.ts (declare types, no export) on every check
- Rule files use plain `export default { rules: {...} } satisfies RuleSet`
- Scaffold companion .rules.ts on `adr create --rules`
- Add .archgate/rules.d.ts to .gitignore during init
- Missing companion files now throw instead of warning
- Migrate all project rule files, tests, and docs to new pattern
* docs: add note about triple-slash-reference linter conflict
* feat: auto-configure linter overrides on init, add ARCH-010
- archgate init detects .oxlintrc.json and .eslintrc.json and adds
an override to disable triple-slash-reference for .archgate/adrs/
- Add ARCH-010: prefer Bun.file().json() over JSON.parse()
* fix: apply ARCH-010 to claude-settings.ts, improve rule detection
- Replace JSON.parse(content) with Bun.file().json() in claude-settings
- Extend ARCH-010 rule to catch two-line pattern (Bun.file().text()
assigned to variable then passed to JSON.parse)
* refactor: parallelize file discovery with Promise.all
Replace sequential await-in-loop patterns with Promise.all for
independent file reads in loader, context, and adr-writer. Removes
all no-await-in-loop lint suppressions from these files.
* refactor: parallelize ADR rules and git file resolution with Promise.all
Remove no-await-in-loop suppressions from ARCH-010 and GEN-002 rule
files and git-files.ts by replacing sequential loops with Promise.all.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
rules.d.tsshim so.rules.tsfiles get type checking without requiringnode_modules(supports non-JS projects). Removes thearchgate/rulesnpm export.init.Promise.all, removing mostno-await-in-looplint suppressions.Test plan
bun run validatepasses (lint, typecheck, format, 313 tests, ADR check, build)archgate initgenerates.archgate/rules.d.tsand configures oxlint overridesarchgate checkstill reports violations correctly with parallel execution