#TypeScript not throwing typing errors with Vue

4 messages · Page 1 of 1 (latest)

dawn marlin
#

I have this simple game.ts file:

import {reactive} from "vue";

interface GameState {
    login: {
        loggedIn: boolean;
        accountName?: string;
    }
}

export const state : GameState = reactive({
    login: "Hello"
});

I expect TypeScript to yell at me, because login should be an object, not a string. But it doesn't. Any clue why?

shut quarry
#

If you are not seeing errors, it might be that your TS setup is broken, or your IDE setup is broken to not show the errors.

dawn marlin
#

seems to be WebStorm, thanks