0
Fork 0
mirror of https://github.com/withastro/astro.git synced 2024-12-16 21:46:22 -05:00

feat: noSync flag for astro check (#11482)

This commit is contained in:
Erika 2024-07-18 11:45:25 +02:00 committed by GitHub
parent e7bfbf877e
commit 7c9ed71bf1
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 15 additions and 8 deletions

View file

@ -0,0 +1,5 @@
---
'astro': minor
---
Adds a `--noSync` parameter to the `astro check` command to skip the type-gen step. This can be useful when running `astro check` inside packages that have Astro components, but are not Astro projects

View file

@ -24,6 +24,7 @@ export async function check(flags: Arguments) {
return;
}
if (!flags.noSync && !flags.help) {
// Run sync before check to make sure types are generated.
// NOTE: In the future, `@astrojs/check` can expose a `before lint` hook so that this works during `astro check --watch` too.
// For now, we run this once as usually `astro check --watch` is ran alongside `astro dev` which also calls `astro sync`.
@ -33,6 +34,7 @@ export async function check(flags: Arguments) {
} catch (_) {
return process.exit(1);
}
}
const { check: checker, parseArgsAsCheckConfig } = checkPackage;