From 00d05e7374f5767d1a57221aaac7bfc44751c3a1 Mon Sep 17 00:00:00 2001 From: Sergei Maertens Date: Mon, 3 Mar 2025 16:37:17 +0100 Subject: [PATCH] :construction_worker: [#445] Enable type checking in CI Added some missing type definitions, but not everything is there yet. --- .github/workflows/ci.yml | 10 ++++++++-- package-lock.json | 16 ++++++++++++++++ package.json | 2 ++ tsconfig.json | 1 + 4 files changed, 27 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 693237b2c..1a7c33232 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -45,11 +45,17 @@ jobs: echo "version=${VERSION}" >> $GITHUB_OUTPUT - - name: Build Javascript + - name: Install dependencies run: | - echo "Building version $VITE_VERSION" npm ci npm run build:design-tokens + + - name: Run type checker + run: npm run buid:typecheck + + - name: Build Javascript + run: | + echo "Building version $VITE_VERSION" VITE_VERSION=${VITE_VERSION} npm run build env: VITE_VERSION: ${{ steps.build-args.outputs.version }} diff --git a/package-lock.json b/package-lock.json index ba00b637c..ad1268327 100644 --- a/package-lock.json +++ b/package-lock.json @@ -73,6 +73,7 @@ "@testing-library/react": "^16.2.0", "@testing-library/user-event": "^14.6.0", "@trivago/prettier-plugin-sort-imports": "^4.3.0", + "@types/leaflet": "^1.9.16", "@typescript-eslint/parser": "^8.19.0", "@utrecht/component-library-css": "1.0.0-alpha.604", "@utrecht/component-library-react": "1.0.0-alpha.353", @@ -5842,6 +5843,12 @@ "integrity": "sha512-eOIHzCUSH7SMfonMG1LsC2f8vxBFtho6NGBznK41R84YzPuvSBzrhEps33IsQiOW9+VL6NQ9DbjQJznk/S4uRA==", "dev": true }, + "node_modules/@types/geojson": { + "version": "7946.0.16", + "resolved": "https://registry.npmjs.org/@types/geojson/-/geojson-7946.0.16.tgz", + "integrity": "sha512-6C8nqWur3j98U6+lXDfTUWIfgvZU+EumvpHKcYjujKH7woYyLj2sUmff0tRhrqM7BohUw7Pz3ZB1jj2gW9Fvmg==", + "dev": true + }, "node_modules/@types/graceful-fs": { "version": "4.1.9", "resolved": "https://registry.npmjs.org/@types/graceful-fs/-/graceful-fs-4.1.9.tgz", @@ -5907,6 +5914,15 @@ "integrity": "sha512-dRLjCWHYg4oaA77cxO64oO+7JwCwnIzkZPdrrC71jQmQtlhM556pwKo5bUzqvZndkVbeFLIIi+9TC40JNF5hNQ==", "dev": true }, + "node_modules/@types/leaflet": { + "version": "1.9.16", + "resolved": "https://registry.npmjs.org/@types/leaflet/-/leaflet-1.9.16.tgz", + "integrity": "sha512-wzZoyySUxkgMZ0ihJ7IaUIblG8Rdc8AbbZKLneyn+QjYsj5q1QU7TEKYqwTr10BGSzY5LI7tJk9Ifo+mEjdFRw==", + "dev": true, + "dependencies": { + "@types/geojson": "*" + } + }, "node_modules/@types/mdx": { "version": "2.0.13", "resolved": "https://registry.npmjs.org/@types/mdx/-/mdx-2.0.13.tgz", diff --git a/package.json b/package.json index 5c94ba20f..b318f9e28 100644 --- a/package.json +++ b/package.json @@ -70,6 +70,7 @@ "scripts": { "start": "npm run build:design-tokens && vite", "build": "npm run build:umd && npm run build:esm && npm run build:esm-bundle", + "build:typecheck": "tsc --noEmit", "build:umd": "BUILD_TARGET=umd vite build", "build:esm": "BUILD_TARGET=esm vite build", "build:esm-bundle": "BUILD_TARGET=esm-bundle vite build", @@ -121,6 +122,7 @@ "@testing-library/react": "^16.2.0", "@testing-library/user-event": "^14.6.0", "@trivago/prettier-plugin-sort-imports": "^4.3.0", + "@types/leaflet": "^1.9.16", "@typescript-eslint/parser": "^8.19.0", "@utrecht/component-library-css": "1.0.0-alpha.604", "@utrecht/component-library-react": "1.0.0-alpha.353", diff --git a/tsconfig.json b/tsconfig.json index 71c417917..0bf1456ea 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -17,6 +17,7 @@ "strictNullChecks": true, "allowSyntheticDefaultImports": true, "noErrorTruncation": true, + "allowJs": true, "paths": { "@/*": ["./*"], "@/sb-decorators": ["../.storybook/decorators.tsx"]