Skip to content

feat: add Phaser 4 rule pack - #340

Merged
agjs merged 1 commit into
mainfrom
feat/phaser-rule-pack
Aug 22, 2026
Merged

feat: add Phaser 4 rule pack#340
agjs merged 1 commit into
mainfrom
feat/phaser-rule-pack

Conversation

@agjs

@agjs agjs commented Aug 22, 2026

Copy link
Copy Markdown
Collaborator

Summary

Adds a phaser rule pack (analogous to the three.js pack) that auto-applies when phaser is in package.json.

Ten AST rules for Phaser 4 as a render substrate:

Rule Default What it catches
no-phaser-import-in-pure-layers error import "phaser" from domain/content/shared/features
require-scene-shutdown-hook error Scene binds .on() without SHUTDOWN/DESTROY
no-unmanaged-global-listeners error window/document/Game/Registry/Scale/anims/textures listeners inside a Scene
no-phaser-alloc-in-update warn this.add.* / new Phaser.Math.* / setText in update/tick
no-physics-collider-in-update error physics.add.overlap/collider in the tick
no-raw-scene-key-literal error scene.start("World") / super("Boot")
no-raw-texture-key-literal warn string-literal texture/audio keys
no-ignore-destroy error ignoreDestroy = true
no-loader-in-update error this.load.* in the tick
no-global-phaser warn script-tag Phaser / require("phaser")

Not in this PR: IStackAdapter, scaffold archetype, ManagedScene/ECS, typed asset manifest.

Test plan

  • bun test packages/core/tests/rule-pack-phaser.test.ts (registry, each rule, phaser-starter fixture lints clean)
  • bun test packages/core/tests/rule-docs-examples.test.ts (every pack doc example trips/satisfies)
  • bun test packages/core/tests/stack-detection.test.ts (phaser: 4.2.1 detects the pack)
  • bun run ci:local (rules/arch check, typecheck, lint, format, 5755 tests, PTY e2e)

Ten AST rules for scene shutdown ownership, global emitter leaks, no
Phaser factories in update/tick, branded scene/texture keys, and no
ignoreDestroy. Analogous to the three.js pack.
@agjs

agjs commented Aug 22, 2026

Copy link
Copy Markdown
Collaborator Author

Template confinement: boringstack-xyz/Phaser-TypeScript-AI-First-Starter#37

@agjs
agjs merged commit d396a1a into main Aug 22, 2026
8 checks passed
@agjs
agjs deleted the feat/phaser-rule-pack branch August 22, 2026 20:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant