Skip to content

Fix template-no-model-argument-in-route-templates: lint .gjs/.gts and unknown paths#2691

Open
johanrd wants to merge 1 commit intoember-cli:masterfrom
johanrd:day_fix/template-no-model-argument-in-route-templates
Open

Fix template-no-model-argument-in-route-templates: lint .gjs/.gts and unknown paths#2691
johanrd wants to merge 1 commit intoember-cli:masterfrom
johanrd:day_fix/template-no-model-argument-in-route-templates

Conversation

@johanrd
Copy link
Copy Markdown
Contributor

@johanrd johanrd commented Apr 13, 2026

Summary

  • Adds isRouteTemplate heuristic mirroring upstream (also used by template-no-outlet-outside-routes)
  • .gjs/.gts route templates (e.g. app/routes/posts.gjs) are now linted
  • Unknown file paths default to linting (assume route), matching upstream
  • Partials (basename starts with -) are correctly excluded

Test plan

  • app/routes/posts.gjs with {{@model.foo}} → flagged + autofixed
  • Unknown path with {{@model.foo}} → flagged
  • app/templates/-partial.hbs → not flagged
  • app/components/user-card.gjs → not flagged

… unknown paths

Upstream defaults to linting unknown paths (assumes route template) and
runs in both modes. Port disabled itself on .gjs/.gts entirely and
returned false for unknown paths. Mirror upstream's isRouteTemplate
heuristic (also used by template-no-outlet-outside-routes), skip
partials, and lint by default for unknown paths.
@johanrd johanrd marked this pull request as ready for review April 13, 2026 16:23
@johanrd johanrd force-pushed the day_fix/template-no-model-argument-in-route-templates branch from 058ab65 to a31a752 Compare April 13, 2026 17:38
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