I have this code:
cellRendererFramework: (params: any) => {
return (<>{params.data.SOME_PROPERTY_FROM_USER}</>);
},
params
is an object. And I am accessing only params.data all the time.
I would like to define params.data
with typescript.
This is a working example:
cellRendererFramework: (params: any) => {
const userdata: User = params.data;
return (<>{userdata.SOME_PROPERTY_FROM_USER}</>);
},
Now sonarLint is telling me all the time I should remove the useless declaration of userdata. Understandable, because I am using userdata only to check the data structure of the user is correct.
In my perfect world I would like to write this:
cellRendererFramework: (params.data: User) => {
return (<>{params.data.SOME_PROPERTY_FROM_USER}</>);
},
But this is not allowed. Is there any good solution for this problem? Thanks