This is an automated email from the ASF dual-hosted git repository.
hcr pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/mahout.git
The following commit(s) were added to refs/heads/main by this push:
new 20a8108f0 add document typecheck ci test (#1163)
20a8108f0 is described below
commit 20a8108f06fac2b9edecd05587b5a2c6839781ba
Author: ChenChen Lai <[email protected]>
AuthorDate: Tue Mar 10 11:47:34 2026 +0800
add document typecheck ci test (#1163)
Co-authored-by: 0lai0 <0lai0>
---
.github/workflows/website-build.yml | 4 ++++
website/src/components/WaveAnimation/index.tsx | 5 +++--
website/src/global.d.ts | 8 ++++++++
website/tsconfig.json | 1 +
4 files changed, 16 insertions(+), 2 deletions(-)
diff --git a/.github/workflows/website-build.yml
b/.github/workflows/website-build.yml
index 8be05e100..e0a2833ed 100644
--- a/.github/workflows/website-build.yml
+++ b/.github/workflows/website-build.yml
@@ -42,6 +42,10 @@ jobs:
working-directory: website
run: npm ci
+ - name: Type check website
+ working-directory: website
+ run: npm run typecheck
+
- name: Build website
working-directory: website
run: npm run build
diff --git a/website/src/components/WaveAnimation/index.tsx
b/website/src/components/WaveAnimation/index.tsx
index 67386d893..e98aa3df3 100644
--- a/website/src/components/WaveAnimation/index.tsx
+++ b/website/src/components/WaveAnimation/index.tsx
@@ -15,6 +15,7 @@
* limitations under the License.
*/
+import type {ReactNode} from 'react';
import {useEffect, useRef} from 'react';
import styles from './styles.module.css';
@@ -27,9 +28,9 @@ interface Wave {
strokeStyle?: string | CanvasGradient;
}
-export default function WaveAnimation(): JSX.Element {
+export default function WaveAnimation(): ReactNode {
const canvasRef = useRef<HTMLCanvasElement>(null);
- const animationRef = useRef<number>();
+ const animationRef = useRef<number | undefined>(undefined);
const timeRef = useRef(0);
useEffect(() => {
diff --git a/website/src/global.d.ts b/website/src/global.d.ts
new file mode 100644
index 000000000..5ee351c71
--- /dev/null
+++ b/website/src/global.d.ts
@@ -0,0 +1,8 @@
+/**
+ * Type declarations for non-TS modules (e.g. CSS modules).
+ * Enables IDE and tsc to recognize imports like: import styles from
'./styles.module.css'
+ */
+declare module '*.module.css' {
+ const classes: { readonly [key: string]: string };
+ export default classes;
+}
diff --git a/website/tsconfig.json b/website/tsconfig.json
index 920d7a652..cb85b161c 100644
--- a/website/tsconfig.json
+++ b/website/tsconfig.json
@@ -4,5 +4,6 @@
"compilerOptions": {
"baseUrl": "."
},
+ "include": ["src/**/*", "docusaurus.config.ts", "sidebars.ts",
"plugins/**/*"],
"exclude": [".docusaurus", "build"]
}