withastro / roadmap

Ideas, suggestions, and formal RFC proposals for the Astro project.
320 stars 30 forks source link

astro check --watch #473

Closed matthewp closed 1 year ago

matthewp commented 1 year ago

Body

Summary

Add a --watch flag to astro check.

Background & Motivation

In development mode there isn't a way to know if your .astro files contain no errors, aside from editor feedback. If you use astro check you will know about errors, but might not see them until CI unless you remember to run the command before pushing.

Goals

Non-Goals

Example

astro check --watch
matthewp commented 1 year ago
astro check --experimental-watch
ematipico commented 1 year ago

With --watch, do we expect to validate ALL files and then start watching, or should we just start watching for changes?

matthewp commented 1 year ago

I think I would expect it to validate first, what do you think @Princesseuh?

Princesseuh commented 1 year ago

I would also expect it to validate first! Maybe worth to check what tsc --watch, svelte-check --watch and vue-tsc --watch do to see if there's a pattern we could follow.

ematipico commented 1 year ago

tsc does check and then starts watching. Makes sense to follow their lead. Good call @Princesseuh

natemoo-re commented 1 year ago

This proposal has been accepted and merged. https://github.com/withastro/roadmap/blob/main/proposals/0030-astro-watch-check.md