Skip to content

Commit

Permalink
Fix ts errors for component template (#9602)
Browse files Browse the repository at this point in the history
  • Loading branch information
bluwy authored Jan 4, 2024
1 parent 6834b3d commit 00fcf82
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 2 deletions.
5 changes: 4 additions & 1 deletion examples/component/tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
{
"extends": "astro/tsconfigs/base"
"extends": "astro/tsconfigs/base",
"compilerOptions": {
"jsx": "preserve"
}
}
10 changes: 9 additions & 1 deletion scripts/smoke/check.js
Original file line number Diff line number Diff line change
@@ -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';
Expand All @@ -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'], {
Expand Down

0 comments on commit 00fcf82

Please sign in to comment.