Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Typescript errors #486

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

matthewCmatt
Copy link
Contributor

@matthewCmatt matthewCmatt commented Feb 20, 2025

Currently, this repo fails the tsc check. We currently don't run this in CI except on build, so we haven't caught it until now.

This PR:

  • Updates the CI code quality job to include Typescript checks. Here's an example run.
  • Cleans up the PNPM scripts for linting/building
    • Removes the exclusive ui:lint "lint" check. This is covered by ui:check.
    • Adds tsc check to the ui:check script
    • Removes tsc from ui:build endpoint. This will be run on every MR from now on, and vite build compiles typescript where needed.
  • Fixes current tsc errors
    • This is mostly specifying some types in the map components to use MapLibre GL JS types.
    • The above example linked shows tsc --noEmit passing!

@matthewCmatt matthewCmatt changed the title Add tsc to ui:check and fix tsc issues Check for Typescript errors Feb 20, 2025
@matthewCmatt matthewCmatt changed the title Check for Typescript errors Fix Typescript errors Feb 20, 2025
@matthewCmatt matthewCmatt marked this pull request as ready for review February 20, 2025 13:12
@@ -184,8 +183,8 @@ export const CreateWaypointDialog = ({
const handlePositionUpdate = useMemo(
() =>
debounce<(e: MarkerDragEvent) => void>((e) => {
setWaypointPosition(e.lngLat);
flyToPosition(e.lngLat);
setWaypointPosition(e.lngLat as LngLat);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Casting is against a TypeScript best practice, can this be inferred or the MarkerDragEvent unioned with another type that would provide Lat & Long?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants