0
Fork 0
mirror of https://github.com/withastro/astro.git synced 2025-01-20 22:12:38 -05:00

Fix ts errors for component template (#9602)

This commit is contained in:
Bjorn Lu 2024-01-04 19:06:37 +08:00 committed by GitHub
parent 6834b3d3fe
commit 00fcf82eb7
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 13 additions and 2 deletions

View file

@ -1,3 +1,6 @@
{
"extends": "astro/tsconfigs/base"
"extends": "astro/tsconfigs/base",
"compilerOptions": {
"jsx": "preserve"
}
}

View file

@ -1,7 +1,7 @@
// @ts-check
import { spawn } from 'node:child_process';
import { readdirSync, readFileSync, writeFileSync } from 'node:fs';
import { existsSync, readdirSync, readFileSync, writeFileSync } from 'node:fs';
import * as path from 'node:path';
import pLimit from 'p-limit';
import { tsconfigResolverSync } from 'tsconfig-resolver';
@ -21,6 +21,14 @@ function checkExamples() {
limit(
() =>
new Promise((resolve) => {
// Sometimes some examples may get deleted, but after a `git pull` the directory still exists.
// This can stall the process time as it'll typecheck the entire monorepo, so do a quick exist
// check here before typechecking this directory.
if (!existsSync(path.join('./examples/', example.name, 'package.json'))) {
resolve(0);
return;
}
const originalConfig = prepareExample(example.name);
let data = '';
const child = spawn('node', ['../../packages/astro/astro.js', 'check'], {