ESLint is not recognizing Partial
of typescript but the compiled module does not give any error.
const initialState: IAuthState = {
authenticated: false,
processing: false,
};
const authReducer = (state: IAuthState = initialState, action: any): IAuthState => {
const State = (newState: Partial<IAuthState>): IAuthState => ({...state, ...newState});
switch (action.type) {
case Actions.SIGN_IN_PROCESS_INITIATED:
return State({processing: true});
case Actions.SIGN_IN_PROCESS_FAILED:
return State({processing: false});
default:
return state;
}
};
I know that this can be suppressed by // eslint-disable-next-line no-undef
but still, I want an explanation for this and a permanent solution so that I dont get this not so error Error.