So, I think my typescrpt linter is short circuiting because, I cant for the life of me figure out why this linting error keeps being raised.
Type 'IConnectionState' is not assignable to type '{ connected: false; type: "none"; }'
Below is my code, which you can clearly see, should have no consequence.
export interface IConnectionState {
    connected: boolean;
    type: 'none' | 'player' | 'host';
}
export const ConnectionState: RecoilState<IConnectionState> = atom({
    key: 'connectionState',
    default: {
        connected: false,
        type: 'none'
    }
});
If it helps, I'm using recoil. But looking at the recoil types, RecoilState should type takes a subtype of the default value given to its options object.
I'm so lost.
 
                        
Actually the linter is working as expected. You are setting the type of
ConnectionStateto beIConnectionStatebut you never include the propertykeyin the interface.Interface
IConnectionStateis correct but it should be nested within another Interface.If
IConnectionStatehas morekeyvalues to it then just do the same as I did withTTypewhere you form a union over the possible types thatkeycan exist as.