Enable typechecks (#155)

This commit is contained in:
Zora Franke 2024-07-25 18:22:35 +02:00 committed by GitHub
parent 11613e045a
commit b74246398e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 242 additions and 1721 deletions

4
asset-imports.ts Normal file
View file

@ -0,0 +1,4 @@
declare module "*.svg" {
const content: string;
export default content;
}

1944
package-lock.json generated

File diff suppressed because it is too large Load diff

View file

@ -5,8 +5,10 @@
"main": "main.js", "main": "main.js",
"scripts": { "scripts": {
"dev": "vite dev", "dev": "vite dev",
"build": "vite build", "build": "run-s typecheck build_only",
"build_only": "vite build",
"preview": "vite preview", "preview": "vite preview",
"typecheck": "tsc --noEmit",
"lint": "prettier --ignore-path .gitignore --check --plugin-search-dir=. .", "lint": "prettier --ignore-path .gitignore --check --plugin-search-dir=. .",
"format": "prettier --ignore-path .gitignore --write --plugin-search-dir=. .", "format": "prettier --ignore-path .gitignore --write --plugin-search-dir=. .",
"test": "playwright test" "test": "playwright test"
@ -27,13 +29,16 @@
"@types/leaflet": "^1.9.12", "@types/leaflet": "^1.9.12",
"@types/leaflet.markercluster": "^1.5.4", "@types/leaflet.markercluster": "^1.5.4",
"autoprefixer": "^10.4.19", "autoprefixer": "^10.4.19",
"npm-run-all2": "^6.2.2",
"postcss": "^8.4.39", "postcss": "^8.4.39",
"prettier": "^3.3.3", "prettier": "^3.3.3",
"tailwindcss": "^3.4.6", "tailwindcss": "^3.4.6",
"typescript": "^5.5.4",
"vite": "^5.3.4" "vite": "^5.3.4"
}, },
"dependencies": { "dependencies": {
"@fontsource/ubuntu": "^5.0.13", "@fontsource/ubuntu": "^5.0.13",
"@types/node": "^20.14.12",
"leaflet": "^1.9.4", "leaflet": "^1.9.4",
"leaflet.markercluster": "^1.5.3" "leaflet.markercluster": "^1.5.3"
} }

View file

@ -24,11 +24,11 @@ const config: PlaywrightTestConfig = {
/* Run tests in files in parallel */ /* Run tests in files in parallel */
fullyParallel: true, fullyParallel: true,
/* Fail the build on CI if you accidentally left test.only in the source code. */ /* Fail the build on CI if you accidentally left test.only in the source code. */
forbidOnly: !!process.env.CI, forbidOnly: !!process.env["CI"],
/* Retry on CI only */ /* Retry on CI only */
retries: process.env.CI ? 2 : 0, retries: process.env["CI"] ? 2 : 0,
/* Opt out of parallel tests on CI. */ /* Opt out of parallel tests on CI. */
workers: process.env.CI ? 1 : undefined, workers: process.env["CI"] ? 1 : undefined,
/* Reporter to use. See https://playwright.dev/docs/test-reporters */ /* Reporter to use. See https://playwright.dev/docs/test-reporters */
reporter: "html", reporter: "html",
/* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */ /* Shared settings for all the projects below. See https://playwright.dev/docs/api/class-testoptions. */

View file

@ -74,7 +74,7 @@ export async function initializeMap() {
}, },
}); });
const data = await loadData(); const data = await loadData();
data.forEach((row) => { data.forEach((row: Organisation) => {
const marker = createMarker(row); const marker = createMarker(row);
if (marker) markers.addLayer(marker); if (marker) markers.addLayer(marker);
}); });